Creating an mp4 with black screen and silent audio (with ffmpeg)

Assuming you have a  black PNG image named blck.png, you can make it a mp4 video:

ffmpeg -loop 1 -i blck.png -t 900 -r 1 -c:v libx264 blck.mp4

And if you want to concatenate it with other mp4 (see previous post), it also needs to include a sound track. So, assuming your main files are in 48000hz (otherwise adjust), you can add it with the command:

ffmpeg -f lavfi -i anullsrc=r=48000 -i blck.mp4 -to 00:15:00 -c:v copy -c:a aac -strict experimental blck-snd.mp4

(note : -to needs to be set to the expected time, option -shortest fails)

 

 

Advertisements

8 thoughts on “Creating an mp4 with black screen and silent audio (with ffmpeg)

  1. Rom says:

    if i open the generated mp4-file i get an error in firefox: Error Code: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005)
    Details: auto __thiscall mozilla::SupportChecker::AddMediaFormatChecker::::operator ()(void) const: Decoder may not have the capability to handle the requested video format with YUV444 chroma subsampling.

    Any idea how to solve this?

    • I think you should first open the generated mp4 with a dedicated mp4 player (mpv, smplayer, vlc, etc). Such software is more likely to give you relevant info about the file, if there is a problem with the file (missing libraries, etc).

      As suggested by the error code you got “Decoder may not have the capability to handle the requested video format with YUV444 chroma subsampling”, it might be a Firefox decoder specific issue.

  2. Rom says:

    Yes. I think that firefox cannot handle YUV444, chrome does and VLC also.
    i checked another mp4-file and it has YUV420 and it works in firefox.
    Is it possible to create YUV420 video files with ffmpeg?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s