Video Capture Device (v4l2) plugin

Paul Daniels

New Member
For those who are trying to set a fixed device for each time the machine reboots and the USB ordering gets randomised; I found a way to force it;

Edit the json file in your scenes folder (in my case, Untitled.json) and where you see /dev/video0 (1, 2, 3 etc) replace it with the /dev/v4l/by-id/ name path instead, eg;

"name": "Facecam",
"private_settings": {},
"push-to-mute": false,
"push-to-mute-delay": 0,
"push-to-talk": false,
"push-to-talk-delay": 0,
"settings": {
"device_id": "/dev/v4l/by-id/usb-046d_C922_Pro_Stream_Webcam_424D78DF-video-index0",
"framerate": 65566,
"input": 0,
"pixelformat": 842094169,
"resolution": 125830200
},


A 'fix' for this would be for OBS to let us pick the device source from paths other than /dev/video* ?
 

thobl

New Member
Hi! My device does not work but in "Qt V4L2 Test Utility" (and other programs) it works, so I hope this is the right thread (although the initial comment from leonhard was some years ago).

My device is a Victure AC800 (an action cam). In other application like Zoom it just works out of the box. When I add it as device in OBS, the device dialog lags heavily and I don't get a picture. I did a little bit of debugging and here is what I believe is happening: With pixel format MJPG and 720p resolution, the camera works and I successfully get a preview in the Qt V4L2 Test Utility. However, when trying to run it with higher resolution or with pixel format YUYV, the camera just crashes. The only way to get it running again is restarting it. This seems to be an issue with the camera and not with OBS.
Now the problem is: I cannot add the camera to OBS, without OBS trying to show me a preview with some default settings for the camera, which appears to be with pixel format YUYV. This then crashes the camera and I can't change the settings to anything that would work. If my interpretation is correct, then it would already help me, if I could deactivate the preview in the "add video source"-dialog. Or if I could set the pixel format in some configuration file. Is that possible?

OBS log: https://obsproject.com/logs/mUBK2yDdq4bcjAJo

Code:
$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'YUYV' (YUYV 4:2:2)
    [1]: 'MJPG' (Motion-JPEG, compressed)
    [2]: 'H264' (H.264, compressed)
 

thobl

New Member
Hi! My device does not work but in "Qt V4L2 Test Utility" (and other programs) it works, so I hope this is the right thread (although the initial comment from leonhard was some years ago).

My device is a Victure AC800 (an action cam). In other application like Zoom it just works out of the box. When I add it as device in OBS, the device dialog lags heavily and I don't get a picture. I did a little bit of debugging and here is what I believe is happening: With pixel format MJPG and 720p resolution, the camera works and I successfully get a preview in the Qt V4L2 Test Utility. However, when trying to run it with higher resolution or with pixel format YUYV, the camera just crashes. The only way to get it running again is restarting it. This seems to be an issue with the camera and not with OBS.
Now the problem is: I cannot add the camera to OBS, without OBS trying to show me a preview with some default settings for the camera, which appears to be with pixel format YUYV. This then crashes the camera and I can't change the settings to anything that would work. If my interpretation is correct, then it would already help me, if I could deactivate the preview in the "add video source"-dialog. Or if I could set the pixel format in some configuration file. Is that possible?

OBS log: https://obsproject.com/logs/mUBK2yDdq4bcjAJo

Code:
$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'YUYV' (YUYV 4:2:2)
    [1]: 'MJPG' (Motion-JPEG, compressed)
    [2]: 'H264' (H.264, compressed)
I found out how (and to what value) to change the pixel format in the configuration file. In ~/.config/obs-studio/basic/scenes/<scene-name>.json, one has to change the line with "pixelformat" from 1448695129 (which represents YUYV) to one of 861030210 (for BGR3), 842093913 (for YU12), or 842094169 (for YV12). With this, the Victure AC800 now works in OBS :-).
 

mxa

New Member
It says no space left on device.
Usually "no space left on device" means the USB bandwidth is exceeded for this USB bus. This might happen because the devices allocate more bandwidth then they actually need, so multiple cameras on the same bus actually would work but since their allocation is too greedy the sum of the allocations exceeds the total bandwidth.
 
Top