Dan Maas | 1 Feb 2006 03:31

Re: incorrect NTSC frame rate detection in .MOV file parser

I've traced the problem to line 2029 of libavformat/utils.c:

av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, num, den, FFMAX(st->time_base.den, st->time_base.num)/4);

This av_reduce() is supposed to compute the real frame rate based on
sample durations. However the 'max' argument (FFMAX(...))) prevents it
from computing the correct ratio. This causes the following if()
statement to be false, and incorrectly assigns a frame rate without
the 1/1.001 NTSC factor.

For example, a 2-frame NTSC DV Quicktime file has total duration 5994
and sample duration 200. The correct frame rate is 5994/200 = 2997/100.
However the av_reduce() returns 30/1, which is incorrect.

Regards,
Dan

Gmane