video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.86k stars 2.58k forks source link

Live streaming a continuous infinite stream #6810

Open k3nz0 opened 1 week ago

k3nz0 commented 1 week ago

What do you want to do with Hls.js?

I have an MPEG-TS infinite stream that I'd like to read with HLS.js.

The playlist looks like this:

#EXTM3U
#EXTINF:-1, CHANNEL
http://<url>/media.ts

Notice the -1 as a duration (meaning the stream in infinite). I'm able to read the playlist with VLC but not through HLS.js.

Is there a plan to support this ?

What have you tried so far?

Tried reading the playlist mentioned above but does not seem to work.

robwalch commented 1 week ago

EXTINF duration must be a (signed) decimal-floating-point or decimal-integer. Media segment URIs must be available for immediate download at full speed. Streaming of a segment is not supported.

Live streaming in HLS involves updating the playlist as content becomes available in segments. These should be no longer than #EXT-X-TARGETDURATION. if you want to point to the same media.ts resource, you can use #EXT-X-BYTERANGE to address available segments. For MPEG2-TS these ranges should be in multiples of 188, the size of one TS packet.