I have a problem when I decode H264 stream data with nvidia video decoding library.
I modified cudaDecodeGL sample source in order to feed stream data from CCTV, not video file.
I saved the first frame as a file and then loaded that file to initialize decoder and the way is exactly the same as cudaDecodeGL sample source.
And then I put the stream data into the decoder.
The following is my feeding source code.
void CCudaDecoder::FuncDecodePicture(unsigned char* pBitstreamData, unsigned int nBitstreamDataLen)
{
VideoSourceData videoSouceData = { g_pVideoParser->hParser_, g_pFrameQueue };
CUVIDSOURCEDATAPACKET dataPacket = { 0, nBitstreamDataLen, pBitstreamData, 0 };
g_pVideoSource->HandleVideoData(&videoSouceData, &dataPacket);
return;
}
But this code is not working properly.
As soon as I made my function call, VideoParser calls the following function; “VideoDecoder::decodePicture(CUVIDPICPARAMS * pPictureParameters, CUcontext * pContext)”
However nothing happens in FrameQueue even though decodePicture function returns CUDA_SUCCESS.
It was supposed to be called “HandlePictureDisplay” function and then enqueue the decoded frame to the frameQueue.
If I change my code like this
CUVIDSOURCEDATAPACKET dataPacket = { CUVID_PKT_ENDOFSTREAM, nBitstreamDataLen, pBitstreamData, 0 };
, the first frame is decoded and enqueue the frameQueue.
But the first frame only changed.
Even the decodePicture function does not called after I changed the code.
The data is absolutely correct!
Because it works well in any other libraries.
Please let me know what I can do to solve this problem.
Thank you in advance.