dqEvent possibly crashing 00_video_decoder

Hi team!

I’m working on h265 decoding via the multimedia API, and while I’ve gotten the tool initially working, I find its not very stable when working with more complex/random-like data. Whenever I enter encoded H265 frames of snow or other complex samples, it segfaults when entering the decoder capture loop thread, as shown below. From my own debugging, I believe this may be a problem internal to the ‘ctx->dec->dqEvent(ev, 50000);’ call at the beginning do-while loop of dec_capture_loop_fcn(), but unfortunately I do not access to debug it further (I made sure ctx->dec exist as well). Is this a known bug with the decoder, or the encoder, or possibly even user error? The goal is to encode/decode frames beyond just snow, but the same problem is causing my actual samples to fail decoding as well.

$ gst-launch-1.0 videotestsrc num-buffers=30 pattern=snow ! ‘video/x-raw, width=(int)1920, height=(int)1080, format=(string)NV24’ ! filesink location=~/snow30.yuv

$ ./01_video_encode/video_encode ~/snow30.yuv 1920 1080 H265 ~/snow30_comp.h265 --elossless -cf 3 --sp

$ ./00_video_decode/video_decode H265 --disable-rendering -f 4 -o ~/snow30_decomp.yuv ~/snow30_comp.h265

Set governor to performance before enabling profiler
Creating decoder in blocking mode
NvMMLiteOpen : Block : BlockType = 279
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 279
Setting frame input mode to 1
Starting decoder capture loop thread
Segmentation fault (core dumped)

static void *
dec_capture_loop_fcn(void *arg)
    context_t *ctx = (context_t *) arg;
    NvVideoDecoder *dec = ctx->dec;
    struct v4l2_event ev;
    int ret;

cout << "Starting decoder capture loop thread" << endl;
/* Need to wait for the first Resolution change event, so that
   the decoder knows the stream resolution and can allocate appropriate
   buffers when we call REQBUFS. */
    /* Refer ioctl VIDIOC_DQEVENT */
    ret = dec->dqEvent(ev, 50000); // Culprit in question !!!
    if (ret < 0)
        if (errno == EAGAIN)
            cerr <<
                "Timed out waiting for first V4L2_EVENT_RESOLUTION_CHANGE"
                << endl;
            cerr << "Error in dequeueing decoder event" << endl;
while ((ev.type != V4L2_EVENT_RESOLUTION_CHANGE) && !ctx->got_error);
/* Received the resolution change event, now can do query_and_set_capture. */
if (!ctx->got_error)

Please share your release version. And we just released Jetpack 5.1.2. It would be great if you can upgrade to the version and try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.