[Ffmpeg-devel] incorrect NTSC frame rate detection in .MOV file parser

Michael Niedermayer michaelni
Thu Feb 2 22:01:58 CET 2006


Hi

On Tue, Jan 31, 2006 at 09:31:36PM -0500, Dan Maas wrote:
> 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.

2997/100 is incorrect too

anyway, cvs up and ffmpeg will guess better

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list