mp4ff icon indicating copy to clipboard operation
mp4ff copied to clipboard

feature request: support llhls and lldash

Open fastfading opened this issue 2 years ago • 2 comments

low latency is more and more important in today‘s live streaming。 could you add support for this 2 protocol ?

mp4box already support it, could take it as a refernce https://github.com/gpac/gpac/wiki/llhls https://github.com/gpac/gpac/wiki/dash_low_latency

fastfading avatar Jun 21 '22 01:06 fastfading

LLHLS and LL-DASH both use segments with multiple fragments. That structure is supported since long by the mp4ff library, so one can read and create such segments. The fragments are stored as a slice inside the segments. It should be fairly straight forward to change the segmenter or resegmenter example to produce such fragmented segments, but it is not in the road map at the moment.

Going further and generating DASH manifests and HLS playlists is out of scope for this project which focuses on mp4 files, so that will most likely not happen in this repo.

tobbee avatar Jun 21 '22 12:06 tobbee

“DASH manifests and HLS playlists is out of scope for this project ” I know, we could only focus on fmp4 part

“It should be fairly straight forward to change the segmenter or resegmenter example to produce such fragmented segments” could you make a simple example on that ? change the example/segment to generate small fragments and segment at the same time。 a direct example could be great help

and for most cases , the input is h264 and aac stream ,not progressive mp4. could the example use h264 aac rawdata instead of mp4 samples?

fastfading avatar Jun 22 '22 00:06 fastfading

The structure of a mp4.MediaSegment is that it contains one or more mp4.Fragment. Such a "Fragment" is what constitutes a "CMAF chunk" or partial "HLS segment". In the example/segment only one "Fragment" is inserted in each "MediaSegment". Making a segment that consists of multiple Fragments by starting a new Fragment every N samples is enough to make a LL-HLS/LL-DASH segment that can be parsed and played part by part.

I don't have time to extend the examples right now, but it is indeed rather straight forward.

tobbee avatar Sep 24 '22 16:09 tobbee