av_frame_alloc()
once, decode all frames, and then call av_frame_unref()
once. Or I should call av_frame_alloc
/ av_frame_unref
for each frame?A.
av_frame_alloc()
av_frame_unref()
(decoding...)
B. Or this variant:
av_frame_alloc()
(decoding...)
av_frame_unref()
AVFrame
struct for the entire decoding/encoding process, by calling av_frame_alloc()
once.av_frame_unref()
is only needed when you decide to enable reference counting for your encoding/decoding context, called for each frame.av_frame_free()
to free the frame struct and all its buffers at the end of your encoding/decoding process.See ffmpeg's official examples for how to use them: demuxing_decoding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With