Glimesh / janus-ftl-plugin

A plugin for the Janus WebRTC gateway to enable relaying of audio/video streams utilizing Mixer's FTL (Faster-Than-Light) protocol.
https://hayden.fyi/posts/2020-08-03-Faster-Than-Light-protocol-engineering-notes.html
GNU Affero General Public License v3.0
44 stars 11 forks source link

Allow Standalone nodes to operate in an orchestrated environment #138

Open clone1018 opened 2 years ago

clone1018 commented 2 years ago

Essentially what this allows for is a node to act within an orchestrator network as both an ingest & edge. Serving up video directly from itself, and proxying it from other nodes as required. Working on one server as a proof of concept, but would appreciate a logic review!

Currently a test server is available at: do-nyc3-combo1.kjfk.live.glimesh.tv. You can easily stream to it and watch on Glimesh.tv and test edge functionality by using https://glimesh.github.io/janus-ftl-player/ and your favorite channel_id.

Checklist

clone1018 commented 2 years ago

Slight error on watching ingest1 stream from combo1:

janus[66953]: [2022-06-21 12:47:23.805] [info] New request watch
janus[66953]: [2022-06-21 12:47:23.805] [info] Request to watch channel 16791
janus[66953]: terminate called after throwing an instance of 'std::runtime_error'
janus[66953]:   what():  Unexpected service connection type - expected EdgeNodeServiceConnection.
clone1018 commented 2 years ago

Seems to be fully functional now, but would appreciate feedback on a better way of handling the switch between interacting with the EdgeNodeServiceConnection (if using a relayed stream) vs XServiceConnection (if streaming directly to the Standalone node).

https://github.com/Glimesh/janus-ftl-plugin/pull/138/files#diff-d010314ca062375c6ab0cd796195ecdcd29f61cee79ed68a69d1b3dc53b74497R340-R347

clone1018 commented 2 years ago

Getting back to this now, if I remember correctly there's a single remaining bug:

Viewer opens stream, combo server adds them to the pendingViewerSessions, then a new stream connects.... How do I differentiate between a new stream from an ingest, and a new stream from a user directly.

Will need to think on this tomorrow.