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
-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
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.