-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to free buffer required by av_frame_new_side_data_from_buf()? #36
Comments
I insert a at So I am a bit confused as to how to do memory management from this opaque call to a DLL. |
Yeah, I understand that part, that this is the reason the memory monitoring does not pick up on it. However, I still don't understand how I am supposed to |
I'll suggest to look outside in C or C++ usages - even ask this question on stackoveflow. I do generation of bindings and keep eye on most used use cases - that it. Eventually all boils down to C API usage - C# is is just second class here but with all powers of C. |
Thx. I suspected as such. I'm just a bit confused as to when that free is supposed. After then frame is sent? After the packet is freed? I read through the docs and how I think its supposed to work doesn't line up with whats happening. Created a Stack overflow question here: |
Hey there :]
I am injecting an H.264 Stream with a custom SEI message to insert per-frame custom data. Work great. However, I am causing a per-frame memory leak, which I am not quite sure how to solve.
I modified H264VideoStreamEncoder.cs
The relevant passage is:
I assume
av_buffer_alloc()
is the culprit, so I tried toav_buffer_unref()
it, but it either causes the encoder to exit or doesn't do anything at all, depending on where I insert it. Tried to make that pointer global and then unref it, tried toav_frame_remove_side_data()
in different orders. I'm having a hard time understanding this jump to the .dll and what happens there, especially since the VisualStudio 2022 profiler keeps telling me, that the heap is small and just fine.Full modified H264VideoStreamEncoder.cs for reference
How do I properly add that SEI message and free the associated buffer?
The text was updated successfully, but these errors were encountered: