Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bai_g_
Beginner
35 Views

Update the bit rate caused encoded bitstream lost while asyncdepth is 2

Hi, Experts

I found an issue, but I am not sure it is Media SDK issue or my application issue:

If I set encoder async depth to 2, and then let the encoder work, it works well. Assumption, the encoder output one NAL with frame number N, I update the bit rate of encoder by SDK API reset,  and then put one new frame to encoder encode function, the encode function will return NEED_MORE_DATA warning. Then I put the second new frame to encoder, it output one new nal. But this nal frame number is N+2, the N+1 nal is lost?

Where is N+1 NAL? When I update the bitrate with API reset, will the encoder discard the N+1 frame? Is there any other API to update the bitrate without   discard the frame?

Thanks

Bai 

0 Kudos
1 Reply
Mark_L_Intel1
Moderator
35 Views

Hi Bai,

Maybe you have done it correct but I didn't see in your description:

When we do the encoding loop, we need to make sure the encoded frame in the buffer was flushed before we complete the loop, this is why you can see in our tutorial or sample code, there are 2 EncodeFrameAsync calls, the second one has a NULL input, this means to flush in case there is a frame in the output buffer.

Did you have this call before the reset?

Mark