I’m new to this forum so I hope I’ve submitted my questions into the right place (if not please let me know wich is the correct section).
I use HW decoders to decode both h264 and MJPEG streams coming from video surveillance cameras.
My example “acquisition pipe” works the same as the “cudaDecodeD3D9” example, which comes along with the SDK (tipically in C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0\3_Imaging\cudaDecodeD3D9), except for the VideoSource object. So we correctly use the VideoParser and the VideoDecoder.
Everything is working perfectly with h264 intra and not intra frame streams (gop > 1) and with MJPEG streams.
The only thing I’ve noticed is that it takes some frames to receive the first HandlePictureDisplay callback even if my stream gop is equal to 1 (MJPEG or H264 intra). The first frame passed to the parsed and to the decoder is always a key-frame or I-frame even ig gop > 1.
For the first frame passed to the parser and to the decoder I set CUvideopacket = CUVID_PKT_TIMESTAMP | CUVID_PKT_DISCONTINUITY, for the further frames to CUVID_PKT_TIMESTAMP, and for the last frame to CUVID_PKT_TIMESTAMP | CUVID_PKT_ENDOFSTREAM. In this scenario I was not able to get the first HandlePictureDisplay before submitting other frames to the decoder.
I also tried to set the CUVID_PKT_ENDOFSTREAM flag to the first frame and the first frame comes out before submitting the next one but it only works in some circumstances (sorry but I was not able to identify them).
So, I assumed that an entire GOP has to be decoded before receiving the first HandlePictureDisplay.
- is it correct to assume that?
- Are all NVidia HW decoders working with this behavior?
- Is there any way to let the first frame comes out (HandlePictureDisplay) before submitting the second frame?
Thank you in advance, I hope someone can enlighten me on this subject.