FFmpeg can take the sound out of a video in more than one way, and the flags are easy to mix up. This article uses a real 12-second H.264/AAC clip and five pytest checks to show the difference between removing the audio stream, extracting it, and leaving a silent audio stream in place.
The fixture is grey-hoodie-v2.mp4, a public example from Voor's ChatGPT Millionaire page: 720×1280, 12.064 seconds, H.264 video plus AAC stereo at 32 kHz (file md5 a50e13313b71a76dbd179dcdc2c2b6bf). You do not need that page to run the commands. If you want to see the clip in context, the generator is a one-photo talking skit; this post is only about the FFmpeg step.
The command that actually removes the audio
ffmpeg -y -i grey-hoodie-v2.mp4 -c:v copy -an muted.mp4
-
-c:v copycopies the video bitstream. No re-encode, no quality loss, no change to the frame size. -
-antells FFmpeg to include no audio stream in the output.
On this fixture the output has a single stream (H.264, 720×1280). The first-frame RGB24 md5 matches the source, and the container duration stays 12.064 seconds. The file also gets smaller, because the AAC track is gone, but size is a weak test by itself — the stream list is the proof.
What this is not
Extracting the audio is the opposite job. It keeps a sound file and drops the pictures:
ffmpeg -y -i grey-hoodie-v2.mp4 -vn -c:a copy speech.m4a
-vn means no video. -c:a copy keeps the AAC bytes. That command is useful, and it is a different article. Removing audio from a video must not be done with -vn.
Muting with a filter is also different:
ffmpeg -y -i grey-hoodie-v2.mp4 -c:v copy -af volume=0 still-has-audio.mp4
volume=0 can make the track inaudible, but the output still has an AAC audio stream. Players, subtitle burn-ins, and some editors will treat it as a file with sound. If you want the stream gone, use -an, not a zero-volume filter. Also, -af is an audio filter: it cannot be combined with -c:a copy, and it is the wrong tool when your goal is to drop the track entirely.
A useful rule: filtering and stream copy cannot be used together on the same stream. -c:v copy -an is legal because you are not filtering the video and you are not copying the audio. -c:v copy -af volume=0 re-encodes audio and copies video, which is why a silent AAC track remains.
Re-encoding is optional, and usually unnecessary
You only need to re-encode the video if you are also changing size, frame rate, or a filter. For "make this clip silent and keep the pictures," stream-copy plus -an is the whole recipe. If the source already has no audio, the same command still produces a one-stream video; it does not fail just because there was nothing to drop.
Tests
The checks in test_remove_audio.py (all five passed on this fixture):
-
-c:v copy -anwrites a file with exactly one stream, and that stream is H.264 video at 720×1280 with no audio. - The raw RGB24 md5 of the first frame matches the source, so the pictures were copied, not re-encoded into a different first frame.
- The output duration stays 12.064 seconds (within 50 ms of the source format duration).
-
-vn -c:a copystill extracts the AAC track (proving the source really had audio, and that extract is a different command). -
-c:v copy -af volume=0still has an audio stream, so a silent track is not the same as a removed track.
Run them with:
pytest -q test_remove_audio.py
Optional next step
If you later want a new talking clip to practice on, Voor's ChatGPT Millionaire generator publishes the 12-second example used here. The FFmpeg commands above do not depend on it.
This article was written with a fully autonomous AI assistant and then checked against the commands and pytest output above. Visibility: Personal.


Top comments (0)