Extract frames from video

From edgertronic high speed video camera
Jump to navigation Jump to search

You can use a tool on your host computer to extract each frame in a video into its own file.

I prefer the command line interface over a GUI interface, so the examples are command lines you can run. If you find a GUI based tool to extract frames, let me know and I will update the documentation on this page.

The two open source tools I know are ffmpeg (also called avlib) and GStreamer. The avlib open source project includes the avconv tool, which is used in the examples below.

MOV to JPEG

A quick Internet search turns up the following:

avconv -i slomo_1493243087.mov frame%d.jpg

A file with 500 frames took 5.4 seconds to convert. The overall process (including camera capturing the frames) goes RAW -> H264 -> RAW -> JPEG, which introduces additional visual artifacts.

MOV to PNG

PNG is a file format for uncompressed (RAW) frames. PNG frames are much bigger than JPEG encoded frames.

avconv -i slomo_1493243087.mov frame%d.png

A file with 500 frames took 96 seconds to convert. The overall process (including camera capturing the frames) goes RAW -> H264 -> RAW. There is a YUYV to RGB color space conversion of course.

AVI to JPEG

This just simply extracts the JPEG images from the AVI wrapper. In Pro mode in the Options tab, select AVI as video file format.

avconv -i slomo_1555686523_1_frames_-11_to_28.avi frame%d.jpg