Ubuntu – How to use ffmpeg to convert ape to mp3

ffmpeg

I am trying to use ffmpeg on ubuntu 13.10 to convert AP3 to MP3?

I installed ffmpeg, but I get this error when I use it. Please tell me how can I fix it?

$ ffmpeg -i CD1_Age_0-3_Baby.ape CD1_Age_0-3_Baby.mp3
ffmpeg version 0.8.9-6:0.8.9-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:15:22 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, ape, from 'CD1_Age_0-3_Baby.ape':
  Metadata:
    Album           : MOZART EFFECT I - ENLIGHTMENT
    Title           : C:\[APE SET] Ī����ЧӦ-�������ǵ����� 4CDS\CDImage01
    Genre           : Classical
    Year            : 2002
    Comment         : Exact Audio Copy
  Duration: 01:09:17.75, start: 0.000000, bitrate: 656 kb/s
    Stream #0.0: Audio: ape, 44100 Hz, stereo, s16
Output #0, mp3, to 'CD1_Age_0-3_Baby.mp3':
    Stream #0.0: Audio: [0][0][0][0] / 0x0000, 44100 Hz, stereo, s16, 200 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Encoder (codec id 86017) not found for output stream #0.0

Best Answer

First make sure that you have the libavcodec-extra-53 package for encoding to mp3 installed.

sudo apt-get install libavcodec-extra-53  

Try to convert the .ape file to .mp3 using ffmpeg and you will get the following message:

*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release.   
Please use avconv instead.

This is the same error message that you got in your question. So use avconv instead. The avconv program is provided by the libav-tools package from the Ubuntu Software Center. avconv, like ffmpeg, is run from the terminal.

This example uses 256kbps bitrate for the output.mp3 file and id3v2_version 3 for the metadata tags. First change directory using the cd command to the same directory where your input.ape file to be converted is located. Then run the command:

avconv -i 'input.ape' -id3v2_version 3 -codec:a libmp3lame -b 256k 'output.mp3'

Note: The command: ffmpeg -i '10 Make Peace.ape' -acodec libmp3lame -b 256k -id3v2_version 3 '10 Make Peace.mp3' will also do the conversion to mp3 using ffmpeg, but you will get the THIS PROGRAM IS DEPRECATED error message. The ffmpeg package is still available in Ubuntu 13.10 and earlier releases.

In Ubuntu 14.04, the Libav codec library (additional codecs) package (libavcodec-extra-53) has been updated to libavcodec-extra-54. In Ubuntu 14.10 and 15.04, the Libav codec library (additional codecs) package has been updated to libavcodec-extra-56.

Updates for Ubuntu 15.10 and later

In Ubuntu 15.10 and 16.04, the Libav codec library (additional codecs) package has been updated to libavcodec-ffmpeg-extra56.

In Ubuntu 16.10, 17.04, 17.10 and 18.04 the Libav codec library (additional codecs) package has been updated to libavcodec-extra57.

In Ubuntu 18.10 and 19.04 the Libav codec library (additional codecs) package has been updated to libavcodec-extra58.