2

It sounds strange to ask this question as it has been asked before. However the answers only refer to converting video files into audio files. I would like to get into the container and separate the video file from the audio file and only keep the audio file. Simple conversion of the container to the audio file, makes the file way to big, and containing more info than I need. Converting the whole container file (avi, mpg, wav.....) etc is easy enough but that does not do the trick. Preferably I would like to do this without using the terminal. Working with the latest version of Ubuntu at this moment (march 2014). Also please do not suggest any cross platform ideas. I run my computer on only Ubuntu, there is nothing left of any other OS.

H.W. Roos

Kludde
  • 31
  • 1
    How is extracting audio from a video file different from converting a video file to an audio file? I didn't get this. – jobin Mar 10 '14 at 10:28
  • possible duplicate of best video converter – rusty Mar 10 '14 at 13:20
  • the multimedia transcoding apps mentioned in the link should help.. also check audacity, WinFF (graphic frontend to ffmpeg).. – rusty Mar 10 '14 at 13:24
  • @Jobin. Video conversion in this case compresses the container file. (avi etc) The container file itself already contains the audio file, plus at least also the video file and in some cases an subtitle file. So by converting that you contain the audio file but compress the original audio file. Thus breaking open the container and retaining the original audio file, makes the end result a bit better. (However my case is solved. But not by using any solutions given here, unfortunately.) I hope my answer helps you understand the difference between 1 and the other :D – Kludde Mar 11 '14 at 15:23

1 Answers1

3

You can use avidemux.

Install it command line with:

sudo apt-get install avidemux

You can rip the audio from the video file.

In the toolbar, click on the top left folder icon and load the video file from your computer.

enter image description here

Click on the Audio option on the left side panel and choose the audio codec you want to use

Now, click on the “Audio” option in the menu bar and select “Save” to save the audio

enter image description here


If you prefer a CLI give ffmpeg a try

ffmpeg -i input_file -vn -acodec CODEC output_file

CODEC= libmp3lame if output .mp3

CODEC= libvorbis if output .ogg

example:

ffmpeg -i ~/Desktop/video.mp4 -vn -acodec libmp3lame audio.mp3

In case you don't have ffmpeg installed:

sudo apt-get install ffmpeg
Maythux
  • 84,289
  • As I said this is renaming the container. I only want the audio file that is in the container. So this is not a solution. See for example AVI being the container of lets say mp3 and xvid. I want to break in the avi, take out the mp3 and delete the rest of the container called avi, as idc about the the xvid. I do not want or need to converse the container to mp3, because that compresses the original mp3 and still has the not needed xvid. – Kludde Mar 10 '14 at 08:53
  • @Kludde This will not convert the container. this will just rip out / extract audio from video and this is not conversion. At end you still can have two files the original video and the extracted file. This is what you need just give a try – Maythux Mar 10 '14 at 08:54
  • The method described by Hadi does exactly what you want. What is your problem?It does not converse the container to mp3 (impossible) but only extract (not compress) the audio from that container. – Julien Chau Mar 10 '14 at 10:28
  • Another thing: do you know of -acodec copy which will not convert but just copy the audio? It needs the appropriate extension in the outfile (e.g. .mp3 .aac or whatever it was in the video). – Takkat Mar 10 '14 at 12:08
  • @Takkat To use copy user must know the original raw codec to copy as it is and this I think it's hard to use for regular users. – Maythux Mar 10 '14 at 12:11