There is no need to rename files if using the -start_number
switch like so:
ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi
where n
is the start of the sequence of stills.
Note, this will work as long as the sequence is unbroken once it starts. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps.
There are some other switches you might find useful.
I use the following one-liner to get a slower frame rate and to compress the images and have a smaller resulting video:
ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 -r 3 -i Imgp%04d.jpg -s 720x480 test.avi
The -r 3
option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. The -s
option rescales the pictures to the desired resolution to manage the size of the resulting video.
(In the Windows shell, replace -i Imgp%04d.jpg
with -i "Imgp%%04d.jpg"
. Credit for this to Mike Fitzpatrick https://superuser.com/a/344178/153054)
Try
ffmpeg -i input.mp4 -r 1 -q:v 1 -qmin 1 -qmax 1 output_%01d.jpg
If not good enough, use
ffmpeg -i input.mp4 -r 1 output_%01d.bmp
and use another JPEG encoder.
Best Answer
First you need to install ffmpeg. It is a command line tool.
https://video.stackexchange.com/a/20496/25366
Now use following code to export all frames. (Note: it may produce thousands of images)
https://www.bugcodemaster.com/article/extract-images-frame-frame-video-file-using-ffmpeg