What program on Linux would allow you to convert all the frames in an AVI into a series of JPEG files?
-
possible duplicate of [how to convert avi file to an jpg's images array using .net ](http://stackoverflow.com/questions/2724542/how-to-convert-avi-file-to-an-jpgs-images-array-using-net) – Cerin Jun 09 '10 at 01:50
5 Answers
Use ffmpeg.
ffmpeg -i infile.avi -f image2 image-%03d.jpg
Check out this answer on stackoverflow, as pointed out by Chris S.
I also found this article entitled "Creating Animated Screenshots on Linux" which details the process of using mencoder to capture sequential screenshots. (The end of the article discusses taking those screenshots and encoding them into another format, but you can disregard that part.)

- 1
- 1

- 4,420
- 2
- 23
- 33
-
I've used the above line for the same purpose and it seemed to work except not quite. When recording my video, I recorded at a rate of 1000fps and the video turned out to be 2min29sec long. If my math is correct, that should amount to a total of 149,000 frames for the entire video. However, when I ran 'ffmpeg -i myfile.avi -f image2 image-%05d.bmp", I only obtained 4472 files. How can I get the original 149k frames? – Myx Oct 12 '10 at 00:03
-
I also tried to convert the frame rate of my original AVI to 1000fps by doing 'ffmpeg -i myfile.avi -r 1000 otherfile.avi' but this didn't seem to fix my concern. – Myx Oct 12 '10 at 00:15
avconv -i 'in.mov' -vsync 1 -r 100 'out-%03d.jpeg'
This will convert the input movie into individual frames. Using 100 after the r will pull 100 frames per second; using 1 will pull 1 frame per second. In this example the output files will be out-001, out-002, out-003, ...etc. Be careful when using a higher frame rate as the number of frames will be the framerate time the duration of the video +-1.

- 71
- 1
- 1
convert your_clip.avi %d.jpg
where %d
will get replaced with a number.
Bonus: convert 1.jpg 2.jpg moving.gif
makes a gif out of those two pictures.
The convert
command comes from ImageMagick (apt install imagemagick
).

- 5,339
- 2
- 48
- 48
MPlayer/MEncoder could be of help. I have used it to convert movie files into formats that occupied lesser space. But not for extracting jpegs yet.

- 7,817
- 2
- 25
- 25