Decoder picture queue ran out of space
When I test an use case of playback received frames on my target from remote rtsp streaming server, the decoder picture queue ran out of space. The error is below Error:DecodeCurrentAccessUnit()::::::PrefetchPic ERROR, pSps->iNumRefFrames:4. Info:ResetDecoder(), context error code is 16384
static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) { ... } else { iNumRefFrames = pCtx->pSps->iNumRefFrames + 2; ...
In my test case, the iNumRefFrames =4, so the queue size is 6.
There is a comment in WelsRequestMem() saying that the queue size will be pSps->iNumRefFrames x 2.
iPicQueueSize = GetTargetRefListSize (pCtx); // adaptive size of picture queue, = (pSps->iNumRefFrames x 2)
I increased the queue size with the formula pCtx->pSps->iNumRefFrames * 2, the queue size is 8 in my case and the issue disappeared .
So the comment and actual code does not match. Should we use pCtx->pSps->iNumRefFrames * 2? Or can we increase the buffer size like iNumRefFrames = pCtx->pSps->iNumRefFrames + 4;
I am using QNX in my test target. h264 version is 2.4.1.
If you could provide sample video which can reproduce the issue, it would help.
I used this sample video https://dvdloc8.com/clip.php?movieid=12167&clipid=3
I tried iNumRefFrames = pCtx->pSps->iNumRefFrames + 4; It solved the issue as well.
Thanks for sample video. Where does the problem occur? (Time or frame?)
Not sure I understand your question. It is not fixed time. Most of time is around 10 seconds.
Error:DecodeCurrentAccessUnit()::::::PrefetchPic ERROR, pSps->iNumRefFrames:4. Info:ResetDecoder(), context error code is 16384
Thanks for the information. I could reproduce the issue with openh264 v2.4.1, however, could not with v2.5.0, or later. i.e. the issue was already fixed.
I will try against 2.6.0
I am still seeing the issue with 2.6.0 if I do not increase the picture queue size. my platform is raspberryPi-4.
What kind of player are you using? I tested with ffplay and mpv but the issue could not be reproduced. Does libopenh264 run in QNX via some player?
We have our own developed player using libopenh264.
Do you use multi-threading decoding? If so, how many threads do you specify?