I'd like to extract the audio from an mp4 video. Is there a software for Ubuntu, which does the job?
3 Answers
You can use ffmpeg
:
ffmpeg -i /PATH/TO/INPUT.mp4 /PATH/TO/OUTPUT.mp3
If it is not installed, you can install it with:
sudo aptt install ffmpeg
You can find a help page on using ffmpeg here, or by running ffmpeg --help
or man ffmpeg
. On some older versions of Ubuntu it is sometimes called avconv
, which is largely similar in functionality.
For the above commands, you use the Terminal, which can be accessed by opening it from the dash/launcher, or by pressing Ctrl+Alt+T.
-
2At present ffmpeg can not be installed easily on Ubuntu >= 14.04. Use
avconv
with same terminology instead.– TakkatOct 21, 2014 at 21:30 -
1How can I keep the original audio data without re-compressing it? I have an mp4 file with aac audio.– ygoeAug 6, 2015 at 17:22
-
8At a guess
ffmpeg -i in.mp4 -vn -c:a copy out.m4a
-vn
removes the video andc:a copy
copies the audio track over. mp3 is a different format so it would need to be re-compressed (with e.g.ffmpeg -i in.mp4 -vn -ab 250k out.mp3
).– WilfAug 6, 2015 at 18:01
If you don't want to use the terminal and you don't have any real demands to do the job, you can always use VLC player to do this, which is probably installed in your distribution.
- Open VLC player.
- From the menu bar, please select "Media" and then "Convert/Save".
- Click "Add" and select your file.
- Click "Convert/Save".
- You should then select "Audio - MP3", enter a name in the "Destination File" and then click "Start".
Your file should converted to MP3 format in no time.
I think that the most detailed answer with several options can be found here: