How to extract audio from a video file using Linux

A video file is often a container that wraps separate internal video data and audio data. Sometimes we want to save the audio from a video file. Using Linux this is how we can do it:

First, for information purposes only, we can get information about the file using

ffmpeg -i my-movie.webm

Secondly, we can extract the audio using

ffmpeg -i my-movie.webm -vn -acodec copy my-movie-audio-only.opus
 

Posted on Feb 19, 2018 in Articles | Tags: LinuxAudioVideoffmpeg