DEV Community

Cover image for Easily remove or extract the audio from a video with ffmpeg
Donald Feury
Donald Feury

Posted on • Updated on • Originally published at donaldfeury.xyz

Easily remove or extract the audio from a video with ffmpeg

It turns out removing the audio from a video is very easy with FFMPEG!

To remove the audio from a video:

ffmpeg -i video.mp4 -c:v copy -an out.mp4
Enter fullscreen mode Exit fullscreen mode

The -an option will completely remove the audio from a video, and since we're just copying the video codec as is, this most likely will only takes seconds.

To extract the audio from a video:

ffmpeg -i video.mp4 -vn audio.wav
Enter fullscreen mode Exit fullscreen mode

As you might have guessed, the -vn option will remove the video stream from the output, leaving only the audio. In this case, I'm re-encoding the audio as WAV, as that is a very good encoding to work with in terms of further processing.

Top comments (0)