0

I'm trying to generate a black video with FFMPEG. I have accomplished this with the following:

ffmpeg -t 5 -f lavfi -i color=c=black:s=1920x1080 -c:v libx264 -tune stillimage -pix_fmt yuv420p out.mp4

Unfortunately this video doesn't have any audio tracks. Following this, I have tried to insert -i anullsrc=channel_layout=stereo:sample_rate=44100:

ffmpeg -t 5 -i anullsrc=channel_layout=stereo:sample_rate=44100 -f lavfi -i color=c=black:s=1920x1080 -c:v libx264 -tune stillimage -pix_fmt yuv420p out.mp4

Unfortunately this gives the error:

anullsrc=channel_layout=stereo:sample_rate=44100: No such file or directory

How can I modify my initial script to generate a video with empty audio?

David Ferris
  • 1,883
  • 4
  • 25
  • 44

1 Answers1

1

anullsrc is also a source filter so it too needs -f lavfi before it.

ffmpeg -f lavfi -t 5 -i color=c=black:s=1920x1080 -f lavfi -t 5 -i anullsrc=channel_layout=stereo:sample_rate=44100 -c:v libx264 -tune stillimage -pix_fmt yuv420p out.mp4

Gyan
  • 74,575
  • 7
  • 138
  • 171