[FFmpeg-devel] [PATCH 2/4] Change the PTS time base to AV_TIME_BASE before to process a frame in the filter chain, and change it back to the stream time base in the filtered frame.

Michael Niedermayer michaelni
Tue Jun 15 03:05:41 CEST 2010


On Sat, Jun 12, 2010 at 12:45:29AM +0200, Stefano Sabatini wrote:
> On date Wednesday 2010-06-09 00:17:27 +0200, Stefano Sabatini encoded:
> > This is required, since all the frames in the filterchain are supposed
> > to use a time base of AV_TIME_BASE.
> > ---
> >  ffplay.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/ffplay.c b/ffplay.c
> > index 129cd28..dd3cba0 100644
> > --- a/ffplay.c
> > +++ b/ffplay.c
> > @@ -1678,7 +1678,7 @@ static int input_request_frame(AVFilterLink *link)
> >      }
> >      av_free_packet(&pkt);
> >  
> > -    picref->pts = pts;
> > +    picref->pts = av_rescale_q(pkt.pts, priv->is->video_st->time_base, AV_TIME_BASE_Q);
> >      picref->pos = pkt.pos;
> >      picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
> >      avfilter_start_frame(link, picref);
> > @@ -1838,6 +1838,7 @@ static int video_thread(void *arg)
> >              SDL_Delay(10);
> >  #if CONFIG_AVFILTER
> >          ret = get_filtered_video_frame(filt_out, frame, &pts_int, &pos);
> > +        pts_int = av_rescale_q(pts_int, AV_TIME_BASE_Q, is->video_st->time_base);
> >  #else
> >          ret = get_video_frame(is, frame, &pts_int, &pkt);
> >  #endif
> 
> Ping? (That's required by the setpts patch).

we need the timebase for muxing, a lazy filter could always
set that to AV_TIME_BASE_Q if it likes but we should support keeping track
of it.
If you disagree then which timebase should the muxer store?
some containers dont like it if the timebase is 1000000 times smaller than
1/average fps

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- 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-devel/attachments/20100615/03347652/attachment.pgp>



More information about the ffmpeg-devel mailing list