[Libav-user] Documentation on libav buffering behaviour when encoding live video

rob at meades.org rob at meades.org
Tue Dec 3 21:04:01 EET 2024


Thanks for the suggestion: I tried what I thought would be a simpler 
approach, which was to populate the callback parameter of 
av_buffer_create(); as I understand it, that callback should be called 
when the codec is done with each buffer it has been sent.  However, even 
though I believe I am flushing the codec properly (send it NULL and then 
call avcodec_receive_packet() until I get an error back), the callback 
is only ever called once.

I will keep poking at it until something begins to make sense to me :-).

Rob
On 2024-12-03 11:56, Ben Harper wrote:
> I'm afraid I don't have the real answer, but I think you could
> discover very quickly whether it works in practice, by freeing your
> memory immediately after calling avcodec_send_frame, and running your
> program under address sanitizer. I agree it would be great to know
> what the contract is here. The documentation language "Ownership of
> the frame remains with the caller, and the encoder will not write to
> the frame" doesn't make it clear.


More information about the Libav-user mailing list