[FFmpeg-devel] [PATCH] movie video source

Stefano Sabatini stefano.sabatini-lala
Sun Jan 16 19:35:33 CET 2011


On date Thursday 2011-01-06 22:55:18 +0100, Michael Niedermayer encoded:
> On Thu, Jan 06, 2011 at 09:43:00PM +0100, Stefano Sabatini wrote:
> > On date Tuesday 2011-01-04 23:48:24 +0100, Stefano Sabatini encoded:
> > > On date Tuesday 2011-01-04 18:48:48 +0100, Nicolas George encoded:
> > > > Le quintidi 15 niv?se, an CCXIX, Stefano Sabatini a ?crit?:
> > > > > What do you suggest to do, to make the cmdutils.c PtsCorrectionContext
> > > > > API public and use it (av_pts_correction_init(),
> > > > > av_pts_correction_guess()) or to duplicate the code?
> > > > 
> > > > Something like that was evoked three weeks ago in the thread about the API
> > > > example for lavfi. Since then, I thought I might try to implement it.
> > > > 
> > > > My idea was to add the PtsCorrectionContext structure to the end of
> > > > AVCodecContext and add some sort of avcodec_set_stream_time_base function:
> > > > this way, avcodec_decode_video2 would be able to use the pts and dts fields
> > > > in AVPacket directly without depending on libavformat.
> > > 
> > > My idea was to implement a dumb transposition of the correct_pts API
> > > in cmdutils.c:
> > > 
> > > AVPTSCorrectionContext
> > > void av_pts_correction_init(AVPTSCorrectionContext *ctx);
> > > int64_t av_pts_correction_guess(AVPTSCorrectionContext *ctx, int64_t pts, int64_t dts);
> > > 
> > > this would be defined in libavcodec/avcodec.h (as I don't see any
> > > dependency on libavformat).
> > 
> > Michael? (I'm not going to even start coding if the design will be
> > rejected).
> 
> What is missing primarely is that pts from the demuxer must be routed through
> the decoders reordered_opaque. (that is current API)
> That is needed or things plain and simple are wrong.
> 
> after that we are in API change land and i dont think this is a prerequesit to
> this patch, just a nice to have.
> 
> The idea of putting a opaque PTSCorrectionContext in AVCodecContext and using
> the AVPacket.pts/dts for it and exporting the resulting single
> (stream) timestamp in AVFrame sounds very nice.
> Why a avcodec_set_stream_time_base() would be needed is not clear to me though
> 
> About making the current cmdutils code public, i think Nicolas idea is much
> nicer and simpler from a user applications point of view, of course it is more
> work to implement though ..

Updated work in progress, I managed the PTS correction stuff the ugly
way, simply copying all the logic from ffplay.c/cmdutils.c.

Also I'm not sure that the way movie->picref is created with
avfilter_get_video_buffer_ref_from_arrays() is safe.
-- 
FFmpeg = Furious and Fundamentalist Mind-dumbing Practical Exciting Governor



More information about the ffmpeg-devel mailing list