TX2 H264 decode query


I have a question regarding the behaviour of the H264 decoder on TX2. I am using Jetpack 3.3, the Multimedia API, specifically the NvVideoDecoder class. Code is heavily based on 00_video_decode sample.

When decoding an H264 stream (which was encoded using the TX2 with NvVideoEncoder and ULTRAFAST profile) I am finding that the decoder will not produce any output until 3 or 4 frames AFTER an I-frame is submitted. After this point each P-frame seems to be produced at the expected rate.

This creates a problem because the code I am working with feeds the decoder for video playback with one h264 frame at a time at the playback rate. With 6 fps video and 1 second I-frame interval this results in very bursty playback (pause for 600ms every second). I can work around this by supplying all frames as soon as possible but this is not the behaviour I am used to seeing from FFMPEG, OpenH264 etc.

Is this behaviour intended? Is there a minimum number of buffers required before decode can start?

If so, is it possible to control or disable this behaviour?


Please set ‘–disable-dpb’ and try again.

Thanks, that has fixed the problem.

I had already tried this but missed this comment in the sample code and did it at the wrong time:
“should be set after output plane set format”

Could constraints like that be added to the API docs?

We have described it in

int NvVideoDecoder::disableDPB ()

Disables the display picture buffer. 
Calls the VIDIOC_S_EXT_CTRLS IOCTL internally with Control ID V4L2_CID_MPEG_VIDEO_DISABLE_DPB. Must be called after setFormat on both the planes and before requestBuffers on any of the planes.
0 for success, -1 otherwise.