- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm having some issues inserting SEI payloads while encoding. Specifically, I'm confused regarding the lifetime of the mfxEncodeCtrl structure and associated payload. If I allocate the mfxEncodeCtrl and mfxPayload data on the heap and never free either, everything works fine. If I free just the mfxPayload->Data, it also seems to work. But if I also free the mfxEncodeCtrl structure or the Payload pointers, then I get a segfault in the codec library.
I thought I saw something in the documentation that said the payload data needs to remain valid for the duration of the async job, which is why I'm waiting until after the SyncOperation completes to free it. Is that also the case with the rest of the mfxEncodeCtrl struct?
So, I'd like to clarify the following:
- Does the encoder copy the mfxPayload data to some internal storage during EncodeFrameAsync?
- Is it ok to use a new mfxEncodeCtrl structure on each call to EncodeFrameAsync, or should I be reusing the same one and just changing the payload each time? If this is ok, what is the expected lifetime of the mfxEncodeCtrl object?
I should also mention that I'm pipelining the encoding with an AsyncDepth of 4.
Thanks,
will
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are many ways to implement, but something like an array of encode control structures corresponding to the number of surfaces could help. The surface and encode control used for each frame given to the encoder can share the same index, which makes it easy to know when they can be reused. Internally there are no copies and both travel through the encode process together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, does that mean that the surface->Data.Locked field can also be used to tell when the encoder control structure is free?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're using the same index for both the surface and encode control structure, yes.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page