Thursday, February 4, 2010

This is a test...

On the subject of my question from a couple of days back about how to compress .avi files from a digital camera.

Regular reader The Grey Lady contacted a friend who goes by "Andy The Chicken" ... no, I didn't ask. He contacted me. I sent him the shortest video clip I could contrive from the camera, shot at its lowest resolution. The size of that file was just under one Meg, as big as I can safely email with my poky satellite connection.

He promptly returned it to me in a different format, now sized 156K. I just got around to finding out if I can upload it to Blogger direct from my poor suffering old 'pooter. It took roughly forever, but it did go. And the result is...
video whole second of grainy video, and that's straining the hardware to the max. Probably I could do it with useably-long clips if I loaded it to a sharing site, but I don't have the compression software and won't worry about it now. We're gonna put this experiment aside until I get the new machine up and running, and learn the quirks of Linux. Then maybe I'll find out how to compress files myself, and we'll try it again harder.

But thanks, all! This is an education. It turns out (Per Andy) that the reason the files coming out of the camera are so big is that there's no compression at all - the file is saving every single frame with no use of the similarity between frames to keep the file size reasonable. So I'll set this aside and play with it later.

Can you tell Little Bear really doesn't like having his picture taken?


dbd said...

I have found great success with:

mencoder -o -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=

dbd said...

Rats the comment system ate my brackets. Here it is again:

mencoder INPUTFILE -o OUTPUTFILE -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=

Joel said...

Uh, yeah. I've tried Om Mani Padme Hum, but never had much success with it.

Give an old Luddite a break. I haven't typed a command line since the invention of Windows. Is this a command you type into DOS, after downloading something called "mencoder?" I see the syntax, but where do the file names go? Is that what INPUTFILE and OUTPUTFILE mean? Small words, please.

Andy The Chicken said...

Just for the record, the camera is doing *some* compression, it's just that it's taking each frame as an individual picture (and compressing it in the same way as it does still photos), i.e. it's not using the similarity between one frame and the next.

DBD's command line also works, but it produces a much larger file. 649kB, to be exact, or around two thirds of your original.

Here are my command lines (I used two pass):
D:\me\mencoder.exe movie3.avi -o movie3.mpg -mc 0 -ofps 30 -srate 44100 -oac mp3lame -lameopts vbr=2:q=8:aq=0:mode=1:lowpassfreq=16000 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800:vhq:vpass=1:vqmin=1:vqmax=31

D:\me\mencoder.exe movie3.avi -o movie3.mpg -mc 0 -ofps 30 -srate 44100 -oac mp3lame -lameopts vbr=2:q=8:aq=0:mode=1:lowpassfreq=16000 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800:vhq:vpass=2:vqmin=1:vqmax=31

But Joel, don't try to understand this, we will write a 'batch file', or on Linux, a 'shell script' that will do all this for you. You can even 'drag and drop' your movies onto the script, if that's what makes you comfortable!

Andy The Chicken said...

By the way, you didn't ask why "and the chicken" but here's the reason:

Andy The Chicken said...

Sorry to flood your blog with comments, but I just noticed that 'blogger' has even FURTHER compressed your movie. It started at 933KB, and I compressed it as much as I could to 156KB. However, the movie as it's displayed is a tiny 68KB!!! That's a ridiculous amount of compression, and also the reason why the video now looks so 'blocky'. I think you should use a different hosting solution for the videos, one which doesn't squeeze all the quality out of them!