pouët.net

Go to bottom

best codec for pure video noise

category: general [glöplog]
yep, it's that worst-case scenario: i need to capture some stuff, and save it as a video file for use on a web site. The file size has to be small as possible, the video is pretty much 100% random video noise, and I don't want to lose much quality. Any suggestions on how to encode it best?

And yes, there is actually a good reason for this other than "but it's art!!1", I made a 'white noise' screensaver (for osx). It grabs video from any attached camera, filters out anything not moving, and adds a ton of noise, so it looks like an untuned tv with 'ghost' type images if something moves or somebody walks past. There's a quick test video here (which also shows what happens when it gets compressed):

http://www.vimeo.com/2503479
added on the 2008-12-19 20:08:51 by psonice psonice
Crimbonice, maybe you can do something with flash, using the video processed but without the white noise, and then some generated white noise on flash... maybe it is better than trying to compress so much a video. Video codecs doesn't use to work very fine with noise, you know...
added on the 2008-12-19 20:26:42 by texel texel
Other idea: what about a high quality video, and control it from flash. I've seen that there is more time of white noise than things appearing. You can do a loop with the white noise frames, and then put some of the ghosts time to time...
added on the 2008-12-19 20:40:53 by texel texel
yeah, i know it only too well :/ Doing something in flash though.. well, it would probably be more work than the screensaver, especially as I don't know flash too well. Plus it could add some extra complexities..

I know that if people can run the screensaver, they must have a certain version of osx, which means they will 100% certain have quicktime with a lot of standard codecs, so it's guaranteed reliable.
added on the 2008-12-19 20:41:59 by psonice psonice
oh, second idea might be workable.. it's easy enough to write out a 2 second pure noise video, and it's easy enough to capture the processed video. Can flash do subtractive blending? The noise must be subtracted to look right
added on the 2008-12-19 20:44:12 by psonice psonice
Crimbonice, I suppose yes, let see what Trace say (he is an expert in Flash). But my idea was the video with the noise+ghosts already mixed, just to play with the video... maybe with 10 or 15 seconds of video you can loop it and make a minute, for example... it should be very easy to do that way...
added on the 2008-12-19 20:50:16 by texel texel
By other hand, the way you say, should compress extremely good
added on the 2008-12-19 20:53:04 by texel texel
Quote:
Blend modes in Flash
...

Difference Subtracts either the blend color from the base color or the base color from the blend color, depending on which has the greater brightness value. The effect is similar to a color negative.
...
Subtract Commonly used to create an animated darkening dissolve effect between two images.

http://livedocs.adobe.com/flash/9.0/UsingFlash/help.html?content=WSd60f23110762d6b883b18f10cb1fe1af6-7d5b.html
added on the 2008-12-19 20:56:09 by texel texel
looks promising, but as you say let's see what trace says :)

btw, I do want a longer video, showing more stuff going on. The noise can be looped, but I think i'll need at least a minute or so of video. Without the noise it would compress to nothing though, because the background removal stuff leaves just a plain grey screen except where there is movement.

Can anyone suggest the best way to compress the raw noisy video still though? If I can get acceptable quality in a not too big file, I think that would be good enough.
added on the 2008-12-19 21:21:11 by psonice psonice
you could generate noise procedurally...
added on the 2008-12-19 21:28:47 by Gargaj Gargaj
...which is what I have done. But I need a video capture, so people can preview it on my website :)
added on the 2008-12-19 21:31:15 by psonice psonice
I wonder why nosfe hasn't replied here yet.

Generally I've had very good experiences with H264 at high bitrates with random noise.
added on the 2008-12-19 21:36:35 by shock__ shock__
Although ... depending on the resolution/content other than noise ZMV (zipped motion video) might be good as well, but would prolly produce giant files ... but then again it's lossless.
added on the 2008-12-19 21:39:52 by shock__ shock__
Totally out of the blue, but do you think you could port your screensaver to a Flash applet who would capture webcam and display noised results in real-time ?

Or maybe even via a Java applet ?
added on the 2008-12-19 22:18:49 by cxnull cxnull
Hmm. I've worked on a project which required compressing noise with emphasis on high accuracy, and in my experience H264 was awful. Even at a high bitrate there were way too many compression artifacts to even be close to acceptable - the filesize was close to that of a lossless compression, too.

I ended up using a lossless codec - 30 seconds of pretty much pure noise at 1920x1080 was around 2GB IIRC (can't remember exactly, could have been a lot higher, I did a lot of encoding at various resolutions and durations), and performance wasn't great at that resolution, but you might get away with looping a short clip at lower resolutions..? There's little mainstream support for lossless codecs around however. I think k-lite codec pack includes one or two.
for windows also pl0x
but i mean, if it's flash, you could just generate the noise IN flash?
added on the 2008-12-20 00:00:54 by Gargaj Gargaj
cxnull: it's probably possible to port it to flash or whatever, but I've no idea how well it would run. It's mostly done in core image filters (which are a mac thing, basically a cut-down glsl for image processing, and it runs on the gpu for speed). I guess the same stuff could be done in flash or java, but it could be slow.

I've no intention of porting it to anything anyway, way too many other interesting projects on the go :)

alienus: considering this is for streaming off a website, lossless isn't really an option. H264 certainly is though, and I could probably do a low res 320x200 or so version to keep it manageable.. I don't need 100% quality.. some loss is OK, just so long as it doesn't look totally crushed like the vimeo clip. I think I'll just have to experiment.

gargaj: probably, but I know nothing about flash, and it's not worth the time to learn it for this.
added on the 2008-12-20 00:39:47 by psonice psonice
yeah but if it's a flash video, you dont have much of a chance apart from h264, right?
added on the 2008-12-20 01:54:46 by Gargaj Gargaj
crimbonice:

I'm not sure of how are you generating the noise, but, suppose a 640x480 video. Then, do a, let say, 1280x960 texture of noise, compressed by jpeg. Then, random croppings of 640x480 in size of the bigger texture would make the noise look good enough (I believe so). Well, probably having some minimum distance between croppings between two frames. Also mirroring and rotation would help.

The mirroring and rotation would help even with the video loop.
added on the 2008-12-20 01:58:45 by texel texel
Once you find out how to compress noise can you get to work on refuting the second law of thermodynamics and finding an algebraic value of pi as an encore.
added on the 2008-12-20 02:03:41 by Claw Claw
texel: in my experience just a really damn fast sin()/cos() on the texture coordinates does the job :) (hooray for aliasing!)
added on the 2008-12-20 02:09:45 by Gargaj Gargaj
Gargaj: in Flash it is slow to calc things pixel by pixel... it is possible, but very slow.
added on the 2008-12-20 02:16:52 by texel texel
that's why i said "texture coordinates" - although i perhaps should've clarified that i meant them as offsets (i.e. just place the large noise texture on screen and "circle" it really fast)
added on the 2008-12-20 02:23:06 by Gargaj Gargaj
Sorry Gargaj, now I get the point :)
added on the 2008-12-20 02:34:04 by texel texel

login

Go to top