Nvv4l2camerasrc and green screen

Hi,

We are trying to develop a streaming program with the latest version of the Jetson NX and MAGEWELL USB capture hdmi 4k plus. However, whenever the Jetson NX was turned on or the resolution was changed, or the USB cable was reconnected, the next command showed a green screen.

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nv3dsink -e —> GREEN SCREEN

In this case, I ran the following command and then execute the first one, it worked fine. Could you please let me know the solution??

gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nv3dsink -e —> (FINE)

then

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nv3dsink -e —> (FINE)

GREEN_screen

NORMAL_screen

This is the result of gst-device-monitor-1.0

Device found:

    name  : USB Capture HDMI 4K+
    class : Video/Source
    caps  : video/x-raw, format=(string)YUY2, width=(int)4096, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)2560, height=(int)1440, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)2048, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1600, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1680, height=(int)1050, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)1024, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1440, height=(int)900, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)960, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1368, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)800, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1024, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)960, height=(int)540, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)768, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)856, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)YUY2, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)4096, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)2560, height=(int)1440, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)2048, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1600, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1680, height=(int)1050, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)1024, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1440, height=(int)900, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)960, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1368, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)800, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1024, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)960, height=(int)540, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)768, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)856, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)UYVY, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)4096, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)2560, height=(int)1440, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)2048, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1600, height=(int)1200, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1680, height=(int)1050, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1280, height=(int)1024, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1440, height=(int)900, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1280, height=(int)960, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1368, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1280, height=(int)800, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1024, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)960, height=(int)540, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)768, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)856, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };
            video/x-raw, format=(string)NV12, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 4975/83, 50/1, 30/1, 2997/100, 25/1, 15/1 };

Thank you.

I also tried this caps.

‘video/x-raw, width=3840, height=2160, colorimetry=(string)bt709, format=UYVY’

Thanks for your report.
Will check internally to update to you.

Not sure, but as your camera has several formats (YUY2, UYVY, NV12) and nvv4l2camerasrc has no option to select one, it may just use the current mode. This may explain why it works after using v4l2src setting UYVY.
Probably it may fail if you set YUY2 or NV12 before.

@jkyun
Please help verify the patch in below link to confirm the problem.

Thanks

1 Like