[FFmpeg-devel] [PATCH] movie video source

Michael Niedermayer michaelni
Thu Jan 6 22:55:18 CET 2011

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 ..


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110106/6c5260a0/attachment.pgp>

More information about the ffmpeg-devel mailing list