AMR to MP3 conversion with FFMPEG
Asked Answered
Z

3

23

I'm trying to convert AMR audio files to MP3 using FFMPEG. I'm running on Ubuntu 10.10 with VBox on Windows 7 host and i've installed ffmpeg by running sudo apt-get install ffmpeg I already have an AMR file that i've previously recorded so I ran the command: ffmpeg -i myfile.amr myfile.mp3 the conversion failed and the trace is as follows:

FFmpeg version 0.6-4:0.6-2ubuntu6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct  5 2010 22:35:47 with gcc 4.4.5
  configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  WARNING: library configuration mismatch
  libavutil   configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libavcodec  configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libavformat configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libavdevice configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libavfilter configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libswscale  configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libpostproc configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1.19. 0 /  1.19. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
[amr @ 0x8538420]Estimating duration from bitrate, this may be inaccurate
Input #0, amr, from '/home/octavius/share/1-aloalodwd.amr':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Audio: amrnb, 8000 Hz, 1 channels, flt
File '/home/octavius/share/1-aloalodwd.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to '/home/octavius/share/1-aloalodwd.mp3':
    Stream #0.0: Audio: 0x0000, 8000 Hz, 1 channels, flt, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Encoder (codec id 86017) not found for output stream #0.0
octavius@octavius-VirtualBox:~$ 

So as per the indications of this thread ffmpeg: convert audio-only flv to swf I ran the command sudo apt-get install ffmpeg libavcodec-extra-52 to install the extra libraries and i still have the same issue. Any other ideas?

UPDATE: also in the thread they link to this site to make it work http://stephenjungels.com/jungels.net/articles/ffmpeg-howto.html followed all the steps and it still won't work

Zoo answered 21/1, 2011 at 19:45 Comment(0)
Z
8

I solved this by following the instructions here http://pasindudps.blogspot.com/2010/12/compiling-ffmpeg-in-ubuntu-1010.html after doing so I had no problem doing the audio conversion

EDIT: the link I posted is dead now, here's another one for Linux systems http://linuxers.org/tutorial/how-install-ffmpeg-linux and here's another for Mac OS X http://jungels.net/articles/ffmpeg-howto.html

UPDATED ANSWER:

Since I had to use this solution seems like the process has gotten much easier. On Mac OS you can simply use Homebrew:

brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265

Only Linux systems you can install from the repository:

sudo apt-get install ffmpeg

or

su -c 'yum install ffmpeg'

The FFMPEG website now has updated documentation and downloads for Windows, Mac or Linux as well; in case any further information is required.

Zoo answered 25/1, 2011 at 14:23 Comment(3)
I wish you would just copy the relevant information over. That way a dead link wouldn't kill your answer.Volsci
Good idea @Richard, will do. And not risking the other links going dead.Zoo
Thanks! If you comment again once you've done it, I'll upvote your answer.Volsci
S
47

Argh, those useless ubuntu questions regarding useless ubuntu packages.

Converting AMR to MP3 using FFMPEG

ffmpeg -i audio1.amr -ar 22050 audio1.mp3

This will convert audio1.amr file to audio1.mp3 having audio rate 22.05 Khz

Shaikh answered 22/12, 2013 at 20:40 Comment(2)
If anyone else is having trouble with finding ffmpeg, see here: askubuntu.com/questions/432542/…Doublecross
If we convert *.amr audio file to *.wav, then the command is ffmpeg -i test.amr -ar 44100 test_1.wav.Nummular
Z
8

I solved this by following the instructions here http://pasindudps.blogspot.com/2010/12/compiling-ffmpeg-in-ubuntu-1010.html after doing so I had no problem doing the audio conversion

EDIT: the link I posted is dead now, here's another one for Linux systems http://linuxers.org/tutorial/how-install-ffmpeg-linux and here's another for Mac OS X http://jungels.net/articles/ffmpeg-howto.html

UPDATED ANSWER:

Since I had to use this solution seems like the process has gotten much easier. On Mac OS you can simply use Homebrew:

brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265

Only Linux systems you can install from the repository:

sudo apt-get install ffmpeg

or

su -c 'yum install ffmpeg'

The FFMPEG website now has updated documentation and downloads for Windows, Mac or Linux as well; in case any further information is required.

Zoo answered 25/1, 2011 at 14:23 Comment(3)
I wish you would just copy the relevant information over. That way a dead link wouldn't kill your answer.Volsci
Good idea @Richard, will do. And not risking the other links going dead.Zoo
Thanks! If you comment again once you've done it, I'll upvote your answer.Volsci
D
0

My command for Thunar custom actions:

ffmpeg -i *.amr -ar 12000 lastcall.mp3

Appearance condition *.amr and bellow: "image file"

Dartmoor answered 20/5, 2017 at 20:39 Comment(1)
But when I do it, the audio is significantly truncated... 10-15 minutes chopped off of roughly 2-hour recordings (I do get a warning about estimated time might be wrong, and it is). Happily, VLC converts them fine. Why can't FFMPEG do it?Pegpega

© 2022 - 2024 — McMap. All rights reserved.