Thank you @KarlAlexPauls for your answer but this is isn’t really my use case.
Your points are very valid for people who prioritize interactivity and are ok with occuring breaks (like the scene switch). I’m looking more for a way to guarantee high bitrate streaming without any breaks ever but with the compromise of having a big delay like the example of the service provided by Living As One.
In the last days I tried to copy this behaviour on the cheap. I’m not 100% happy how it works yet, but I think I’m on the right track. If anybody has other ideas please feel free to let me know.
Here are the basic steps:
A = PC with unreliable Internet (e.g. with mobile connection)
B = PC with reliable Internet to stream with constant bitrate to YouTube/Twitch/Facebook etc. (like your home PC or a PC in the cloud with NVENC/AMF support, Paperspace worked well for me)
- Record your OBS stream locally on A via FFmpeg in the HLS container
(this will generate lots of small .ts files, which can be played together via a native media player or a web player)
- From A transfer all the files in the output directory automatically to B
(you can do this directly via P2P with a tool like Syncthing or do it over a web server in between, in my festing automatically uploading all the files from A to a FTP server and then download them back on B worked well)
- Create a local web server and host the HLS files (B)
(Nginx and Apache work fine)
- Feed the HLS stream to a web player/media player (B)
(I used the example file of HLS.js with my local stream)
- Display the player in OBS and stream to your normal RTMP location (B)
The great thing is that you can use the player on B now as a DVR and rewind back for as long as you want. It will automatically append the small .ts files as soon as they arrive. And you can have as long of a dropdown in upload speed on A as you have set the “DVR delay” on B. As soon as A has proper upload speed again it will just continue to upload as many segment files as possible.
Alternatively you can upload from A to a web server directly and host the HLS player there, but you’d need lots of web hosting space and a fast server. For example in my testing I used the free hosting of Infinityfree.net, which has unlimited web space but with a max file size of 12 MB. Optimal for HLS with lots of small files FTP speed is pretty good, but normal http request are too slow for seamless playback.
I know this is way too hacky and complicated, but I have my fun getting these things to work