Internal data stream error in our customer video src

Hello,

on TX2 4G, R32.2, when we use our customer-designed camera src, crcamerasrc, to stream video, we always receive an “Internal data stream error”.

First, the following test pipeline would succeed using videotestsrc:
gst-launch-1.0 nvstreammux width=1920 height=1080 batch-size=1 batched-push-timeout=33000000 name=nvmux ! nvvideoconvert ! crenhancer enhancer-activate=1 ! nvoverlaysink sync=False videotestsrc ! “video/x-raw,width=1920,height=1080,framerate=30/1,format=NV12” ! nvvideoconvert ! “video/x-raw(memory:NVMM),width=(int)1920,height=(int)1080,format=RGBA” ! nvmux.sink_0

But when we replace it with our customer-designed video source, it failes,

gst-launch-1.0 nvstreammux width=1920 height=1080 batch-size=1 batched-push-timeout=33000000 name=nvmux ! nvvideoconvert ! crenhancer enhancer-activate=1 ! nvoverlaysink sync=False crcamerasrc device=/dev/video0 ! ‘video/x-raw, width=1920, height=1080, format=YUY2’ ! nvvidconv ! “video/x-raw,width=1920,height=1080,framerate=30/1,format=NV12” ! nvvideoconvert ! “video/x-raw(memory:NVMM),width=(int)1920,height=(int)1080,format=RGBA” ! nvmux.sink_0

The run-time error is:

ERROR: from element /GstPipeline:pipeline0/Gstcrcamerasrc:crcamerasrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/Gstcrcamerasrc:crcamerasrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn’t want to preroll.

In addition, nvstreammux reported fail to pass data to nvvideoconvert:

0:00:00.769922208 9593 0x55bce6d200 DEBUG GST_CAPS gstpad.c:2733:gst_pad_get_current_caps:crenhancerplugin0:src get current pad caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)RGBA, batch-size=(int)1, num-surfaces-per-frame=(int)1
0:00:00.769950560 9593 0x55bce6d200 DEBUG GST_CAPS gstpad.c:2733:gst_pad_get_current_caps:nvoverlaysink-nvoverlaysink0:sink get current pad caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)RGBA, batch-size=(int)1, num-surfaces-per-frame=(int)1
0:00:00.769991968 9593 0x55bce6d200 DEBUG GST_STATES gstelement.c:2364:gst_element_get_state_func: getting state, timeout 0:00:00.000000000
0:00:00.770008512 9593 0x55bce6d200 DEBUG GST_STATES gstelement.c:2369:gst_element_get_state_func: RETURN is SUCCESS
0:00:00.770026176 9593 0x55bce6d200 DEBUG GST_STATES gstelement.c:2439:gst_element_get_state_func: state current: PAUSED, pending: VOID_PENDING, result: SUCCESS
0:00:00.770124928 9593 0x55bce6d200 DEBUG GST_CAPS gstpad.c:2733:gst_pad_get_current_caps:nvmux:src get current pad caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)RGBA, batch-size=(int)1, num-surfaces-per-frame=(int)1
0:00:00.770152640 9593 0x55bce6d200 DEBUG GST_CAPS gstpad.c:2733:gst_pad_get_current_caps:crenhancerplugin0:sink get current pad caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)RGBA, batch-size=(int)1, num-surfaces-per-frame=(int)1
0:00:00.770287104 9593 0x55bce6d200 INFO default gstdebugutils.c:864:gst_debug_bin_to_dot_file: wrote bin graph to : '/home/cr/0.00.00.766346176-gst-launch.error.dot

The pipeline picture is like this:

what could we do to fix this?

Hi,
You would need to use videoconvert to convert YUY2 to NV12. Please try

crcamerasrc device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=YUY2 ! videoconvert ! video/x-raw,width=1920,height=1080,framerate=30/1,format=NV12 ! nvvideoconvert ! video/x-raw(memory:NVMM),width=(int)1920,height=(int)1080,format=RGBA ! ...

This works, thanks.