1

I'm using this solution to convert animated GIF to MP4.

https://unix.stackexchange.com/a/294892

I'd like to add a silence audio track to the output.mp4

I think it will solve the problems I have when adding these generated mp4 files to other videos using avidemux.

How could I add a silence audio track using ffmpeg?

1 Answer 1

1

Use the anullsrc filter:

ffmpeg -i input.gif -f lavfi -i anullsrc -vf "scale='trunc(in_w/2)*2':'trunc(in_h/2)*2',format=yuv420p,fps=10" -movflags +faststart -shortest video.mp4
  • -f lavfi -i anullsrc Sets anullsrc filter as an input. Used to generate silent audio.
  • scale='trunc(in_w/2)*2':'trunc(in_h/2)*2' Use scale filter to make output width & height to be divisible by 2 which is needed for 4:2:0 chroma subsampling.
  • format=yuv420p Uses format filter to set chroma subsampling to 4:2:0 which is needed for compatible H.264.
  • fps=10 Set output frame rate to a compatible rate using fps filter.
  • -movflags +faststart Makes output begin playback faster.
  • -shortest Makes output the same duration as the shortest input (input.gif in this case as anullsrc has indefinite duration).
1
  • thanks, it's working! I was able to concatenate videos using Avidemux thanks to this audio track. It has solved also my problem with Avidemux
    – virilo
    Commented Nov 15, 2020 at 8:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .