All pastes #267223 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-04 18:31 UTC
rendered paste body
Am trying to convert test.aac to test.mp3, but ffmpeg yields a test.mp3 file with audio in slow-motion (possibly half-speed). I believe this is just an audio sampling rate problem, but am unsure.

Source file is about 54 seconds of audio when played through mplayer. Here's ffmpeg conversion attempt #1:

------------
[ben@nateshaw downloads]$ ffmpeg -i test.aac -acodec mp3 -ac 2 -ab 128 test.mp3
FFmpeg version SVN-r6005, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --cpu=x86 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad --enable-faac --enable-libgsm --enable-xvid --enable-a52 --enable-a52bin --enable-pp --disable-static --enable-shared --enable-gpl --disable-debug --disable-opts --disable-strip
  libavutil version: 49.0.0
  libavcodec version: 51.11.0
  libavformat version: 50.5.0
  built on Aug 18 2006 08:11:51, gcc: 4.1.1 20060525 (Red Hat 4.1.1-1)
Input #0, aac, from 'test.aac':
  Duration: 00:00:57.8, start: 0.000000, bitrate: 23 kb/s
  Stream #0.0: Audio: aac, 22050 Hz, mono, 23 kb/s
File 'test.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to 'test.mp3':
  Stream #0.0: Audio: mp3, 22050 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size=    1790kB time=114.6 bitrate= 128.0kbits/s
video:0kB audio:1790kB global headers:0kB muxing overhead 0.000000%
----------------

Above command creates file test.mp3 with super-slow audio. Running mplayer I see that faad thinks input file test.aac is 44100 Hz. So, I retry ffmpeg with -ar 44100 instead:

----------------
[ben@nateshaw downloads]$ ffmpeg -i test.aac -acodec mp3 -ac 2 -ab 128 -ar 44100 test.mp3
FFmpeg version SVN-r6005, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --cpu=x86 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad --enable-faac --enable-libgsm --enable-xvid --enable-a52 --enable-a52bin --enable-pp --disable-static --enable-shared --enable-gpl --disable-debug --disable-opts --disable-strip
  libavutil version: 49.0.0
  libavcodec version: 51.11.0
  libavformat version: 50.5.0
  built on Aug 18 2006 08:11:51, gcc: 4.1.1 20060525 (Red Hat 4.1.1-1)
Input #0, aac, from 'test.aac':
  Duration: 00:00:57.8, start: 0.000000, bitrate: 23 kb/s
  Stream #0.0: Audio: aac, 22050 Hz, mono, 23 kb/s
File 'test.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to 'test.mp3':
  Stream #0.0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size=    1790kB time=114.5 bitrate= 128.0kbits/s
video:0kB audio:1790kB global headers:0kB muxing overhead 0.000000%
----------------

I'm still getting as output a 114.5 second file with slow audio.

Any suggestions for adjusting ffmpeg's audio sampling or whatever so that I get the appropriate audio speed in my output test.mp3?