3 ms·
I'm on ubuntu 18.04 and haven't been able to get v4l2loopback related setup to work with OBS using the obs-v4l2sink * With the packages OBS Studio or the newes
by joecot 7y ago
I'm on ubuntu 18.04 and haven't been able to get v4l2loopback related setup to work with OBS using the obs-v4l2sink
* With the packages OBS Studio or the newest compiled
* With the DMKS v4l2loopback kernel module or the newest compiled
EDIT: Thank you for helpful comments. I managed to get this to work by:
1. Purging my existing v4l2loopback-dkms
2. Compiling latest v4l2loopback kernel module
3. Compiling latest OBS Studio
4. Compiling latest obs-v4l2sink plugin
5. sudo rmmod v4l2loopback
6. sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
7. unplugging my webcam and plugging it back in
If you're currently having problems, before trying 1-4, try 5-7. It seems like v4l2loopback is getting loaded on boot, and some combo of that and my existing webcam was messing this up. Once I rmmod the kernel module and put it back, capture works but my webcam is gone. When I unplug my webcam and put it back, it all works. It may very well work fine with the standard v4l2loopback-dkms and obs packages without having to compile latest.
- luxpir 7y agoDid you try purging the dkms version and building the one in the post? I also spent an inordinate amount of time messing with it, but in the end the actual steps that worked were simple. I couldn't get it to work with my flatpak version, and Debian stable is not fun trying to compile OBS (need more recent version of cmake). But Ubuntu should be more straightforward... Did you get the option in the Tool menu yet? The other thing I got reading through all the GitHub issues was the need to sometimes change the YUV setting in that dialogue to YU2 (from memory). Hope you get it cracked without much grief, and I can share what I can remember fwiw.
- joecot 7y agoI did attempt purge DKMS, and confirmed the kernel module is the one I've just compiled. I have it in the tool menu in OBS Studio. If I start the stream with RGB the camera doesn't work. If I start it with YUV32 as suggested in most guides, OBS just segfaults. switching it to YU2 was a helpful hint -- it just doesn't work as opposed to segfaulting.
- luxpir 7y agoAnother quick thought, did you check you're using the right device? In that tool menu dialogue you could switch it to 0 instead of 1 etc or try grepping for the device list... And can you view the device in VLC even when RGB? There are individual settings per input for RGB/YUV etc which I think default to the latter.
- joecot 7y agoI updated the top comment, but you got me looking closer at the device list. It seems that v4l2loopback and my webcam were interfering with each other. rmmod-ing v4l2loopback, running the mopprobe myself, unplugging my webcam and plugging it back in seemed to resolve it.
- luxpir 7y agoEyy, victory. Linux, the OS you love to hate. Wouldn't have it any other way.
- zackham 7y agoAnyone else reading this post and wondering if it's worth trying, I was able to get it working on ubuntu 18.04 without much fuss, just followed this post[1] and compiled v4l2loopback from source[2] (needed to have version >=12) [1] https://srcco.de/posts/using-obs-studio-with-v4l2-for-google-hangouts-meet.html https://srcco.de/posts/using-obs-studio-with-v4l2-for-google... [2] https://github.com/umlaeute/v4l2loopback/tree/v0.12.3 https://github.com/umlaeute/v4l2loopback/tree/v0.12.3
- tastroder 7y agoWeird, worked pretty out of the box here besides some of the v4l2 parameters for application compatibility. My system is a bit outdated though, v4l2loopback-dkms 0.9.1-4ubuntu0.1 and OBS 24.0.3 (64 bit, installed through whatever the quickstart guide suggested for Ubuntu). I'm using this to initialize the loopback device: #!/bin/bash set -e if lsmod | grep "v4l2loopback" &> /dev/null ; then echo "v4l2loopback is loaded" lsmod | grep "v4l2loopback" sudo rmmod v4l2loopback fi sudo modprobe v4l2loopback devices=1 video_nr=2 exclusive_caps=1 lsmod | grep "v4l2loopback"
- joecot 7y agoI think you led me to the problem. I updated the original comment, but I think the issue was that v4l2loopback was being loaded without any options and screwing me up, so rmmod ing it and reloading it seems to help
- nybble41 7y agoYou can set default module options through a file in /etc/modprobe.d/. If you're using systemd, it can also be configured to load the module automatically on startup. This is what I'm using: /etc/modprobe.d/v4l2loopback.conf: options v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1 /etc/modules-load.d/v4l2loopback.conf: v4l2loopback Working flawlessly so far in Hangouts and Zoom using OBS Studio and the obs-v4lsink plugin.
- TaylorAlexander 7y agoIs your system running Wayland? I recall OBS screenshare wasn’t compatible with Wayland at all. I had to log out and log in using the X11 fallback to get it to work. It’s a rather unfortunate condition that past tutorials say “just do XYZ and it works” but they quietly assumed X11.
- joecot 7y agoIt's not the screenshare that's the problem, it's the v4l loopback to emulate a webcam
- leni536 7y agoSome time ago I got it working with ffmpeg with raw video, but I'm afraid it got lost in bash history. edit: Relevant section from my ~/.config/obs-studio/profiles/Untitled/basic.ini [AdvOut] TrackIndex=1 RecType=FFmpeg RecTracks=1 FFOutputToFile=false FFFilePath=/dev FFURL=tcp://localhost:55555 FFFormat=rawvideo FFFormatMimeType= FFExtension=yuv FFVEncoderId=13 FFVEncoder=rawvideo FFAEncoderId=0 FFAEncoder= FFAudioMixes=1 FFVCustom= Encoder=obs_x264 FFVBitrate=15000 RescaleRes=1600x900 RecRescaleRes=1600x900 FFRescaleRes=1600x900 FFMCustom= FFVGOPSize=50 FFIgnoreCompat=false In the UI these stuff are set under Output > Recording, Type is "Custom Output (FFmpeg)". It did require some fiddling on the receiving side in my ffmpeg command line.
- kitd 7y agoThe joys of working with Linux ;) I'm on RHEL. The install instructions for OBS Studio go on for paragraph after paragraph.