Question / Help Run OBS on VM in the cloud

wired

New Member
Has anyone had any luck in getting OBS running on a virtual machine in the cloud? I've been struggling to come up with a valid configuration for a system. The minimum requirements needed are:
  1. Browser acceleration - so we can use OBSNinja to get remote camera feeds into the stream.
  2. Hardware encoder (e.g. nvenc) - so we can get a decent output framerate.
I've tried a few machines in Azure and none of them quite fit the bill. The Windows versions don't seem to support nvenc (or at least OBS can't see it) and Linux boxes don't enable browser acceleration which means the OBSNinja videos come out with a slow framerate.

I'm not married to using Azure - I just already had an account to use there.

Any thoughts? Thanks!
 

koala

Active Member
OBS isn't designed to run in a virtual machine. It requires proper hardware support from both graphics as well as sound devices, and this isn't usually provided in VMs properly.
 

wired

New Member
OBS isn't designed to run in a virtual machine. It requires proper hardware support from both graphics as well as sound devices, and this isn't usually provided in VMs properly.
Appreciate that, which is why I'm asking this question. Of course, if you have another suggestion that doesn't involve a VM, I'm all ears.
 

wanderlust

New Member
I've been using OBS for live streaming pre-recorded video on a Virtual PC and it works, despite being unsupported. However, I've had issues with the audio cutting out after a few minutes of playback. I'd be happy to use a different solution if there is one, but so far have not found one. Does anyone have one? Or a workaround to the audio issue?
 

Lawrence_SoCal

Active Member
NVENC is a hardware (ie CPU) offload ... if you are using a cloud VM, just get more CPU if desired/required.
Assuming Chrome browser... have you looked into https://support.google.com/chrome/a/answer/9303118?hl=en Chrome hardware accel in a VM?
you may have to go beyond defaults to enable H/W accel for a browser in non-standard environment (ie VM), and understand the CPU impact.

On Azure (or any other cloud provider), the issue you are likely running into, is that their business model depends on running as many VMs on a server as possible. You on the other hand are doing something (OBS / video compositing) that is latency and jitter sensitive (ie you most want consistent performance). These are opposing requirements/expectations. There are VM options (at higher cost) that provide higher performance, including minimums (guarantees).. the specifics of these options (and H/W GPU available) are cloud provider specific.
As a recovering VCP, I can get near hardware performance out of a VM... but it does take knowledge/expertise, and there are certain scenarios that will always be a challenge. Note this means bare-metal hypervisor (ie ESX or similar) not a Host OS with Guest OS in a VM. Virtualization itself entails some overhead. Data traffic traversing the public Internet (especially through Public Peering points) will rarely be that consistent in terms of latency/jitter... which is why streaming video providers have buffers built into their playbook apps/devices

So.. if you are trying to run OBS.ninja over open Internet, to a VM somewhere not specifically optimized for performance, and then streaming that back out over the Internet.... and having audio / video issues .... I'd say "not unexpected"

The audio cutting out isn't an OBS issue most likely, but rather your Virtual PC setup [are you talking the old MS product .. which sucked / atrocious I/O performance.. or Parallels on a Mac?] As noted above regarding virtualization overhead, a full Host OS means LOTS of overhead usually. And translating from Windows OS to MacOS would mean even more overhead.

You mention looking for a different solution, but without knowing what you are trying to accomplish, and your requirements, basically impossible to recommend anything. I could imagine some OBS configs that would work fine as a Public Cloud VM, and plenty that I'd never expect to work. so like so many things, especially sophisticated technology... it depends..
 

FerretBomb

Active Member
A hardware DX12-compliant GPU is one of the minimum system requirements for OBS.
It may run on a VPS, but it is an unsupported use-case and we cannot provide support for it here.
 

AngryAdmean

New Member
Might be slightly off topic, but I think you can get cloudVM's with GPU passthrough aswell.

I just set it up in a VM. However the VM has no GPU at the point of this writing and the 6 cores of my poor old FX-6300 are pegged at 100% while the stream to twitch runs at around ½ FPM (frames pr minutte) I take it the lack of GPU is the issue and I will install one in the VM soon and get back to you with my results. NDI works fine and the VM displays the output from my primary PC (the one that is being captured from) fine with no significant lag. But when I press start streaming in the VM CPU usages goes from 70% all cores to 100% :D

VM is running on Proxmox 6.2-11
6 Core AMD FX-6300
6 Gb vRAM
1TB vDISK
(R9 280x to be installed and passed through)
 

AngryAdmean

New Member
Allright, the results are in. Once the VM got a GPU, the VM used 15% CPU before hitting the "start streaming button" After hitting the start streaming button, streaming to twitch in 1080p the CPU usage was 50% which is a dramatic improvement :D So, a GPU is definitely needed for encoding., but it is possible to run OBS in a VM.

Before streaming, just capturing output from the Primary PC (which is also a VM)

1601378144465.png


While streaming:
1601378222787.png
 

kanopy

New Member
Do not just get more CPU, this will not work.

I am running NVIDIA's special Google Cloud MarketPlace Image for Tesla T4 GPU. It's not cheap and I obviously don't run it all the time, only when I need to stream. But it works brilliantly. An 8 x vCPU with a 30GB Ram and 1 x NVDIA Tesla T4 runs OBS with NVENC and I can stream quite happily at 6000 CBR with at least 3 OBS Ninja cameras all being chroma keyed and overall CPU is around 3% and the GPU is loaded by about 25%, 30FPS and zero dropped frames. If you want to purchase it , only certain GCP sites have it available. Mine is in London (EU-WEST2-A)

 

schwagpwnz

New Member
Hello guys! I'm also looking for some same cloud solution with gpu for my cameras restream project. What i'm looking to do is to have a virtual computer that streams 15 different yt videos from Browser feature in OBS to my channel. For that I prepare 15 portable versions of OBS and i want to run them simultaneously in 720p 30fps. Let me know if I'm crazy and if you know any cloud solution for that. I tested running 6 OBS like that on my ryzen 5 2400g, 8gb ram and r9 270x(2gb) and it worked fine~ and i think it will be capable to run even 10. But the problem is I need remote solution 24/7/365 that i will setup one time and forget about it.
 

Filip S

Member
I have use OBS 28 on Linux under proxmoxy with VirGL GPU 4 cpu and 8gb memory and it uses 80% while streaming.
I use a lenovo 710q small desktop and I have not found how to make passtru for the GPU - I do pull a rtmp or SRT stream from a restreamer and it works but I need to find a way to make proxmox passtru for the integel GPU.
 

TwinElbowBlow

New Member
I have use OBS 28 on Linux under proxmoxy with VirGL GPU 4 cpu and 8gb memory and it uses 80% while streaming.
I use a lenovo 710q small desktop and I have not found how to make passtru for the GPU - I do pull a rtmp or SRT stream from a restreamer and it works but I need to find a way to make proxmox passtru for the integel GPU.
For GPU passtrough, you need cpu hardware virtualization and IOMMU, it have to be enabled in uefi firmware, there is also some config required in Proxmox, not just settings in the vm. Quick search for "GPU passtrough" and your vm manager and you should have detailed instructions.
 
Top