simple images-to-video converter for mac/unix?
March 4, 2006 1:19 PM   Subscribe

can anyone recommend a simple piece of Mac (or unix) software that will take a bunch of image files named abc001, abc002, etc and string them together into a video file that i can view with a lowest-common-denominator video player?

i have some code that spits out a bunch of images - currently into the simple PPM format that's part of netpbm package. the images have filenames with sequential numbers in them, and i want software that will just string them together in order into one of the more common (mpeg, avi, quicktime, or whatever) video formats.

i was planning to use ppmtompeg that comes with netpbm but i'm having a hard time getting the netpbm package to compile on my powerbook. while i try to sort that out, i'm wondering if there's any other software available to do what i want?

i see from this thread that apparently quicktime will do this, but i suspect i need the quicktime pro that you have to pay for, as opposed to the free quicktime player.

so, my only absolute requirement be that the software is free. it would be nice if it supported the PPM format (if not, i can batch-convert my images in graphic converter) and extra nice if i could run it from the command line like ppmtompeg so that i can incorporate the conversion into a shell script.

any ideas? thanks in advance!
posted by sergeant sandwich to Computers & Internet (6 answers total) 1 user marked this as a favorite
This script will use mencoder from the mplayer package to do it. If it doesn't do exactly what you want, it'll at least show you the mencoder invocation that gets you close.
posted by mendel at 2:31 PM on March 4, 2006

Best answer: Definitely mencoder, I use it all the time to generate demo videos (warning, 12MB DivX containing addictively mesmerising geometry; self-link obviously) from my OpenGL engine.

The manpage is helpful but takes a lot of close reading. The command line option that gives you input from a bunch of files is to use source as "mf://filemask", eg:
mencoder "mf://*.jpg" -mf fps=25 -o myfile.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1800:autoaspect -ffourcc DX50

lavc is libavcodec and specifying codec mpeg4 will give you their variant of DivX which should work most places. 1800 is the bitrate in kbps, fiddle with it to adjust quality. By default lavc uses the FMP4 fourcc (four-character codec identifier) which seems to be recognised only by mplayer in linux and (in windows/mac) VLC. It's compatible with DX50 (DivX 5) at the moment, so forcing the identifier to that will allow it to play back on dumber decoders.

If you want absolute lowest common denominator, go for MPEG1. The quality will be lower for the same bitrate though:

mencoder "mf://*.jpg" -mf fps=25 -o myfile.mpg -ovc lavc -lavcopts vcodec=mpeg1video:vhq:vbitrate=1800:autoaspect

Though ppmtompeg can produce mpeg2 (nice quality), I find there is a distinct lack of players on windows that can play it. You can produce mpeg2 with mencoder as well but I'd avoid it for the same reason: there are more machines out there capable of playing DivX than mpeg2. Plus the quality is higher for a given size.
posted by polyglot at 5:09 PM on March 4, 2006

Or, I should say, "mf://abc*.jpg"
posted by polyglot at 5:10 PM on March 4, 2006

matlab could do this. Output is avi. I'm sure there are easier and cheaper ways though.
posted by zpousman at 5:39 PM on March 4, 2006

Dude, matlab is a long way from free. And it requires significant effort to produce video output compared to a single shell command.
posted by polyglot at 6:41 PM on March 4, 2006

Response by poster: awesome, polyglot. also in the meantime i found a binary version of netbpm compiled for darwin, so between these 2 things i should be all set. thanks!
posted by sergeant sandwich at 7:12 PM on March 4, 2006

« Older May I ever use a stock graphic in a logo?   |   How do I keep headphone wires from fraying at the... Newer »
This thread is closed to new comments.