FFmpeg cheatsheet

FFmpeg: Audio

6 common FFmpeg tasks.

Extract the audio

Save the audio track as MP3 and drop the video.

ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3

Extract the audio without re-encoding

Copy the existing audio stream. The file extension must suit the codec.

ffmpeg -i input.mp4 -vn -c:a copy audio.m4a

Remove the audio

Drop every audio stream from the output.

ffmpeg -i input.mp4 -an -c:v copy silent.mp4

Replace the audio track

Keep the video and use audio from another file.

ffmpeg -i video.mp4 -i audio.mp3 -map 0:v -map 1:a -c:v copy -shortest output.mp4

Normalize loudness

Adjust the volume to a consistent loudness.

ffmpeg -i input.mp4 -af loudnorm output.mp4

Change the volume

Make the audio 50% quieter. Use 2.0 for twice as loud.

ffmpeg -i input.mp4 -af volume=0.5 output.mp4

Was this page helpful?