Currently stream in Livepeer Studio can have two prefixes, corresponding to two Mist stream configurations: video
for normal streams, and videorec
for streams with recording enabled.
So our playback URLs look like this:
https://catalyst-node.example.com/hls/video+PLAYBACK_ID/index.m3u8
https://catalyst-node.example.com/hls/videorec+PLAYBACK_ID/index.m3u8
But in the dashboard, our playback URLs don't have any prefixes, and look like this:
https://catalyst-node.example.com/hls/PLAYBACK_ID/index.m3u8
The legacy system uses etcd routes and middleware in Traefik to handle this sort of thing, but we're getting rid of that. Other Mist configurations use the defaultStream
parameter to automatically rewrite PLAYBACK_ID
to e.g. stream+PLAYBACK_ID
, but that won't work for us because we have two stream configurations, video
and videorec
.
I'm leaning toward handling this on the catalyst-node side, so it can issue a redirect from https://global-playback-url.example.com/hls/PLAYBACK_ID/index.m3u8
to https://catalyst-node.example.com/hls/PLAYBACK_ID/index.m3u8
.
New command line option: -redirectPrefixes=video,videorec
. Then when we get an incoming playback request for PLAYBACK_ID
, we'll query the Mist load balancer concurrently for video+PLAYBACK_ID
and videorec+PLAYBACK_ID
. (If an incoming request comes in for video+playbackId
we can just forward it as-is.) Then we can issue a redirect to whichever one has a stream, if any.