Remove audio from a video with FFmpeg
Dropping audio never needs a re-encode: -an removes every audio stream while -c:v copy leaves the video packets untouched. The variants keep a single track, replace the sound with another file, or mute while keeping a track.
Verified with FFmpeg 9.0.1 on 26 August 2026. Search intent: ffmpeg remove audio.
ffmpeg -i input.mp4 -an -c:v copy silent.mp4Copies the video stream and drops the audio. The 12 s test file went from two streams and 4,896,094 bytes to one video stream and 4,695,067 bytes, in a fraction of a second, with identical frames.
Flags, explained
- -an
- No audio in the output: every audio stream is dropped.
- -c:v copy
- Copy the video packets as they are. No decode, no quality loss, near-instant.
- -map 0:v
- Select the video streams of the first input. -map 0:a:0 selects its first audio stream.
- -shortest
- End the output when the shortest input ends, so a 3-minute music file does not extend a 12 s clip.
- -af "volume=0"
- Audio filter that scales the samples to silence while keeping the stream.
Variants
The explicit form with -map
ffmpeg -i input.mp4 -map 0:v -c copy silent.mp4Select only the video streams of input 0. Byte-for-byte the same 4,695,067-byte result as -an; -map is the tool to reach for when a file has several tracks.
Keep only the first audio track of several
ffmpeg -i input.mp4 -map 0:v -map 0:a:0 -c copy one-track.mp4On a test file with an AAC and an MP3 track, the output kept the video and the first audio stream only, two streams, without re-encoding.
Replace the audio with another file
ffmpeg -i input.mp4 -i music.mp3 -map 0:v -map 1:a -c:v copy -c:a aac -b:a 160k -shortest replaced.mp4Video from the first input, audio from the second, encoded to AAC so the MP4 stays portable. -shortest stops at the shorter of the two. Output: h264 + aac, 12.0 s.
Mute but keep an audio track
ffmpeg -i input.mp4 -af "volume=0" -c:v copy -c:a aac muted.mp4Some players and platforms expect an audio stream to exist. This keeps a silent AAC track (re-encoded, video still copied). Output: 2 streams, 4,706,761 bytes.
Pitfalls we hit
- Without -c:v copy FFmpeg re-encodes the video by default (libx264, CRF 23), which takes far longer and changes the pixels for no reason.
- -vn is the opposite flag (drop video). Mixing them up produces an audio-only file.
- Replacing audio without -shortest keeps going until the longest input ends: a long music track produces a video with a frozen last frame.
- Some platforms reject silent videos or treat them differently. If the target needs an audio stream, mute with volume=0 instead of removing it.
How we verified it
Run with FFmpeg 9.0.1 on 26 August 2026 against a 12 s, 1280x720 H.264/AAC file (2 streams, 4,896,094 bytes). -an -c:v copy: 1 stream, 360 frames, 4,695,067 bytes. -map 0:v -c copy: identical 4,695,067 bytes. Two-track test file (AAC + MP3) with -map 0:v -map 0:a:0 -c copy: 2 streams, 4,896,094 bytes. Replace with an MP3 and -shortest: h264 + aac, 12.000 s, 4,921,947 bytes. volume=0 with AAC re-encode: 2 streams, 4,706,761 bytes.
The same edit as a typed operation
remove_audio_from_video probes the input, rejects files without a decodable video stream before any work starts, drops every audio stream with stream copy and returns a signed MP4 URL. No flags to remember and nothing re-encoded.
{
"inputs": [{ "id": "main", "url": "https://example.com/video.mp4" }],
"options": {}
}FAQ
Does removing audio with FFmpeg re-encode the video?
Not if you pass -c:v copy. The video packets are copied untouched and the command finishes in well under a second on a short file. Leaving out -c:v copy triggers a default re-encode.
How do I remove only one of several audio tracks?
Use -map to pick what stays: -map 0:v -map 0:a:0 keeps the video and the first audio track, -map 0:a:1 would keep the second. Everything not mapped is dropped.
How do I replace the audio track instead of removing it?
Add the new audio as a second input and map -map 0:v -map 1:a, with -c:v copy and an AAC encode for the audio. Add -shortest so the video does not outlast its new sound or the sound does not outlast the video.
Why does a platform reject my silent video?
Some encoders and upload pipelines expect an audio stream. Keep a silent track with -af volume=0 and -c:a aac instead of dropping it with -an.
Related commands
- ffmpeg extract audioExtract audio from a video with FFmpegRead
- ffmpeg trim videoTrim a video with FFmpegRead
- ffmpeg compress videoCompress a video with FFmpegRead