Skipping Frames


I am in need of only decoding and displaying “IFrames” in various content. (reducing decoder load is the goal here rather than merely discarding full frames later in the pipeline)

Currently I am using the standard CUvideoparser and hooking into the pfnDecodePicture callback. Basically:

VideoParser::HandlePictureDecode(void *pUserData, CUVIDPICPARAMS *pPicParams)
if (!pPicParams->intra_pic_flag)
		return false;

The rest of the code is pretty identical to the nvidia sample apps. This appears to work fine for awhile. However, after about ~12 hours the average CPU load for my application increases by about %15-20. Debugging seems to imply nvcuvid.dll threads are responsible for this increase but I’m not entirely certain.

Is this because of how I’m using the CUvideoparser? Am I better off using my own parser? The documentation is somewhat vague on the use case of “I don’t want this frame anymore” and how/if the parser carries any direct references to it anymore after calling the callback. I’m not even sure what returning true/false does in the pfnDecodePicture callback. Anyone know if there’s something further I need to do to discard a frame from the parser in this callback?

1 Like