Insert Blank Audio into Video with FFmpeg

This article provides a quick, practical guide on how to add a silent or blank audio track to an existing video file using FFmpeg on Linux. Whether your original video has no audio stream at all, or you need to replace a damaged soundtrack with absolute silence, you will learn the exact command-line syntax required to generate a null audio source and merge it seamlessly with your video container without re-encoding the video track.


The Base Command

To insert a blank audio track into a video, you use FFmpeg’s anullsrc filter to generate silent audio on the fly, and then map both the original video and the newly created silence into a final output file.

Here is the standard command to accomplish this:

ffmpeg -i input.mp4 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -c:v copy -c:a aac -shortest output.mp4

Command Breakdown

Understanding what each parameter does allows you to tweak the command to fit your specific file requirements:

Handling Videos that Already Have Audio

If your input video already contains an audio track that you want to completely replace with silence, you must explicitly tell FFmpeg to ignore the original audio stream. You can achieve this by adding the -map flags to manually choose your inputs:

ffmpeg -i input.mp4 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -map 0:v:0 -map 1:a:0 -c:v copy -c:a aac -shortest output.mp4

In this variation, -map 0:v:0 selects the first video stream from the first input (input.mp4), and -map 1:a:0 selects the first audio stream from the second input (the silent anullsrc). Any audio originally embedded in input.mp4 is discarded in the output file.