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

Mark Reid mindmark at gmail.com
Sun Dec 13 20:14:51 EET 2020


On Sun, Dec 13, 2020 at 2:05 AM Anton Khirnov <anton at khirnov.net> wrote:

> 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?
>

I'm not entirely clear on what "counter ticks" are either. I think what
your saying sounds better, I'll submit a new patch.
thanks for reviewing.


>
> --
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list