[Ffmpeg-devel] incorrect NTSC frame rate detection in .MOV file parser (original) (raw)

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:

avreduce(&st->rframerate.num, &st->rframerate.den, num, den, FFMAX(st->timebase.den, st->timebase.num)/4); This avreduce() 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 avreduce() 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