Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

alternative approach using rtmp/avconv #84

Open
e-c-d opened this issue Oct 25, 2020 · 0 comments
Open

alternative approach using rtmp/avconv #84

e-c-d opened this issue Oct 25, 2020 · 0 comments

Comments

@e-c-d
Copy link

e-c-d commented Oct 25, 2020

I tried using the plugin but the browser/guvcview strangely refused to read from the video device (on Debian Buster). Oh well. I eventually succeeded using an alternative approach using a local rtmp server and using avconv to send video data from rtmp into the v4l2loopback device. I'm sharing my approach for anyone who might find it useful.

Idea

OBS sends rtmp to nginx.
nginx forwards rtmp to avconv.
avconv decodes video and sends to v4l2loopback.
v4l2loopback camera is used normally by browser/jitsi/whatever.

Prerequisites

Prerequisites on Debian Buster:

sudo apt install nginx libnginx-mod-rtmp v4l2loopback-dkms obs-studio libav-tools

Steps

Setup a local rtmp server by adding at the end of your /etc/nginx/nginx.conf:

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record off;
        }
    }
}

Start OBS and tell it to stream to the custom address rtmp://localhost/live.

Create a virtual camera (you'll need the v4l2loopback kernel module installed):

sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1

Use avconv/ffmpeg to send the rtmp from nginx to the virtual camera.

avconv -i "rtmp://localhost/live" -vcodec rawvideo -vf hflip -y -f v4l2 /dev/video10

You can remove the -vf hflip if your teleconference app doesn't flip the video.

Now you can open your camera-using app and tell it to use /dev/video10 aka "OBS Cam".

Protip: you can lower the latency by going in the OBS settings, under "Output", setting "Output Mode" to "Advanced", then setting "Tune" to "zerolatency".

(Latest guide here)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant