On Tue, 11 Feb 2003, CAULIER Gilles wrote: > I want make a preview frame for some MPEG files in a KDE application. > There is some issue to extract to a JPEG file just one frame from MPEG file ? >
try mpeg -> yuv -> ppm using mpeg2dec and y4mtoppm. To give you an idea mpeg2dec -s -o YUV movie.mpg | y4mtoppm -L | cjpeg > frame0.jpg will extract the first frame, in principle[*]. To get an arbitrary frame, you either need to extract the frame from the yuv stream before feeding to y4mtoppm or pipe the output y4mtoppm through pnmsplit and select the required frame. If you are interested, I have a small utility (y4mcut) that can select a specified interval of frames from a yuv stream: mpeg2dec -s -o YUV movie.mpg |y4mcut -s n -o 1| \ y4mtoppm -L -v 2 | cjpeg > frame_n.jpg will extract the nth frame. Its not very efficient if n is large, though. It will be nice to have an option to skip frames in mpeg2dec. Selva [*] assuming the first GOP is closed. ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Mjpeg-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mjpeg-users