Macrosilicon USB

I am trying to encode on a Jetson Nano with a MACROSILICON USB stick (USB ID 534d:2109) Friday Fun: How to Tweak a £10 HDMI to USB Capture Device

I’m running this command:

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

What I’m seeing is

So obviously white has become pink and black has become green.

If I run this:
gst-launch-1.0 v4l2src ! xvimagesink

The colors are reasonable (though it is choppy, hence my desire to improve) performance.

Any thoughts on what I may be doing wrong here?

Hi,
Looks like the format is not correct. You may check Jetson Nano FAQ and share information of v4l2-ctl. See if UYVY is listed.

Thanks! That was a great tip!

v4l2-ctl -d /dev/video0 --list-formats-ext
Pixel Format: ‘MJPG’ (compressed)
Name : Motion-JPEG

Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)

Pixel Format: ‘YUYV’
Name : YUYV 4:2:2
Size: Discrete 1024x768
Interval: Discrete 0.100s (10.000 fps)

So I am presuming gstreamer took YUYV device data nd processed it thinking it was UYVY, hence the warped colors?

Hi,
It only accepts UYVY in nvv4l2camerasrc. For launching source with YUYV(YUY2) format, you would need to customize the plugin. It it open source in
https://developer.nvidia.com/embedded/linux-tegra
L4T Driver Package (BSP) Sources

Please download it and take a look. The implementation is based on jetson_multiemdia_api. For YUYV, please apply the patch:

diff --git a/gst-nvv4l2camera/gstnvv4l2camerasrc.cpp b/gst-nvv4l2camera/gstnvv4l2camerasrc.cpp
index 26ad70c..ad0a512 100644
--- a/gst-nvv4l2camera/gstnvv4l2camerasrc.cpp
+++ b/gst-nvv4l2camera/gstnvv4l2camerasrc.cpp
@@ -61,7 +61,7 @@
   "video/x-raw(memory:NVMM), " \
   "width = (int) [ 1, MAX ], " \
   "height = (int) [ 1, MAX ], " \
-  "format = (string) { UYVY }, " \
+  "format = (string) { YUY2 }, " \
   "interlace-mode = (string) { progressive, interlaced }, " \
   "framerate = (fraction) [ 0, MAX ];"
 
@@ -194,7 +194,7 @@ gst_nv_memory_allocator_alloc (GstAllocator * allocator,
       input_params.height = self->height;
     }
     input_params.layout = NvBufferLayout_Pitch;
-    input_params.colorFormat = NvBufferColorFormat_UYVY;
+    input_params.colorFormat = NvBufferColorFormat_YUYV;
     input_params.payloadType = NvBufferPayload_SurfArray;
     input_params.nvbuf_tag = NvBufferTag_CAMERA;
 
@@ -229,7 +229,7 @@ gst_nv_memory_allocator_alloc (GstAllocator * allocator,
     params.layout = NVBUF_LAYOUT_PITCH;
     params.memType = NVBUF_MEM_DEFAULT;
     params.gpuId = 0;
-    params.colorFormat = NVBUF_COLOR_FORMAT_UYVY;
+    params.colorFormat = NVBUF_COLOR_FORMAT_YUYV;
 
     if (self->interlaced_flag)
     {
--