6

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)
  • 1
    avconv can be a little unreliable! Two suggestions: 1. Try adding -vn to explicitly tell avconv that there is no video stream needed. 2. Repeat the commandline adding in some debugging options: avconv -v debug -i test.webm -vn -c:a libmp3lame test.mp3 – andrew.46 Jun 11 '16 at 7:03
3

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
  • When I do that I get exactly the same output as above. No mp3 file is created. – Juicy Apr 28 '16 at 13:18
  • @Juicy is this webm file playing correctly? Paste output of avprobe test.webm and avprobe -encoders|grep mp3 – EdiD Apr 28 '16 at 15:24
  • I've edited my question with the output of avprobe. This is weird :-/ – Juicy Apr 29 '16 at 8:14
  • @Juicy something wrong with file ? What about different ? download another webm and try. I have just converted webm to mp3 in 14.04 with the same version of avconv you have. If nothing you can download and compile the latest ffmpeg version from: ffmpeg.org/download.html – EdiD Apr 29 '16 at 8:44
0

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.