Convert Series of PNG's into MP4 Video Using FFMPEG Where Each Photo is 1 Frame and Each Frame is Played for 1 Sec
VLC has a problem with playing low framerate videos. Use
ffmpeg -framerate 1 -i NR_1_%05d.png -r 10 -c:v libx264 -crf 15 -pix_fmt yuv420p out.mp4.
The images will still turnover at 1 Hz but there will be 9 duplicates frames per second. x264 is efficient at coding duplicate frames so size won't increase 10 fold.
Related videos on Youtube
Comments
-
Royi over 1 year
I have a series of 15 PNG Files - https://www.sendspace.com/file/jrpbl1.
I would like to create an MP4 Video of them using FFMPEG.
In my video I'd like to have 15 Frames (One per image) where each is played 1 Sec (FPS 1).I downloaded the latest FFMPEG for Windows (Version 3.2.4).
I followed the guide FFMPEG - Slideshow.The command line I used is
ffmpeg -framerate 1 -i NR_1_%05d.png -c:v libx264 -crf 15 -pix_fmt yuv420p out.mp4
.
I also triedffmpeg -r 1 -i NR_1_%05d.png -c:v libx264 -crf 15 -pix_fmt yuv420p out.mp4
(What's the difference between-r 1
and-framerate 1
?).Yet the resulted video is not as expected.
The first frame is black and then there is only one image as constant (I watch it on VLC Media Player).Any idea how to product it correctly on Windows?
Thank You.
-
Admin about 7 yearsI found this - lists.ffmpeg.org/pipermail/ffmpeg-user/2013-July/016273.html and this unix.stackexchange.com/questions/68770/….
-
-
Royi about 7 yearsIt is crucial for me that the output video has exactly 15 Frames (Each image as a frame). I don't really need VLC Compatibility. What's the difference between using
-r
and-framerate
? -
Gyan about 7 years
framerate
sets an internal variable in the stream struct that ffmpeg creates.r
generates new timestamps at that rate. The former is referred to by filters and muxers. For image sequences, there's no practical difference, but the former is the recommended method. Check your first command with ffplay. It should be fine. -
Royi about 7 yearsSo basically this is a VLC Player issue. I still didn't get the difference between them. Is there an example which shows the difference? Thank You.