14

I am just trying to add a silent audio track to a video file using ffmpeg:

ffmpeg.exe -i video.mkv -i anullsrc -c:v copy -c:a aac -shortest test.mkv

I have ffmpeg precompiled release for windows 64bit (20170208)

Whenever I run I get this error:

anullsrc: No such file or directory

Thanks for any help.

Kod4krome
  • 559
  • 1
  • 4
  • 7
  • This question is not a duplicate; the linked question did not answer my question, which is about "No such file or directory", and the answer below solved my issue. – Matt Jul 14 '17 at 20:15

1 Answers1

30

I had to specify the lavfi filter as well and put it before -i anullsrc:

-f lavfi

For a complete commandline:

ffmpeg -i video.mkv -f lavfi -i anullsrc -c:v copy -c:a aac -shortest test.mkv
Sebastian Simon
  • 18,263
  • 7
  • 55
  • 75
Kod4krome
  • 559
  • 1
  • 4
  • 7
  • Thanks! This was the only answer that actually solved this specific problem. Any idea why it works? – Matt Jul 14 '17 at 20:15
  • 3
    @Matt Replying to an old question, but you have to tell `ffmpeg` which input is a filter by using the format option (`-f`) with value `lavfi` (libavfilter virtual input device). Omitting `-f` makes `ffmpeg` assume `anullsrc` is a file name. – llogan Sep 26 '18 at 21:57
  • And if the FFmpeg process goes forever use: `ffmpeg -f lavfi -t 1 -i anullsrc=cl=mono dummy.m4a` to generate a dummy silent file. https://superuser.com/questions/1260831/ffmpeg-conversion-runs-forever – Eftekhari Feb 05 '19 at 10:53
  • Thank you! Been looking everywhere for this. – code4days Nov 06 '20 at 17:39