Skip to content

Instantly share code, notes, and snippets.

Last active February 12, 2024 09:11
Show Gist options
  • Save jedi4ever/30eaf96d29f92da42ff5b79db06af125 to your computer and use it in GitHub Desktop.
Save jedi4ever/30eaf96d29f92da42ff5b79db06af125 to your computer and use it in GitHub Desktop.

These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:

  • I started with Phantomjs - but that didn't support the html5 video tag
  • SlimerJS supports it, but there is no way to record audio directly (though this might come from desktop audio)
  • So I moved to research ffmpeg/X11/XVFB to record it with linux which works
  • But ffmpeg has no easy way to mix streams/overlays to I moved on to OBS with overlay browser support
  • I started researching options OBS in docker and it needed best a GPU , so I move to nvidia-docker
  • And so came across building game servers on EC2/AWS using GPUs and managed to run OBS inside of GPU g2x.large machine
  • I tried streaming to twich , which works great and managed to restream 4K 60FPS youtube on an AWS instance
  • Remote control works through OBS-Remote but OBS has kinda limit in types of features
  • Xsplit (some JS automation), Wirecast (no automation found, besides keypresses) , (non-scriptable) and found which an API (but costs 799$)
  • For Overlaying systems , nodeCG looks nice
  • Sending RTMP to FBlive and periscope works fine
  • Looked into redundancy for RTMP as FBLive ends the post/stream when the stream ends (options are ffmpeg UDP switch over and zencode RTMP ping)
  • For CDN still looking vs Cloudfront/Fastly with their HLS setup
  • Possibly use to send it to multiple feeds.

To be continued.



XVFB linux recording:


Setup windows EC2/GPU/OBS:

Setup linux/GPU:


Controlling OBS from remote:

Overlay systems:

Livestream control:

Xsplit control:

Vmix Scripting:



Copy link

Thanks a lot for this! I went through many of the same processes. I was initially looking to build a headless OBS container, but after some exploration I've decided that OBS is completely inappropriate for the task.

I've also found a huge list of related resources here:

Copy link

emmmhx commented Apr 19, 2022

Hi! Did you come up with the solution? What did you use instead of OBS?

Copy link

Ah sorry I ended up just compositing locally with OBS and built a backend to direct which stream key goes to which live event in Youtube. I think if I approached the same problem now, I'd look at trying to composite it in a headless browser with GPU backed rendering like and then work out how to stream the output.

I'd go Websockets or a customer UDP backed implementation to direct the state of the graphics.

I'd probably avoid containerising them in the the proof of concept stage as it would be an extra headache. Then look at something like Nomad for scaling them.

Anyway good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment