[FFmpeg-cvslog] r17656 - trunk/libavformat/utils.c

Michael Niedermayer michaelni
Sat Feb 28 16:01:54 CET 2009


On Sat, Feb 28, 2009 at 02:01:11PM +0000, M?ns Rullg?rd wrote:
> cehoyos <subversion at mplayerhq.hu> writes:
> 
> > Author: cehoyos
> > Date: Sat Feb 28 14:14:46 2009
> > New Revision: 17656
> >
> > Log:
> > Improve frame rate guessing for streams with two fields per frame.
> >
> > Patch by Ivan Schreter, schreter gmx net
> >
> > Modified:
> >    trunk/libavformat/utils.c
> >
> > Modified: trunk/libavformat/utils.c
> > ==============================================================================
> > --- trunk/libavformat/utils.c	Sat Feb 28 09:38:33 2009	(r17655)
> > +++ trunk/libavformat/utils.c	Sat Feb 28 14:14:46 2009	(r17656)
> > @@ -2115,6 +2115,11 @@ int av_find_stream_info(AVFormatContext 
> >              int64_t last= last_dts[index];
> >              int64_t duration= pkt->dts - last;
> >
> > +            if (st->codec->ticks_per_frame == 2 &&
> > +                st->parser &&
> > +                st->parser->repeat_pict == 0)
> > +                    duration *= 2;  // two fields are needed per frame
> > +
> >              if(pkt->dts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && duration>0){
> >                  double dur= duration * av_q2d(st->time_base);
> 
> This broke all H264 tests on FATE by halving the reported frame rate
> (and thus PTS values).  Was that intentional?

no
"12.50 tbr, 25 tbn, 50 tbc" is wrong it should be
"25 tbr, 25 tbn, 50 tbc"
or maybe in some cases
"50 tbr, 25 tbn, 50 tbc"

IMHO this commit c/sh ould be reverted until this is investigated and fixed
i still think the original change was correct but the raw h264 is a
nasty beast
my (completely unverified) hypothesis of the problem is that ffmpeg
sets framerates and timebases to 1/25 default, there is no framerate
timebase or any timing information in these raw streams ...
h264.c then fixes the default timebase to 1/50 to be able to represent
field timestamps but the demuxer level timebase is 1/25 and cannot represent
the field timestamps thus ends up returning them in 1/25 units which
get corrected by the framerate guessing code that correctly identifies
them as fields to 2/25 ...

iam CCing this to ivan so he is aware of it though all people with svn
write access should be subscribed to cvslog

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20090228/5589c255/attachment.pgp>



More information about the ffmpeg-cvslog mailing list