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

Add reader support for EXT-OATCLS-SCTE35 and EXT-X-CUE-OUT #61

Closed
wants to merge 130 commits into from
Closed

Add reader support for EXT-OATCLS-SCTE35 and EXT-X-CUE-OUT #61

wants to merge 130 commits into from

Conversation

bradleyfalzon
Copy link
Collaborator

@bradleyfalzon bradleyfalzon commented Jun 7, 2016

  • Breaking Change: SCTE struct was renamed to SCTE35
  • Breaking Change: MediaSegment.SCTE was renamed to MediaSegment.SCTE35
  • Deprecation: MediaPlaylist.SetSCTE() has been deprecated, use MediaPlaylist.SetSCTE35() instead
  • SCTE35 (was SCTE) has 3 new fields, SCTE35.Syntax defines the format of the SCTE data, SCTE35.CueType defines whether the cue point was start/mind/end, SCTE35.Elapsed can be used for formats that track the elapsed time.
  • SCTE35 now supports a another SCTE-35 syntax we've nicknamed OATCLS (due to the presence of this string in the tag), see sample-playlists/media-playlist-with-oatcls-scte35.m3u8 for an example. Both reads and writes are supported.

waffle-iron and others added 30 commits August 26, 2014 13:39
Let the client determine if it should cache or not unless we are
publishing a live stream.
Fixing typos in a parsing commands (patch by jamie-stackhouse).
Fix EXT-X-PLAYLIST-TYPE parsing
Doc update. No code changes.
Both parsing and generation added. With these tags library fully
supports M3U8 of ver. 4 of the HLS protocol.
Version bumped up to 0.3-dev.
Year updated to current. Added missed copyleft headers.
It feature completes support for version 5 of the protocol.
Function declared as DuratiofAsInt(yes bool) so seems like
set arg to true will set segments durations to integer values,
but it has reverse logic. It was fixed and function now works
as expected.

It changes public API!
It also apply to EXT-X-PROGRAM-DATE-TIME parsing.
Unit tests updated.
Docs synchronized with README information.
Export count of mediaplaylist segments
Alexander I.Grafov and others added 24 commits April 24, 2016 23:51
Removed link to streamsurfer as the project unfinished and stopped.
I really don't remember when it was broken or
it feature just made unfinished :\ Anyway it
passed tests now and seems worked ok.
p.Decode expects a Bytes object, p.DecodeFrom accepts the reader
decodeLineOfMediaPlaylist currently expects a playlist to have
*either* a EXTINF or a EXT-X-BYTERANGE because it's using an
if EXTINF {} else if EXT-X-BYTERANGE {}, this is incorrect as
EXTINF is required and therefore a playlist must always have
an EXTINF, the EXT-X-BYTERANGE is optional.

This change also fixes a bug when an offset given in EXT-X-BYTERANGE
is not reset in its state, so segments without an offset would
incorrect be given the last offset set.

Also includes unit tests to reproduce the issue.
decodeLineOfMasterPlaylist is process a I-Frame line expecting the
URI to be located on the next line, however, the
EXT-X-I-FRAME-STREAM-INF attribute contains the URI as a tag (unlike
EXT-X-STREAM-INF.

This changes produces a test which reproduces the issue and also
removes the state tracking for this attribute as it's not required.
Currently version is controlled via private version functions and
set via the Set* methods when required. This is the ideal method for
most applications, as the version is managed by the library

This change provides the user the ability to check the version as
well as overwrite it, as during some live streams the version number
may have been incremented via the Set methods, but once those
segments have been removed the version number will change during
playback. This isn't ideal as the player may encounter version changes
during playback to versions it doesn't support. This provides
implementors the ability to announce up front what the version number
will be.
Fix file header absence error message
Also link to AUTHORS file in the comments.
Before:
BenchmarkDecodeMasterPlaylist-4   100000             22425 ns/op           12195 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4        50          23947209 ns/op        12279896 B/op     160059 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1023 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          12931950 ns/op         1748991 B/op      81607 allocs/op

After:
BenchmarkDecodeMasterPlaylist-4   100000             22472 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          21241158 ns/op        12279906 B/op     160060 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1025 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          13022881 ns/op         1748992 B/op      81607 allocs/op
Before:
BenchmarkDecodeMasterPlaylist-4   100000             22455 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          21485138 ns/op        12279915 B/op     160061 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1025 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          13109618 ns/op         1748991 B/op      81607 allocs/op

After:
BenchmarkDecodeMasterPlaylist-4    50000             22486 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          17205525 ns/op        10999878 B/op     120060 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1016 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          13020206 ns/op         1736192 B/op      81207 allocs/op
Before:
BenchmarkDecodeMasterPlaylist-4   100000             22461 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          16692449 ns/op        10999880 B/op     120059 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1025 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          13014814 ns/op         1736192 B/op      81207 allocs/op

After:
BenchmarkDecodeMasterPlaylist-4   100000             22482 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          15918199 ns/op        10999881 B/op     120060 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1058 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          12738933 ns/op         1736192 B/op      81207 allocs/op
Note, this uses a map as a cache, and does not limit its size and therefore
could become very large. If this occurs, there's another option which
only caches the last result, but assumes all durations are identical, which
isn't always true. But does provide equivalent speed improvements when
the durations are identical and doesn't involve a map (just two local variables).

Before:
BenchmarkDecodeMasterPlaylist-4   100000             22543 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          16008868 ns/op        10999875 B/op     120059 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1020 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       100          12914307 ns/op         1736190 B/op      81207 allocs/op

After:
BenchmarkDecodeMasterPlaylist-4   100000             22534 ns/op           12194 B/op         77 allocs/op
BenchmarkDecodeMediaPlaylist-4       100          16132527 ns/op        10999880 B/op     120059 allocs/op
BenchmarkEncodeMasterPlaylist-4  1000000              1016 ns/op              40 B/op         11 allocs/op
BenchmarkEncodeMediaPlaylist-4       300           4471880 ns/op           45421 B/op        405 allocs/op
Hori improvements - Alternative approach
It is not reflects real development status and not maintained a long time.
* *Breaking Change*: SCTE struct was renamed to SCTE35
* *Breaking Change*: MediaSegment.SCTE was renamed to MediaSegment.SCTE35
* Deprecation: MediaPlaylist.SetSCTE() has been deprecated, use MediaPlaylist.SetSCTE35() instead
* SCTE35 (was SCTE) has 3 new fields, `SCTE35.Syntax` defines the format of the SCTE data, `SCTE35.CueType` defines whether the cue point was start/mind/end, `SCTE35.Elapsed` can be used for formats that track the elapsed time.
* SCTE35 now supports a another SCTE-35 syntax we've nicknamed OATCLS (due to the presence of this string in the tag), see `sample-playlists/media-playlist-with-oatcls-scte35.m3u8` for an example. Both reads and writes are supported.
* decodeParamsLine should support attributes with numbers.
@bradleyfalzon
Copy link
Collaborator Author

Closing due to major git tree issues. See #81.

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

Successfully merging this pull request may close these issues.

None yet