Ffmpeg PNG to mp4 - Black screen

I can create mpg video using this line

ffmpeg -f image2 -i 100%03d0.png movie.mpg

      

But if I try to create an mp4 video, I get a black screen video.

ffmpeg -f image2 -i 100%03d0.png movie.mp4

      

My directory with numbers looks like this: 1000010.png, 1000020.png, ... 1001260.png

+3


source to share


1 answer


Adding -pix_fmt yuv420p

should solve the problem:

ffmpeg -i input_%03d.png -pix_fmt yuv420p movie.mp4

      



From the FFmpeg Wiki :

"By default, when using libx264 and depending on your input, ffmpeg will try to avoid color subsampling. Technically this is preferable, but unfortunately, almost all video players, excluding FFmpeg-based Players, and many online video services only support the YUV color space with oversampling 4: 2: 0 color.

Using options -pix_fmt yuv420p

or -vf format=yuv420p

will maximize compatibility. "

+7


source







All Articles