DEV Community

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

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

2

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more