将 WEBM 转换为 MP3

Jui*_*icy 8 mp3 webm avconv

我知道这里还有其他一些与此相关的问题,但提供的答案似乎不起作用。

我正在尝试将 a 转换webmmp3with avconv。这是我尝试这样做的方法:

 $ 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
Run Code Online (Sandbox Code Playgroud)

如您所见,我似乎没有收到错误,但我的文件并未创建。请注意,我确实安装了ubuntu-restricted-extras.

编辑:

 $ 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)
Run Code Online (Sandbox Code Playgroud)

Edi*_*diD 5

正确的转换方法是:

ffmpeg -i test.webm -c:a libmp3lame test.mp3
Run Code Online (Sandbox Code Playgroud)

甚至更短,而不告诉 avconv 您想要使用 libmp3lame 编码器。

ffmpeg -i test.webm test.mp3
Run Code Online (Sandbox Code Playgroud)