[FFmpeg-devel] [PATCH] avformat/mov: don't read duration from mvhd atom

James Almer jamrial at gmail.com
Sat Aug 27 22:41:39 EEST 2022


On 8/16/2022 4:22 PM, Michael Niedermayer wrote:
> On Mon, Aug 15, 2022 at 08:14:42PM -0300, James Almer wrote:
>> This duration is equal to the longest duration in all track's tkhd atoms, which
>> may be comprised of the sum of all edit lists in each track. Empty edit lists
>> in tracks represent start_time, and the actual media duration is stored in the
>> mdhd atom.
>> This change lets the generic demux code derive the longest track duration taken
>> from mdhd atoms, so the correct duration and start_time combination will be
>> reported.
>>
>> Should fix ticket #9775.
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   libavformat/mov.c                            | 4 ----
>>   tests/ref/fate/gaplessenc-itunes-to-ipod-aac | 2 +-
>>   2 files changed, 1 insertion(+), 5 deletions(-)
> 
> No idea if its a bad or good change but this changes the output for:
> ./ffmpeg -f concat -i ~/tickets/3108/concatfile.txt -codec copy -bitexact /tmp/3108.avi
> 
> thx

I don't see an avi file in that ticket, but for the mov in the zip file, 
the video track duration is used after this patch.


More information about the ffmpeg-devel mailing list