5

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 and produces a black video MP4 file.

ffmpeg -r 1 -i frame%d.png -pix_fmt yuv420p 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 1

0

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
  • I tried with -r 5, -r 10 and -r 20, and I still get a black video.
    – Micha
    Commented Apr 12, 2018 at 21:09
  • Your input is 4096x8192! Many players will refuse to play as that's compliant with a recently added H264 level. Downscale by adding -vf scale=-2:1080,setsar=1 after the -r 5
    – Gyan
    Commented Apr 13, 2018 at 6:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .