CESNET / UltraGrid

UltraGrid low-latency audio and video network transmission system
http://www.ultragrid.cz
Other
485 stars 55 forks source link

Unable to open capture device: dshow #369

Open shreyasvedpathak opened 5 months ago

shreyasvedpathak commented 5 months ago

System information

Description

Unable to see camera feed via ultragrid gui or cli. The camera is visible using the following command:

.\uv -t dshow:help

list-devices-using-dshow

We are able to see the camera feed via other applications like OBS studio, python opencv script and inbuilt camera application. Same camera when attached to a linux based OS (in our case, ubuntu 20.04) is working as expected (using v4l2 instead of dshow).

Command:

.\uv --capture-filter resize:1/2,every:2 -t dshow:device="Cam Link 4K":mode=0:RGB -c libavcodec:encoder=libx264:threads=1 192.168.0.251

Output:

UltraGrid 1.8.6 (tags/v1.8.6 rev 6328048 built Oct 20 2023 14:45:44)

Display device   : none
Capture device   : dshow
Audio capture    : none
Audio playback   : none
MTU              : 1500 B
Video compression: libavcodec:encoder=libx264:threads=1
Audio codec      : PCM
Network protocol : UltraGrid RTP
Audio FEC        : none
Video FEC        : none

[dshow] vidcap_dshow_init: Cannot connect capture filter to sample grabber.
Unable to start video capture device dshow
Unable to open capture device: dshow
Exit

We received same output when using device index instead of device name in the above command.

We also tried without the extra options but we got same the error

.\uv -t dshow:2 -d gl

Output:

...
...
...
[dshow] vidcap_dshow_init: Cannot connect capture filter to sample grabber.
Unable to start video capture device dshow
Unable to open capture device: dshow
Exit

basic-command

We are running into a tight deadline and any help here would be greatly appreciated.

MartinPulec commented 5 months ago

Hi, thanks for reporting. I can confirm that NV12 pixel format was not possible to capture. I've already tried to fix the issue, the fix should be in already built continuous builds. Could you please try it out?

shreyasvedpathak commented 5 months ago

Hi @MartinPulec. Thank you so much for your quick response.

We did try the new build and now we are able to detect our camera in the gui and stream the frames using cli. However, the colors of frame do not match the original frame's color.

Camera attached to Ubuntu system: camera-attached-to-ubuntu-system

Camera attached to Windows system:
It looks like grayscale image with 3 channels. camera-attached-to-windows-system

We are able to see the expected colors on windows system via other applications like the inbuilt camera app and OBS studio.

MartinPulec commented 5 months ago

However, the colors of frame do not match the original frame's color.

You are right, actually the chroma from first line was copied to all the rows below. Unfortunately I've tested it just with color bars, which didn't expose this particular problem.

Anyways, it should be already fixed and the it should be already rebuilt at the same place as before.

shreyasvedpathak commented 5 months ago

Thanks @MartinPulec, it worked.