Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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) , Livestream.com (non-scriptable) and found Vmix.com 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 livestream.com vs Cloudfront/Fastly with their HLS setup
  • Possibly use restream.io to send it to multiple feeds.

To be continued.

Phantomjs:

Slimerjs:

XVFB linux recording:

Docker/X11/GPU:

Setup windows EC2/GPU/OBS:

Setup linux/GPU:

OBS:

Controlling OBS from remote:

Overlay systems:

Livestream control:

Xsplit control:

Vmix Scripting:

CDN:

RTMP:

@danielgormly
Copy link

danielgormly commented Jul 10, 2018

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: https://ebu.io/opensource

@emmmhx
Copy link

emmmhx commented Apr 19, 2022

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

@danielgormly
Copy link

danielgormly commented Apr 21, 2022

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 https://dev.to/ingun37/running-gpu-accelerated-webgl-application-in-headless-chrome-in-ec2-446f 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