Ubuntu: Converting WEBM to MP3



Question:

I'm aware there are a couple of other questions here related to this, but the answers provided don't seem to work.

I'm trying to convert a webm to mp3 with avconv. Here's how I tried to do it:

 $ ls  test.webm   $ avconv -acodec libmp3lame -i test.webm test.mp3  avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers    built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)  test.webm: End of file   $ ls -l  total 4  -rw-rw-r-- 1 user user 439 Apr 28 09:16 test.webm  

As you can see, I don't appear to get an error but my file is not created. Please note that I did install ubuntu-restricted-extras.

EDIT:

 $ avprobe test.webm   avprobe version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2007-2014 the Libav developers    built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)  test.webm: End of file  # avprobe output     $ avprobe -encoders|grep mp3  avprobe version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2007-2014 the Libav developers    built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)  A... libmp3lame           libmp3lame MP3 (MPEG audio layer 3) (codec mp3)  


Solution:1

The proper way to converting is :

avconv -i test.webm -c:a libmp3lame test.mp3  

or even shorter, without telling to avconv that you want use libmp3lame encoder.

avconv -i test.webm test.mp3  


Solution:2

I have found you need to specify that -acodecd parameter after the inpout and before the output. personally i also throw in -b:a "256k" to set the bitrate to 256k for the mp3.

avconv -i Mozart.webm -acodec libmp3lame -b:a "256k" Mozart.mp3  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »