Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for EXT-X-MAP (basic) #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support for EXT-X-MAP (basic) #131

wants to merge 2 commits into from

Conversation

Scorg
Copy link

@Scorg Scorg commented Nov 24, 2024

This adds basic support for the EXT-X-MAP tag that has the Media Initialization Section necessary for a valid video.
Things that don't work yet, probably:

  • Discontinuities. When a new map comes, it would be written like any other segment, but probably should start a new file. Considering that hlsdl is only give one target file per launch, this would need some thinking.
  • Encryption. I haven't quite understood form the spec how does an init section behave in the presence of encryption, and what must be used as the key.

@selsta
Copy link
Owner

selsta commented Dec 2, 2024

Just to confirm, did you test this? I'm not really familiar with EXT-X-MAP but if you tested that this works correctly I'm fine with merging it.

@Scorg
Copy link
Author

Scorg commented Dec 2, 2024

Yes, but likely not exhaustively. The stream I tested on had just one map segment for the full length, no discontinuities, no encryption. VLC didn't like the video file as is - loading took time proportional to the file's size, seeking also wasn't fast, but it played at least. ffprobe didn't complain.
I'm neither an expert on the HLS spec, nor MPEG, at first I tried to prepend the map to every segment (this is how ffmpeg does download a live hls, but from the logs it looks like it redownloads the map with each playlist update), but ffmpeg complained about duplicate moov atoms. Then I made it so that the map segment is written just once, and complaints went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants