1

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
  • 2,215
  • 6
  • 28
  • 53

1 Answers1

2

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
  • 85,394
  • 9
  • 169
  • 201