livekit / ingress

Ingest streams (RTMP/WHIP) or files (HLS, MP4) to LiveKit WebRTC
Apache License 2.0
81 stars 28 forks source link

Ingress of HLS playlists with multiple variants fail #310

Open olafal0 opened 2 months ago

olafal0 commented 2 months ago

Creating an ingress with a HLS playlist that lists multiple variants isn't supported; for example: https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8

Specifically, the ingress reaches state ENDPOINT_ERROR with error failed to add element to pipeline: video output bin.

Selecting a single variant from that m3u8 (e.g. https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/v7/prog_index.m3u8) works great.

It would be helpful to have some way to automatically select a variant so that each client doesn't have to parse playlists themselves. Ideally, I could specify a maximum bitrate and let the ingress service choose the highest bitrate variant that's within the maximum. (Or, very naively, simply choose the last variant listed.)

PS: I'd be happy to work on a PR for this.

davidzhao commented 1 month ago

This direction makes sense! we'd appreciate any contributions to improve the behavior here.