Re: [PyOpenGL-Users] animation question
Brought to you by:
mcfletch
From: Miriam E. <mi...@mi...> - 2010-02-28 20:46:06
|
Oops. I just realised I misread your question. Sorry. You were looking for a way to turn images into a movie format. The easiest, most flexible way I know of is using mencoder. It usually comes with mplayer. http://www.mplayerhq.hu Here is how I've encoded an avi from a directory full of jpg images I rendered using Blender: mencoder "mf://*.jpg" -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell The mf:// prefix refers to multiple files in the current directory. I haven't used mencoder with tiff files, but I expect that so long as you have the libtiff library it would probably work. Here is the relevant part of the mplayer manual: 13.8. Encoding from multiple input image files (JPEG, PNG, TGA, etc.) MEncoder is capable of creating movies from one or more JPEG, PNG, TGA, or other image files. With simple framecopy it can create MJPEG (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files. Explanation of the process: 1. MEncoder decodes the input image(s) with libjpeg (when decoding PNGs, it will use libpng). 2. MEncoder then feeds the decoded image to the chosen video compressor (DivX4, Xvid, FFmpeg msmpeg4, etc.). Examples. The explanation of the -mf option is in the man page. Creating an MPEG-4 file from all the JPEG files in the current directory: mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi Creating an MPEG-4 file from some JPEG files in the current directory: mencoder mf://frame001.jpg,frame002.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi Creating an MPEG-4 file from explicit list of JPEG files (list.txt in current directory contains the list of files to use as source, one per line): mencoder mf://@list.txt -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi You can mix different types of images, regardless of the method you use - individual filenames, wildcard or file with list - provided of course they have the same dimensions. So you can e.g. take title frame from PNG file, and then put a slideshow of your JPEG photos. Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current directory: mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc copy -oac copy -o output.avi Creating an uncompressed file from all the PNG files in the current directory: mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc raw -oac copy -o output.avi Note Width must be integer multiple of 4, it is a limitation of the RAW RGB AVI format. Creating a Motion PNG (MPNG) file from all the PNG files in the current directory: mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc copy -oac copy -o output.avi Creating a Motion TGA (MTGA) file from all the TGA files in the current directory: mencoder mf://*.tga -mf w=800:h=600:fps=25:type=tga -ovc copy -oac copy -o output.avi Larry Cuba wrote: > Anyone using PyOpenGL for animation? > i'm using PIL to write out 'frame buffer grabs' to Tif files. > > Now i need a utility (with a command line mode) to combine > Tifs into a movie file: mpeg or quicktime or AVI, etc. > > i thought VideoMach was my best bet, but it's > not taking an input filename on the command line > like it's supposed to and > the /Log option (to create a log for debugging) > causes a crash. (a bad sign). > > any suggestions? > > thanks. > > Larry C. > www.well.com/user/cuba > > > > > > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- If you don't have any failures then you're not trying hard enough. - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory ----- Website: http://miriam-english.org Blog: http://miriam_e.livejournal.com |