cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
phil@pswitchers.com
Participant
Participant
1,746 Views
Registered: ‎01-21-2019

HDMI to UVC (USB Webcam) and Vice Versa

Jump to solution

Is there a way to convert a live HDMI stream and output a USB Video Class (UVC) output so a PC can see the stream from within Skype or some other webcam type application? How about the other way around? Connect a webcam to an Xlinx FPGA and convert it to HDMI for display on a large screen monitor? 4K@30 resolutions right now but possibly 4K@60 later?

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
watari
Professor
Professor
1,659 Views
Registered: ‎06-16-2013

Hi phil@pswitchers.com 

 

>So, is the idea to create a instance of Linux running GStreamer to accomplish the content conversion?

Yes.

You can accomplish what you want to do on Linux running GStreamer.

 

>Does it support UVC so one doesn't require special drivers when connecting the USB to a Windows based PC?

 

I don't have enough knowlegment about UVC.

But, I guess you can achieve it by using v4l2 driver and media-ctl command on Linux.

 

Best regards,

View solution in original post

5 Replies
watari
Professor
Professor
1,698 Views
Registered: ‎06-16-2013

Hi phil@pswitchers.com 

 

> Connect a webcam to an Xlinx FPGA and convert it to HDMI for display on a large screen monitor?

 

Yes. You can use gstreamer to achieve what you want to do.

 

Best regards,

0 Kudos
phil@pswitchers.com
Participant
Participant
1,689 Views
Registered: ‎01-21-2019

Thank you, Watari.

So, is the idea to create a instance of Linux running GStreamer to accomplish the content conversion?  Does it support UVC so one doesn't require special drivers when connecting the USB to a Windows based PC?

Phil

0 Kudos
watari
Professor
Professor
1,660 Views
Registered: ‎06-16-2013

Hi phil@pswitchers.com 

 

>So, is the idea to create a instance of Linux running GStreamer to accomplish the content conversion?

Yes.

You can accomplish what you want to do on Linux running GStreamer.

 

>Does it support UVC so one doesn't require special drivers when connecting the USB to a Windows based PC?

 

I don't have enough knowlegment about UVC.

But, I guess you can achieve it by using v4l2 driver and media-ctl command on Linux.

 

Best regards,

View solution in original post

phil@pswitchers.com
Participant
Participant
1,651 Views
Registered: ‎01-21-2019

My research seems to confirm you feelings about the V4L2 driver solution.

Thank you so much for your responses.

Phil

0 Kudos
gladson
Observer
Observer
968 Views
Registered: ‎01-31-2021

Hi,

I am working on a Zynq MPSoC 7ev custom board and trying to stream 1080p 60fps video from SDI rx to USB 3.0 port using 3.0 cable to the host PC.

Device tree:-

&usb0 {
status = "okay";
xlnx,usb-reset = <0x2faf080>;
};

&dwc3_0 {
status = "okay";
dr_mode = "peripheral";
snps,usb3_lpm_capable;
phy-names = "usb3-phy";
phys = <&lane2 4 0 2 52000000>;
maximum-speed = "super-speed";
};


1) Starting from webcam driver

I have modified this driver to support 1080p @ 60fps.

https://elixir.bootlin.com/linux/v3.4/source/drivers/usb/gadget/webcam.c

2) Trying to stream from SDI rx to UVC using this application(even this application is modified to support 720p and 1080p 60fps)

https://github.com/wlhe/uvc-gadget/blob/master/uvc-gadget.c

Connecting USB 3.0 cable to windows PC and using webcamoid application to play the video.


TESTING PROCEDURE THAT I FOLLOW:

1) Connect SDI cable which will create /dev/video0 node

# v4l2-ctl -d /dev/video0 --all
Driver Info:
Driver name : xilinx-vipp
Card type : vcap_sdirx output 0
Bus info : platform:vcap_sdirx:0
Driver version : 4.19.0
Capabilities : 0x84201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name : xilinx-video
Model : Xilinx Video Composite Device
Serial :
Bus info :
Media version : 4.19.0
Hardware revision: 0x00000000 (0)
Driver version : 4.19.0
Interface Info:
ID : 0x03000003
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : vcap_sdirx output 0
Function : V4L2 I/O
Pad 0x01000002 : 0: Sink
Link 0x02000007: from remote pad 0x1000006 of entity 'a0040000.v_smpte_uhdsdi_rx_ss': Data, Enabled
Priority: 2
Video input : 0 (a0040000.v_smpte_uhdsdi_rx_ss: ok)
Format Video Capture Multiplanar:
Width/Height : 1920/0
Pixel Format : 'YUYV'
Field : None
Number of planes : 0
Flags :
Colorspace : sRGB
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Selection: compose, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: compose_default, Left 0, Top 0, Width 1920, Height 0, Flags:
Selection: compose_bounds, Left 0, Top 0, Width 1920, Height 0, Flags:
Selection: crop, Left 0, Top 0, Width 0, Height 0, Flags:
Selection: crop_default, Left 0, Top 0, Width 1920, Height 0, Flags:
Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 0, Flags:

User Controls

low_latency_controls 0x0098ca21 (int) : min=2 max=8 step=1 default=4 value=4
root@PRGLT:~# v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar

[0]: 'XM20' (Y/CrCb 4:2:2 10-bit (N-C))
[1]: 'XV20' (Y/CrCb 4:2:2 10-bit)
2) modprobe g_webcam

which will create /dev/video1 node

3) Running the application
./uvc-gadget -r 0 -s 2 -f 0 -u /dev/video1 -v /dev/video0

V4L2 open
V4L2: /dev/video1 is V4L2_CAP_VIDEO_CAPTURE_MPLANE video capture device
V4L2: /dev/video1 is no video capture device

My query is:
1) How do I handle multiplanar input video?
2) If the input format is XV20 and XM20 and if my application expects YUYV and MJPEG, how do we deal with it?

Can anyone please help me in streaming SDI to UVC 3.0 with 1080p @ 60fps?

Tags (3)
0 Kudos