You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.
I would like to propose changing the algorithm that determines the value of EXT-X-TARGETDURATION in HLS playlists from a ceiling round to a regular round, the relevant code is here:
The current algorithm, which does a ceiling, does create playlists that conform to the spec.
BUT it can also arbitrarily create playlists with 11s target durations when the user requests 10s (when it would be perfectly valid to have a 10s target duration). Generating playlists that exactly match the spec recommendation is preferable for us, and can also help with scrubbing accuracy on a wider range of players.
I've opened this issue as more of a discussion because I understand that there might be some pushback given that the current behavior technically creates spec-compliant playlists. If there is any chance of this being activated as a feature flag this would also be acceptable for us.
I will submit a preliminary PR shortly that implements this.
The text was updated successfully, but these errors were encountered:
sparrc
added a commit
to sparrc/m3u8
that referenced
this issue
Jan 25, 2018
Apple changed their recommendation for EXT-X-TARGETDURATION in revision 12 of the HLS spec to be greater than or equal EXTINF, when rounded to the nearest integer.
Yes, the description of EXT-X-TARGETDURATION tag is changed in the latest HLS spec., so the following playlist (from Apple Developer) is correct now:
Would you consider fixing this at least for reading?
For example, the current implementation parses the above playlist as having a target duration of 5, which is different from the actual value in the playlist.
In my mind, if you think the playlist is incorrect, you could maybe return an error if the strict parsing option is turned on, but you should never modify the playlist you are reading.
When I was trying to find the code responsible for this, I was a bit surprised that it was in writer.go even though I was reading a playlist.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I would like to propose changing the algorithm that determines the value of EXT-X-TARGETDURATION in HLS playlists from a ceiling round to a regular round, the relevant code is here:
m3u8/writer.go
Lines 307 to 309 in 6ab8f28
The reason is that Apple changed their recommendation for EXT-X-TARGETDURATION in revision 12 of the HLS spec to be greater than or equal EXTINF, when rounded to the nearest integer, see https://tools.ietf.org/html/draft-pantos-http-live-streaming-12#section-3.4.2
You can read the previous spec here: https://tools.ietf.org/html/draft-pantos-http-live-streaming-11#section-3.4.2
The current algorithm, which does a ceiling, does create playlists that conform to the spec.
BUT it can also arbitrarily create playlists with 11s target durations when the user requests 10s (when it would be perfectly valid to have a 10s target duration). Generating playlists that exactly match the spec recommendation is preferable for us, and can also help with scrubbing accuracy on a wider range of players.
I've opened this issue as more of a discussion because I understand that there might be some pushback given that the current behavior technically creates spec-compliant playlists. If there is any chance of this being activated as a feature flag this would also be acceptable for us.
I will submit a preliminary PR shortly that implements this.
The text was updated successfully, but these errors were encountered: