[FFmpeg-devel] [PATCH 1/1] avformat/mov: fix timecode with counter mode flag set

Anton Khirnov anton at khirnov.net
Sun Dec 13 12:04:54 EET 2020


Quoting mindmark at gmail.com (2020-11-29 05:08:38)
> From: Mark Reid <mindmark at gmail.com>
> 
> The current behaviour ends up squaring the avg_frame_rate if the conter mode flag is set.
> This messes up the timecode calculation, and looks to me as a regression that 
> seems to have been introduced 428b4aac.
> 
> The new behaviour is use the "Number of frames" field for avg_frame_rate from the timecode atom as describe here:
>     https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-69831
> 
> Number of frames
>     An 8-bit integer that contains the number of frames per second for the timecode format. 
>     If the time is a counter, this is the number of frames for each counter tick.

I'm no expert on mov, but this looks suspicious. avg_frame_rate is
supposed to be per seconds, not per counter ticks, whatever those are.
Looking at your sample, frame duration is 1001/24k, while the 'number of
frames' field is just 24, which seems like it's losing precision.

Then wouldn't it be better to just stop squaring the number without any
other changes? Or am I misunderstanding this?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list