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

Smirnov eugene o1o2o3o4o5 at gmail.com
Tue Aug 20 16:12:35 CEST 2013

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

More information about the ffmpeg-devel mailing list