[FFmpeg-devel] [RFC][PATCH] Fix timebase for filtered frames
Stefano Sabatini
stefano.sabatini-lala
Sat Oct 30 21:53:08 CEST 2010
On date Saturday 2010-10-30 01:53:01 -0400, Alexander Strange encoded:
>
> On Oct 29, 2010, at 7:52 PM, Stefano Sabatini wrote:
>
> > Check attached patch.
> >
> > This is not the best solution, as one of the purposes of the timebases
> > in the filterchain was to avoid potentially lossy PTS conversion.
> >
> > For an example of a failing command try this:
> > ffmpeg -t 5 -i INPUT -vf settb=1/100 -y OUTPUT
> >
> > This actually happens only using the settb filter, but the filterchain
> > may change anyway the timebase of the output (maybe the setpts, and
> > the overlay, will have this power), so that needs to be fixed.
> >
> > Anyway looking at the ffmpeg.c code I got lost, for example:
> >
> > static double
> > get_sync_ipts(const AVOutputStream *ost)
> > {
> > const AVInputStream *ist = ost->sync_ist;
> > return (double)(ist->pts - start_time)/AV_TIME_BASE;
> > }
> >
> > start_time is expressed in AV_TIME_BASE, and the code seems to assume
> > that ist->pts is also expressed in AV_TIME_BASE, which is not just the
> > case as it is usually expressed using the timebase in
> > ist->st->time_base.
>
> ist->pts is always in AV_TIME_BASE, it's converted at the top of output_packet().
Uhm OK, so I was doing another erroneous assumption, patch updated.
> In case you want to get rid of that, here's two patches I wrote but
> never tested beyond compiling.
Thanks, but I have enough unfinished patches queued.
--
FFmpeg = Faithless and Freak Majestic Philosophical Elaborated Gospel
More information about the ffmpeg-devel
mailing list