[FFmpeg-devel] [PATCH] Revert "matroskadec: don't set codec timebase."

Michael Niedermayer michaelni at gmx.at
Thu Apr 19 02:22:46 CEST 2012


On Tue, Apr 17, 2012 at 05:24:01PM -0700, Dale Curtis wrote:
> On Tue, Apr 17, 2012 at 2:59 PM, Dale Curtis <dalecurtis at chromium.org>wrote:
> 
> > On Tue, Apr 17, 2012 at 1:52 AM, Michael Niedermayer <michaelni at gmx.at>wrote:
> >>
> >>  > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> >> > index e922c6e..f9865d1 100644
> >> > --- a/libavformat/matroskadec.c
> >> > +++ b/libavformat/matroskadec.c
> >> > @@ -1587,7 +1587,7 @@ static int matroska_read_header(AVFormatContext
> >> *s)
> >> >              if (st->codec->codec_id != CODEC_ID_H264)
> >> >              st->need_parsing = AVSTREAM_PARSE_HEADERS;
> >> >              if (track->default_duration)
> >> > -                st->avg_frame_rate =
> >> > av_d2q(1000000000.0/track->default_duration, INT_MAX);
> >> > +                st->r_frame_rate = st->avg_frame_rate =
> >> > av_d2q(1000000000.0/track->default_duration, INT_MAX);
> >> >          } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
> >>
> >> thats not looking like git master but, yes thats approximately
> >> the idea. the INT_MAX will probably need some adjustment though
> >>
> >>
> > As far as I can tell the current calculations for r_frame_rate are limited
> > by INT_MAX already. Are you thinking we should only set r_frame_rate =
> > avg_frame_rate if avg_frame_rate is sane?
> >
> 
> Luca landed a patch in libav which is in line with your suggestion and uses
> av_reduce with a sane max. I'm assuming it'll be picked up in the next
> merge, so we can drop this patch set / discussion. Thanks!

merged

thanks to luca for the contribution
though reading the commit message, maybe the reasoning behind the
change was not fully understood or maybe its just badly worded.

replacing the INT_MAX by 30000 doesnt reduce rounding errors
it rather tries to guess the original framerate.
for example 33333333/1000000000 might be stored in matroska as
duration.
1000000000/33333333 would be the most exact based on this
yet its really more likely 30/1 fps

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120419/f41fdbd3/attachment.asc>


More information about the ffmpeg-devel mailing list