[FFmpeg-trac] #5033(undetermined:new): Incorrect duration when converting WAV/MP3 files to AAC

FFmpeg trac at avcodec.org
Tue Nov 24 01:30:03 CET 2015


#5033: Incorrect duration when converting WAV/MP3 files to AAC
----------------------------------+----------------------------------------
             Reporter:  ausjjtkd  |                    Owner:
                 Type:  defect    |                   Status:  new
             Priority:  normal    |                Component:  undetermined
              Version:  2.8.1     |               Resolution:
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+----------------------------------------

Comment (by ausjjtkd):

 I ran the previous commands with ffmpeg git (g8eadabf built on 20151120,
 from http://johnvansickle.com/ffmpeg/). I still get longer MP4 files, and
 this time, the output AAC file is shorter than it should:

 {{{
 $ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -i /tmp/in.wav -vn -c:a
 aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac
 $ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -i /tmp/in.wav -vn
 -strict -2 -ab 24k -ar 16000 -f mp3 /tmp/out.mp3


 $ for i in /tmp/in.wav /tmp/out.aac /tmp/out.mp3; do ffprobe -i $i 2>&1 |
 grep Duration; done
   Duration: 00:01:00.33, bitrate: 352 kb/s
   Duration: 00:00:59.51, bitrate: 27 kb/s
   Duration: 00:01:00.41, start: 0.069063, bitrate: 24 kb/s


 $ mpv /tmp/out.aac
 Playing: /tmp/out.aac
 [ffmpeg/demuxer] aac: Estimating duration from bitrate, this may be
 inaccurate
  (+) Audio --aid=1 (aac)
 AO: [pulse] 16000Hz mono 1ch float
 A: 00:01:00 / 00:00:56 (100%) Cache:  0s+0KB


 $ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -framerate 1 -r 1 -loop
 1 -i /tmp/in.jpg -i /tmp/in.wav -c:v libx264 -preset veryfast -tune
 stillimage -c:a aac -ab 32k -ar 16000 -strict experimental -shortest
 -pix_fmt yuv420p -movflags faststart -f mp4 /tmp/out.mp4


 $ ffprobe -i /tmp/out.mp4 2>&1 | grep Duration
   Duration: 00:01:24.00, start: 0.064000, bitrate: 29 kb/s
 }}}

 For sine and /dev/zero:
 {{{
 $ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -f lavfi -i
 sine=duration=60 -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac

 $ ffprobe -i /tmp/out.aac 2>&1 | grep Duration
   Duration: 00:01:01.19, bitrate: 24 kb/s

 $ mpv /tmp/out.aac
 ...
 A: 00:00:59 / 00:01:01 (97%) Cache:  0s+0KB


 $ /tmp/ffmpeg-git-20151120-64bit-static/ffmpeg -y -f s16le -t 60 -i
 /dev/zero  -vn -c:a aac -strict -2 -ab 24k -ar 16000 /tmp/out.aac

 $ ffprobe -i /tmp/out.aac 2>&1 | grep Duration
   Duration: 00:01:00.49, bitrate: 1 kb/s

 $ mpv /tmp/out.aac
 ...
 A: 00:00:59 / 00:01:00 (98%) Cache:  0s+0KB
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5033#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list