Bug Report V4L2 sources can't share the device

unfa

Member
Self-introduction:

Hi! I'm new and this is my first post, I installed OBS yesterday and I'm amazed how professional it is, and that it actually gets the job done. I'm a musician, and I've published a few hours of video tutorials in the past years, many time pulling my hair out because the screencasting software lost my 1 hour recording again. Recently I wanted to get back to making tutorials, and yesterday I stumbled upon OBS.

The problem:

I added a webcam source (v4l2) and added a mask (blend) filter.

I created a new scene and added another webcam source using the same v4l2 device (because I wanted to use it without the masking filter) - however the next source doesn't display anything.

It looks like once the first source accesses the webcam, the next source is unable to do so.

After restating OBS, my webcam sources swapped - the first one didn't display, and the second one became active.
I guess they were loaded in such an order.
 
Last edited:

unfa

Member
*Bump*

So I'd like to be able to use the same webcam in different scenes using different filters. I have a "webcam" scene where the webcam image is fullscreen and nothing else is visible - and I don't want any filters there. I have a second scene where the webcam source uses a blending mask and sits in a corner and the desktop is below. But any filter I do is applied in both places, and that leaves black spots in my fullscreen webcam scene.

I thought maybe I could use a v4l2-loopback device to "duplicate" the device node, but I couldn't find any information if that's even possible so far. Maybe a simple mkfifo command could duplicate my webcam node, gonna try that.
 

cRaZy-bisCuiT

New Member
So the problem you got is especially the filter, right? If you wouldn't need them it could be a workarround to use guvcview, set the webcam up to your wishes and capture that window. I do this because the obs V4L2 misses important camera options for lag-free recording with the Logitech C920 (h264 video stream).
 

unfa

Member
Well, if I could gave 2 guvcview windows to display the same image I could actually use that, but I still don't see any way to duplicate the webcam signal prior to applying filters.

BTW: I got the C920 last week and as far as I tested - H.264 encoding can be configured with gvcview, but it gave me poor image quality and minor encoding glitches every couple of seconds, and I don't know how and why use it unless I want to capture the raw webcam output straight to a H.264. I want to do compositing with OBS most of the time anyway so no use i guess.
 

cRaZy-bisCuiT

New Member
Don't touch the actual h.264 settings in guvcview - just use "Video Controls" and select "H264 -H.264" as "Camera Output" as well as your desired framerate and resolution. For me the video output on the camera has better FPS / quality / less CPU load like this.

But you're right - setting a filter on OBS locks the source as well as using it with guvcview. I think that's hardware-related.

Do you want to do live streaming or record and upload videos? If it's about uploading you could record it first and add effects later on in your desired editing software.
 

unfa

Member
Right now I mostly do recording with postproduction / editing in Blender so I could in theory overlay the webcam in post. But I quess capturing a 2*1920x1080 canvas with desktop and webcam tiled in OBS will badly tax on my CPU time while capturing.
 

unfa

Member
I got a new idea to workaround this problem.

I can leave my webcam image without filters, and apply and inverted alpha mask on my desktop source - it would be overlayed over the webcam, adding soft borders, while the webcam itself can also be used in another scene in full, uncut glory.
 
Top