[FFmpeg-trac] #9671(undetermined:new): wrong duration output with -t on audio with edit lists (preroll)

FFmpeg trac at avcodec.org
Tue Mar 1 22:29:47 EET 2022


#9671: wrong duration output with -t on audio with edit lists (preroll)
-------------------------------------+-------------------------------------
             Reporter:  Cosmin       |                     Type:  defect
  Stejerean                          |
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Given a typical AAC audio file in MP4 format it will contain an edit list
 for the necessary preroll duration. Attempting to decode a subset of such
 a file (with -t) will result in wrong duration output. Reproduced this in
 ffmpeg 5

 Steps to reproduce

 1. Acquire a test AAC in MP4 file, or trivially create one as follows

 {{{
 ffmpeg -f lavfi -t 30 -i anullsrc=channel_layout=stereo:sample_rate=48000
 -codec:a libfdk_aac -profile:a aac_he test.mp4
 }}}

 2. Attempt to decode the first 10s of audio from this file

 {{{
 ffmpeg -i test.mp4 -t 10 out.wav
 }}}

 3. Observe that the output is not in fact 10s long, it is missing
 precisely the duration of the start edit list in the original

 {{{
 ffprobe out.wav

 Duration: 00:00:09.90, bitrate: 1536 kb/s
 }}}

 4. Using -t as a demuxer option (before -i) results in correct output

 {{{
 ffmpeg -t 10 -i test.mp4  out2.wav
 ffprobe out2.wav

 Duration: 00:00:10.00, bitrate: 1536 kb/s
 }}}


 Based on this I believe that most likely the -t option is wrongly
 considering time without the edit list offset at the beginning, at least
 on the audio case. I have not verified what happens with -t on video
 inputs that also contain edit lists.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9671>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list