Removing an Audio Track From a Video Without Re-Encoding
If you have a video file and you want the same video without sound, the correct operation is not a re-encode. It is a container-level track drop. The video stream stays byte-for-byte identical, the audio stream is discarded, and the operation runs at disk speed. Most "mute video" tools re-encode the video anyway. That is slower and lossy, and it is unnecessary for any MP4, MOV, MKV, or similar…
To remove an audio track from a video file without re-encoding, it is not necessary to re-encode the video. Instead, the operation should be performed at the container level, which involves dropping the audio track while keeping the video stream unchanged. This process is fast and lossless, resulting in a bit-identical output file to the original input.
Modern video containers store various streams independently inside the container. When removing the audio, the stream table of the container should be read, and the audio streams should be skipped when writing the output file. The video stream's samples should be copied through unchanged, and a new container should be written with only the video stream registered. This means that no decoding or re-encoding takes place, and the output video is identical to the input at the sample level.
Using the command line, the operation can be performed with the ffmpeg tool using the command: ffmpeg -i input.mp4 -c copy -an output.mp4. The -c copy flag copies every stream through without re-encoding, while the -an flag drops the audio track. This operation runs at disk speed and takes only seconds for a two-hour movie on an SSD.
The common mistake is forgetting to include the -c copy flag, which causes ffmpeg to default to re-encoding the video, taking minutes and potentially lowering the video quality. Similarly, some browser tools run the same operation in the browser using ffmpeg-wasm. This also runs entirely in the tab through WebAssembly, with the video never leaving the machine, and finishing in seconds.
The wrong approach is to mute the audio by setting its volume to zero or writing silence over the audio samples. Both methods are wasteful, as the audio track remains in the file, taking up space and requiring decode buffers from players. Muting and removing audio are not the same operation. Some tools also decode the audio to silence and re-encode it, which is still wasteful, as the file still contains an audio track that is not doing anything.
If using -c copy is not possible, such as with live streams or partial files, either waiting for the recording to finish or accepting a re-encode for the muted output may be necessary. However, removing audio from only part of the video (e.g., muting the first ten seconds) requires a re-encode of the entire file, as selective sample removal is not possible without re-encoding.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.