Any way to delay input frame in avcodec_encode_video2
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
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
participants (2)
-
Michael Niedermayer -
Smirnov eugene