Linux: "video to mp3"

From Luky-Wiki
Revision as of 19:20, 14 March 2014 by Lukas Dzunko (talk | contribs)

Jump to: navigation, search

Problem: I have video file with concert or music show and I would like to play it in car or on phone.

I both cases it is enough to have audio track and it is necessary to have correct format. My car radio can play only mp3 files (and of course regular cdda).

Here are steps how to get sound track from video and store it as mp3. It is possible to do it directly via ffmpeg but I prefer lame mp3 creator. Depending on source I normalize tracks before converting to mp3. This is also recommend only on lossless file formats.

Step 1 - extract audio from video file

ffmpeg is powerful video converter. With correct option it can "dump" audio or directly create mp3. I am using following way to extract audio:

video with stereo audio track

ffmpeg -i input.mkv -vn output.wav

-i == input file, -vn == no video processing ==== video with DTS audio track (5.1 or all other X.Y combinations)

ffmpeg -i input.mkv -vn -ac 2 output.wav

-ac == number of output channels