RTMP router for Community Streams
Matteo Tambussi
Usecase: I have my stream player on the curated website community.xyz, which plays back a given stream ID from LP.
I want this player to be open to different communities to contribute at different times, but I don't want to give them the Stream Key.
Instead, I would like them to have unique keys to a stream router which then uses the main Stream Key.
This way I can create a truly decentrally curated AV publication.
Hunter Hillman
I see how granular ingest access control would be useful. It seems like there are good workarounds, though:
- This could be built on top of the current stream key system, couldn’t it? Ie a simple traffic forwarding service gated by JWT
- Why not just use different streams to do this, and swap out the playback Ids on the client as needed?
Matteo Tambussi
Hunter Hillman: thanks for the suggestions!
- do you mean to build a JWT permissioned server on my own hosting? (or even better, an NFT gated streamer access)
- not really scalable or automatable (?) I would have to constantly create new streams every time a new member wants to stream + having to manually update the stream ID.
Hunter Hillman
Matteo Tambussi:
- Yeah, that's basically what I was imagining. A server to proxy the rtmp stream and forward to the correct stream key, with some kind of access control logic to control who can stream in.
- Err, it should be both scalable and automatable, no? A number of Twitch-style applications use Livepeer Studio like this - one stream per user. Then you can determine which stream(s) to show
Matteo Tambussi
Hunter Hillman:
2- yes, but there you have one "tv" per user, then. I'm aiming at a crowd-curated channel. So that onAir time is maximised by remote peers filling up one palimpsest.
or r u talking about a player that automatically chooses the streamID to play at given times? the player should basically have an embedded calendar then.
Hunter Hillman
Matteo Tambussi: AH now i'm grasping what you're trying to do. Is the channel on a fixed schedule or is it constantly changing?
Matteo Tambussi
Hunter Hillman: let me give you the use case. I log in with my wallet to check if I have an Author badge (nft). If I have it, I pass streamID and some metadata and I'll be able to book a 2 hrs slot in the future.
upon page loading, the player checks which streamID is up now.
Hunter Hillman
Matteo Tambussi:
I think the one-stream-per-user approach is actually the right one here - when the slot is booked, you store the playbackId alongside it. Then you just check the booking calendar and pass the appropriate playbackId to the player.
You can then let each user have their own channel (you could even give them an NFT with their stream key)
Matteo Tambussi
Hunter Hillman: the NFTembedded stream key is a nice idea. But this is something I should route via Livepeer Studio - making sure they all have a payment plan there, fetching the stream ID and all.... or are you aware of any other way?
Hunter Hillman
Matteo Tambussi: Do you want users to have their own Livepeer Studio accounts? I was operating under the assumption that you'd just do it under one organization account with many streams
Matteo Tambussi
Hunter Hillman: for the moment I've built a player ruled by a calendar, where slots have a streamUrl embedded into it. Every time the player checks the current slot and updates its source.
Adding slots to the calendar is already NFT gated, only Curators can add slots. they also add their own streamUrl.
so yeah, currently they have to create their own account and send us the streamUrl.
How do I automatize this and keep it under my own account?
Hunter Hillman
Matteo Tambussi:
- Create stream for any new Curator (https://docs.livepeer.org/api-reference/stream/create)
- Supply the correct playbackId or playback URL to the player according to the schedule.
You should be able to make it so that Curators just have to pick a slot and the rest is taken care of
Matteo Tambussi
Hunter Hillman: thanks for the link, is there also some documentation on this API params? it's a bit foggy to me tbh
also, how do I pass the registrant his/her streamKey to use in the future slot?
Hunter Hillman
Matteo Tambussi: Params are in the same doc, right below.
then you can retrieve streams (and keys) via API as well
https://docs.livepeer.org/api-reference/stream/get