[FFmpeg-devel] Any way to delay input frame in avcodec_encode_video2

Michael Niedermayer michaelni at gmx.at
Tue Aug 20 18:04:26 CEST 2013

On Tue, Aug 20, 2013 at 06:12:35PM +0400, Smirnov eugene wrote:
> Currently AVFrame passed to encoder has const modifier, this logically
> prevents me from using any manipulation with buffer references, like
> av_frame_ref, and av_frame_unref. However writing an asynchronous encoder
> I’m thinking it doesn’t make sense to copy entire AVFrame data planes for
> every frame from performance point of view. Looking at libx264 integration
> there is nothing to do with av_frame_ref, so internally x264 does copy of
> all uncompressed in help of x264_frame_copy_picture().

> Why const modifier is so necessary?

its not necessary, and some encoders change fields IIRC in it anyway

> Will there be any problems if I start
> using c-style cast in form of (AVFrame*)frame and then play with
> av_frame_ref / unref functions

the only sure way to find out is to try

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- 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/20130820/4391ec6a/attachment.asc>

More information about the ffmpeg-devel mailing list