Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello CatxFish... Any way to install OBS-virtual-cam on ubuntu? #17

Open
pixel-one opened this issue Nov 4, 2017 · 21 comments

Comments

Projects
None yet
9 participants
@pixel-one
Copy link

commented Nov 4, 2017

Hello. Hope youre doing fine. I was reading your other post that you said obs works with genymotion. then i realized i can't even stream. I mean it was complicated. Then i found out that youre talking about obs-virtualcam but i have obs studio. are these 2 different softwares? Sorry im alittle noobish.
If not so can i install obs-virtual cam on linux? Or can i do teh same with on obs studio? I have obs studio but i dunno how to stream internal. i want to use it as genymotion camera . but obs studio wants to conenct to a server and wants server keys and such. so i cant start streaming even to test to see if genymotion detects teh cam or not.
Could you please help me? Thanks alot

@CatxFish

This comment has been minimized.

Copy link
Owner

commented Nov 5, 2017

Hi , OBS-Virtualcam is a plugin of OBS-Studio on Windows, which means you have to install OBS-Studio first ,then install this project to get addition features , and it's only on windows. You can check in obs-studio plugins.

And since it is a lack of cross-platform solutions to simulate a device , the project dose not support linux or mac version now. But some simulators on Windows would transform the windows camera device to an inner camera ,like Genymotion.

I am sorry I can't provide a workable solution for you , but I do get an information about someone use v4l2loopback to do a virtual device trick on linux. I don't know how exactly this works, but maybe you can search in this way.

@paulerickson

This comment has been minimized.

Copy link

commented Nov 17, 2017

@pixel-one Here's a proof of concept using v4l2loopback on Ubuntu to get output from OBS into a virtual device. The performance is terrible, because of the fifo, and I was only able to detect the device in Firefox, not Chrome, due to some issue with "capabilities" metadata.
For better performance, you might try setting up a local RTMP proxy server with nginx; that's the best I could come up with, unless it's possible to write directly to some virtual file created by v4l.

Cheers!

# Install packages
sudo apt install v4l-utils v4l2loopback v4l2loopback-utils ffmpeg obs-studio

# Create loopback device
sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1
# Note: Chrome doesn't detect this device; exclusive_caps is supposed to fix, but doesn't

# Create fifo to channel obs output to ffmpeg
mkfifo /tmp/pipe

# Open OBS, go to Settings->Output->Recording, set Type to "Custom Output (FFmpeg)", Container Format to "flv"; Apply and Start Recording
obs

# Send obs output to the virtual device
ffmpeg -re -f live_flv -i "/tmp/pipe" -f v4l2 /dev/video1
@pixel-one

This comment has been minimized.

Copy link
Author

commented Nov 17, 2017

Thank you paulerickson . could you test it on Genymotion?
i get this error upon installing...
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package v4l2loopback

@paulerickson

This comment has been minimized.

Copy link

commented Nov 17, 2017

Sorry, I don't have that.

I originally did this on an older Ubuntu, so I think you can use v4l2loopback-dkms now. Also, I realized you can write to UDP, so

sudo apt install v4l-utils v4l2loopback-utils obs-studio v4l2loopback-dkms
sudo rmmod v4l2loopback #if you need to reload it for some reason
sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1
ffmpeg -re -f live_flv -i udp://localhost:12345 -f v4l2 /dev/video1

And then in OBS "record to file" udp://localhost:12345 with flv. Other containers work too, some with worse latency, but I have had no luck with rawvideo.

@pixel-one

This comment has been minimized.

Copy link
Author

commented Nov 17, 2017

Hello again, Thanks for teh help. I entered the commands and it stopped at third... Please have a look...
Thanks again for helping, I appreciate this really
none@none-Latitude:~$ sudo apt install v4l-utils v4l2loopback-utils obs-studio v4l2loopback-dkms [sudo] password for none: Reading package lists... Done Building dependency tree Reading state information... Done v4l2loopback-dkms is already the newest version. obs-studio is already the newest version. The following extra packages will be installed: libv4l2rds0 The following NEW packages will be installed: libv4l2rds0 v4l-utils v4l2loopback-utils 0 upgraded, 3 newly installed, 0 to remove and 17 not upgraded. Need to get 150 kB of archives. After this operation, 609 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libv4l2rds0 amd64 1.0.1-1 [15.9 kB] Get:2 http://archive.ubuntu.com/ubuntu/ trusty/universe v4l-utils amd64 1.0.1-1 [123 kB] Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe v4l2loopback-utils all 0.8.0-1 [11.0 kB] Fetched 150 kB in 5s (29.7 kB/s) Selecting previously unselected package libv4l2rds0:amd64. (Reading database ... 1514548 files and directories currently installed.) Preparing to unpack .../libv4l2rds0_1.0.1-1_amd64.deb ... Unpacking libv4l2rds0:amd64 (1.0.1-1) ... Selecting previously unselected package v4l-utils. Preparing to unpack .../v4l-utils_1.0.1-1_amd64.deb ... Unpacking v4l-utils (1.0.1-1) ... Selecting previously unselected package v4l2loopback-utils. Preparing to unpack .../v4l2loopback-utils_0.8.0-1_all.deb ... Unpacking v4l2loopback-utils (0.8.0-1) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting up libv4l2rds0:amd64 (1.0.1-1) ... Setting up v4l-utils (1.0.1-1) ... Setting up v4l2loopback-utils (0.8.0-1) ... Processing triggers for libc-bin (2.19-0ubuntu6.13) ... none@none-Latitude:~$ sudo rmmod v4l2loopback rmmod: ERROR: Module v4l2loopback is not currently loaded none@none-Latitude:~$ sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1 modprobe: FATAL: Module v4l2loopback not found. none@none-Latitude:~$ sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1 modprobe: FATAL: Module v4l2loopback not found. none@none-Latitude:~$ sudo rmmod v4l2loopback rmmod: ERROR: Module v4l2loopback is not currently loaded none@none-Latitude:~$

@paulerickson

This comment has been minimized.

Copy link

commented Nov 18, 2017

k, I didn't mean to confuse things — just skip the rmmod command, but that is how you would unload the module if you needed to recreate the device. If you can get this device to show up in Firefox (for instance, test at https://appr.tc/) but not in Genymotion, then I bet you'll need to figure out how those capability flags work (I have no clue).

@pixel-one

This comment has been minimized.

Copy link
Author

commented Nov 18, 2017

Thanks again Paul. I loaded up OBS after running this command.. ffmpeg -re -f live_flv -i udp://localhost:12345 -f v4l2 /dev/video1
Then tried to follow your post. and i dont understand this part .... >>>>

And then in OBS "record to file" udp://localhost:12345 with flv. Other containers work too, some with worse latency, but I have had no luck with rawvideo.

<<<<
Could you please explain again what do i do after i open OBS. i dont see record to file" in obs recording settong. .
Also i just entered your secong set of commands. I didnt do this one ..

mkfifo /tmp/pipe

. Could you please once more type all the steps in one post? I got confused which post to follow.
Thanks much

@paulerickson

This comment has been minimized.

Copy link

commented Nov 18, 2017

Forget about the fifo. You already did

sudo apt install v4l-utils v4l2loopback-utils obs-studio v4l2loopback-dkms
sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1
ffmpeg -re -f live_flv -i udp://localhost:12345 -f v4l2 /dev/video1

So now go into OBS and click Settings. Click on the Output section, and then choose Advanced from the dropdown. Go to the Recording tab, change the Type to "Custom Output (ffmpeg)", and the FFmpeg Output Type to "Save to URL". In the "File path or URL" input, type "udp://localhost:12345" and choose "flv" from the Container format dropdown. Hit OK and then from the main screen try "Start Recording" (not "Start Streaming").

@pixel-one

This comment has been minimized.

Copy link
Author

commented Nov 18, 2017

Thank you again for your time. Here is 2 problem i get...
First when i enter the command""" sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1 """" I get modprobe: FATAL: Module v4l2loopback not found.
And i ignore it so i contonue doing the next command and then open the OBS and i do the changes in setting too then when i click on start recording OBS hangs and closes fast... Here is teh logs in the terminal... ( Because i should open obs with this command " LIBGL_ALWAYS_SOFTWARE=1 obs"" otherwise it wont open. so anyway...
I get this error when ops crashes..
none@none-Latitude:~$ LIBGL_ALWAYS_SOFTWARE=1 obs Attempted path: share/obs/obs-studio/locale/en-US.ini Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini Attempted path: share/obs/obs-studio/locale.ini Attempted path: /usr/share/obs/obs-studio/locale.ini Attempted path: share/obs/obs-studio/themes/Default.qss Attempted path: /usr/share/obs/obs-studio/themes/Default.qss Attempted path: share/obs/obs-studio/license/gplv2.txt Attempted path: /usr/share/obs/obs-studio/license/gplv2.txt info: CPU Name: Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz info: CPU Speed: 1599.000MHz info: Physical Cores: 2, Logical Cores: 4 info: Physical Memory: 7781MB Total, 357MB Free info: Kernel Version: Linux 4.4.0-98-generic info: Distribution: "Ubuntu" "14.04" info: Portable mode: false QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked() QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed() info: OBS 20.1.0 (linux) info: --------------------------------- info: --------------------------------- info: audio settings reset: samples per sec: 44100 speakers: 2 info: --------------------------------- info: Initializing OpenGL... info: OpenGL version: 3.3 (Core Profile) Mesa 11.2.0 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 info: --------------------------------- info: video settings reset: base resolution: 680x420 output resolution: 680x420 downscale filter: Bicubic fps: 30/1 format: NV12 info: Audio monitoring device: name: Default id: default info: --------------------------------- libDeckLinkAPI.so: cannot open shared object file: No such file or directory info: No blackmagic support error: glTexParameteri failed, glGetError returned 0x500 error: device_load_texture (GL) failed info: VLC found, VLC video source enabled info: --------------------------------- info: Loaded Modules: info: vlc-video.so info: text-freetype2.so info: rtmp-services.so info: obs-x264.so info: obs-transitions.so info: obs-outputs.so info: obs-libfdk.so info: obs-filters.so info: obs-ffmpeg.so info: linux-v4l2.so info: linux-pulseaudio.so info: linux-jack.so info: linux-decklink.so info: linux-capture.so info: linux-alsa.so info: image-source.so info: frontend-tools.so info: --------------------------------- info: ==== Startup complete =============================================== info: All scene data cleared info: ------------------------------------------------ error: glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX) failed, glGetError returned 0x500 error: glTexParameteri failed, glGetError returned 0x500 error: device_load_texture (GL) failed error: glTexParameteri failed, glGetError returned 0x500 error: device_load_texture (GL) failed info: pulse-input: Server name: 'pulseaudio 4.0' error: pulse-input: An error occurred while getting the source info! info: pulse-input: Server name: 'pulseaudio 4.0' error: pulse-input: An error occurred while getting the source info! info: [Media Source 'Media Source']: settings: input: /home/none/Videos/WPS Pixie Dust Attack Manual RalinkBroadcom (OLDER).mp4 input_format: (null) is_looping: no is_hw_decoding: yes is_clear_on_media_end: yes restart_on_activate: yes close_when_inactive: no info: Switched to scene 'Scene' info: ------------------------------------------------ info: Loaded scenes: info: - scene 'Scene': info: - source: 'Media Source' (ffmpeg_source) info: - scene 'Scene 2': info: ------------------------------------------------ info: adding 92 milliseconds of audio buffering, total audio buffering is now 92 milliseconds error: glTexParameteri failed, glGetError returned 0x500 error: device_load_texture (GL) failed error: glTexParameteri failed, glGetError returned 0x500 error: device_load_texture (GL) failed info: ==== Recording Start =============================================== Segmentation fault (core dumped) none@none-Latitude:~$

@MikkoMMM

This comment has been minimized.

Copy link

commented May 1, 2018

Since I couldn't get it to work with the webcam, I also tried it without setting up my webcam to make things simpler.

I have File path or URL set to "udp://localhost:12345" and Container Format as flv. I do these steps:

[mikko@localhost lvdata]$ sudo rmmod v4l2loopback
[mikko@localhost lvdata]$ sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1
[mikko@localhost lvdata]$ ffmpeg -re -f live_flv -i udp://localhost:12345 -f v4l2 /dev/video0
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-shared --enable-version3 --enable-omx
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100

Then I start recording in OBS.

However, none of ffplay, Cheese or Chromium seem to recognize the stream.

[mikko@localhost lvdata]$ ffplay /dev/video0
ffplay version 3.4.2 Copyright (c) 2003-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-shared --enable-version3 --enable-omx
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[video4linux2,v4l2 @ 0x7f0144000b80] Not a video capture device.
/dev/video0: No such device
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

Have you got any ideas on this?

@notfood

This comment has been minimized.

Copy link

commented May 20, 2018

This solution used to work but v4l2 updated and now I'm getting this error

[v4l2 @ 0x55d4d1400fc0] ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 
Conversion failed!```

Any ideas?
@notfood

This comment has been minimized.

Copy link

commented Jun 3, 2018

It was due to this issue. Ignore me.

umlaeute/v4l2loopback#172

@CatxFish

This comment has been minimized.

Copy link
Owner

commented Jul 25, 2018

I make a experimental repository for this feature.

Repository owner deleted a comment from andraanyana Aug 24, 2018

@grigio

This comment has been minimized.

Copy link

commented Feb 7, 2019

I get this crash

Stream mapping:
  Stream #0:1 -> #0:0 (flv1 (flv) -> rawvideo (native))
Press [q] to stop, [?] for help
[v4l2 @ 0x563fbb7b3cc0] ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
@tsankuanglee

This comment has been minimized.

Copy link

commented Apr 21, 2019

@CatxFish Is it possible to make use of https://github.com/webcamoid/akvcam , which is used as webcamoid's virtual webcam?

@CatxFish

This comment has been minimized.

Copy link
Owner

commented Apr 22, 2019

@tsankuanglee
Maybe it will work if it implement all the v4l2 standard the output plugin need.
I really don't know, why wouldn't you try yourself and share your result?

@tsankuanglee

This comment has been minimized.

Copy link

commented Apr 24, 2019

Reporting back about akvcam I mentioned above:

However, I can't get the latency below 5 seconds in either method.

@CatxFish, the reason I mentioned akvcam is that webcamoid has very low latency, so I wonder whether there's a way to do the same in your obs-v4l2sink can. I wish I knew enough about this to contribute.

@tsankuanglee

This comment has been minimized.

Copy link

commented Apr 24, 2019

OK, I made some progress and got the latency down to less than 0.5 sec. Quite practical for real-time streaming. Steps:

  1. Create a V4L2 virtual cam with akvcam. Let's say it's /dev/video2 (for capturing). (I used udev rule to make it /dev/video0 so it's the first choice for software that only supports the first device, but we don't need to do this here.)

  2. In OBS Settings -> output -> Recording, set type to Custom Output (FFmpeg), Output to URL, and use file:///dev/video2 as the URL. Container set to rawvideo (Video), and the codec also set to rawvideo.

Since akvcam works fine with this line,
ffmpeg -i video.webm -s 640x480 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video2

I added video_size=640x480 framerate=30 pixel_format=rgb24 as the Video Encoder Settings. (according to ffmpeg's format doc).

Audio should automatically be disabled.

(Side note: Some times rawvideo (Video) doesn't show up in Container Format drop down. I have no idea why. My trial and error workaround: choose Null as the container, and rawvideo as the encoder. Apply. Quit OBS. Re-open OBS. Now it's in the menu. A bug?)

Now the latency is low, but the resolution is wrong. There are 3x2 of my output in the receiving end. Like this:
3x2 output

I feel we are closer. Hopefully this is the right direction, and somebody can figure this out.

@JosephSamela

This comment has been minimized.

Copy link

commented Apr 28, 2019

I don't like changing the recording settings because then I can't stream while recording to disk simultaneously. Here's a solution that allows both.

First install the software.

sudo apt install v4l-utils v4l2loopback-utils obs-studio v4l2loopback-dkms

Create a loopback video device - for example loopback 1.

sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1

Start ffmpeg as an rtmp server passing video to the loopback 1 video device you just created.

ffmpeg -f flv -listen 1 -i rtmp://localhost:1935/live/test -f v4l2 -vcodec rawvideo /dev/video1

Finally, configure obs to stream to the rtmp server you just created.

image

Now loopback 1 shows up as a video device. Here's it working in discord - there's ~2sec latency.

screen

@tsankuanglee

This comment has been minimized.

Copy link

commented Apr 30, 2019

@JosephSamela Good job!

I pursued the akvcam route because that gave me a <0.5s latency, which doesn't create too big a problem for audio-video syncing, which is essential for video conferencing. However, I got stuck at that the 6 screen problem mentioned above.

Did you figure out a way to deal with the audio sync problem with this method?

I do have a simple workaround under Linux that works for me in video conferencing, although it's resource heavy.
http://blog.tklee.org/2019/04/streaming-custom-videos-in-google.html

@xxRockOnxx

This comment has been minimized.

Copy link

commented May 9, 2019

Successfully managed to use OBS stream as a webcam source on Linux (Arch to be specific).

First, add another device using modprobe:

sudo modprobe v4l2loopback devices=1 video_nr=1 card_label="RTMP server" exclusive_caps=1

To understand what the parameters are, just see the original documentation.

I put video_nr=1 because /dev/video0 is already used by Droidcam which allows an android device to be used as a webcam. exclusive_caps "seems" to be required also to be detected by browsers

Second, start an RTMP server using ffmpeg forwarding the output to /dev/video1

ffmpeg -listen 1 -i rtmp://127.0.0.1:1935/live -f v4l2 -vcodec rawvideo /dev/video1

Note: I tried @JosephSamela's answer first and was confused why it was not working. For some reason OBS can't find localhost but can access 127.0.0.1

Third, use the created RTMP server (rtmp://127.0.0.1:1935/live) and start streaming on your OBS..

If your application does not find the new virtual device, try restarting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.