0
 $ ffmpeg -i video.any -vn -acodec libvorbis audio.ogg

April 21, 2019, 10:55 p.m.Janos

Explanation

-i is to specify the input file, which can be any kind of video file, such as mpeg, mkv, flv, and others.

-vn means "no video", effectively extracting audio only.

-acodec libvorbis specifies to encode the audio as ogg. To encode as mp3, use -acodec libmp3lame instead.

See more related tips at this gist.

Limitations

Requires ffmpeg, a video converter tool.