Advertisement

ffmpeg extract video to picture

top computer
ffmpeg -i sea.mp4 -r 1 sea-%04d.jpeg

FFMpeg is a framework for encoding, muxing, transcoding, streaming and playing video files, and is the backbone of a vast array of video converters and players. It runs only from the command line so is better suited to experienced users. FFMpeg should handle just about any video file you throw at it. Here’s a simple command line argument.
ffmpeg -i videofile.mpg -r 1 image-%04d.jpeg
The -i is the input video file with path and the jpeg filename simply saves jpegs (you can also use png, bmp, tiff etc) with the name and 4 place holding numbers, e.g. image-0001. The -r command is the frames to capture and the reverse of how you would expect it to work. 1 will save a frame every second while 0.5 will save every 2 seconds, 0.2 every 5 seconds, 0.1 every 10 seconds, 0.0167 for 60 seconds and etc. Use 1/seconds in Windows Calculator to get the ratio you need.


Read More: https://www.raymond.cc/blog/extract-video-frames-to-images-using-vlc-media-player/

More advanced usage can add a starting point in the video file with the -ss command before -i, while -t can also be used to add a duration. Both use an [hours:]minutes:seconds argument.
ffmpeg -ss 04:00 -t 03:00 -i videofile.mpg -r 0.033 image-%04d.jpeg
Read More: https://www.raymond.cc/blog/extract-video-frames-to-images-using-vlc-media-player/

The above command will start at 4 minutes in, then save a .jpg at 30 second intervals for 3 minutes.