Black video generated by ffmpeg

When I generate a video starting from a sequence of .png snapshots, the output video is black. Here is a minimal working example: I generate the video from these two frames with the following command on Ubuntu 16.04.4 LTS

$ ffmpeg -r 1 -i frame%d.png -pix_fmt yuv420p video.mp4

and obtain a black video.mp4.

Do you know a way around this? I know that a similar question has been asked, for example, here, but the solution does not solve the problem in my case.

1 Answer

Some players don't like low framerate videos. The workaround is to set a high output rate.

ffmpeg -framerate 1 -i frame%d.png -r 5 -pix_fmt yuv420p video.mp4

5 should be enough, but try 10 if not.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like