Make PNG files into a video using FFmpeg

2

I have extracted all frames from an old video file, cleaned up video tape dropouts and film scratches frame by frame.

I now must reassemble the PNG files into a video .

I found this thread: https://stackoverflow.com/questions/24961127/how-to-create-a-video-from-images-with-ffmpeg

and modified what I found there to:

ffmpeg -r 1/5 -start_number 0 -i buggles%4d.png -c:v libx264 -vf "fps=25,format=yuv420p" out2.mp4

I have available only the first 500 frames @25 frames per second and am testing with that. It should yield a 20 second video

Instead I get a video of 41:35 in length that changes frames about every second and VLC reports 25 FPS.

Maybe I need to define that each image is on screen for only a single frame, but how?

Tekno Geekz

Posted 2019-09-29T06:20:41.827

Reputation: 81

Any chance you have a large number of duplicates of the input files somewhere in the input directory? – John Dvorak – 2019-09-29T06:26:35.230

-r 1/5 - this option seems strange. – Qwertiy – 2019-09-29T06:34:52.763

Remove -r 1/5 unless you want each image to last for 5 seconds. – Gyan – 2019-09-29T07:41:27.397

Answers

1

I can confirm that removing the -r 1/5 seems to work and reduces the length of the video.

Tekno Geekz

Posted 2019-09-29T06:20:41.827

Reputation: 81

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

– music2myear – 2019-09-30T23:38:26.933

1@music2myear Tekno Geekz can't critique or request clarification from the author, because he is the author who self-answered his own question. – karel – 2019-10-01T00:38:12.697

(1) You say “removing the -r 1/5 seems to work and reduces the length of the video.”  Does it reduce it to the 20 seconds you were expecting? (2) Please phrase this as a free-standing (self-sufficient) answer (giving credit to Gyan for suggesting it) rather than as an acknowledgement of a comment. … … … … … … … … … … … … … … … … … … … … Please do not respond in comments; [edit] your answer to make it clearer and more complete. – Scott – 2019-10-01T00:42:39.860

Oh, ah. Thanks for correcting me. – music2myear – 2019-10-01T01:41:57.757

Yes it reduces it to the expected 2o seconds 1/25 sec per frame. The only issue I have now is that if the frames are numbered like

test01234.png test01235.png test01236.png test01237.png test11000.png test11001.png test11003.png

The output video goes only to test01234.png and never moves on to test11000.png – Tekno Geekz – 2019-10-05T21:34:20.957