Question / Help It is possible to use OBS in virtual desktop/display/screen ?

Inglebard

New Member
Hi,

I would like to use OBS on my computer to stream a webcam (of my 3D printer) and more. I have only one screen and I work on this computer (Archlinux).

I would like to use a dedicated gnome workspaces, but there is some issues (must be a window and the cursor is visible) and doesn't seems to be supported properly.

So, I try to use a VNC local server (TigerVNC). It creates a virtual screen and correspond pretty well to my needs.

- On the virtual screen, I can launch my webcam and some other stuff.
- On the physical one, I can start obs and recording display :2.

It works not that bad but I got some big FPS drop compare when I stream all in the physical one.

I would like to know if somebody has already experiment this ?
Or, if there is a way to optimise that or another similiar solution (maybe with other tty or another instance of gnome-shell) ?
 

Inglebard

New Member
Nevermind the issue come from the following reason :

Remmina was opened during the steam with quality "poor" and color depth 256 colors.
Close Remmina or change quality to "best" or change color depth to true color, improve to keep FPS high and stable (59-60FPS).
 

match79

New Member
I found this thread while looking for a solution to recording a linux virtual desktop, and found another way of doing something similar, so I thought I'd share here in case it was useful to anyone.

I used Xephyr to achieve this - Xephyr effectively runs a whole new X server inside a window on your existing desktop, with a different display number.you then tell OBS to record this X server.

The following script starts Xephyr, and then runs an application inside that window (in my case I was recording a Zoom meeting). I am using a small window manager (jwm) to allow resizing, fullscreen etc, but you can skip this for a simple app. If you do use a WM, make sure to not use a full desktop environment (like Gnome or KDE) as this will try to take over sound etc and cause issues.

Code:
#!/bin/bash

# start Xephyr at a particular resolution on an unused display number
Xephyr -screen 1280x1024 :9 &

# Set display as default
export DISPLAY=:9

# Start the JWM window manager (optional)
jwm &

# Start your apps here (or via the window manager, if using!)
/usr/bin/zoom &

Now you can record in OBS by adding a new source: Screen Capture (XSHM), tick Advanced settings and set X server to :9

you can still use the rest of your desktop as usual, as long as you leave Xephyr running - just be aware that you are recording all system sounds so make sure not to run multiple sound-producing apps!
 

Inglebard

New Member
To isolate sound it is easily done with :

Code:
pactl load-module module-null-sink sink_name=Virtual1

pactl load-module module-loopback sink=Virtual1

and redirect app sound with pavucontrol.
 
Top