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

HLS manifest parser plugin #279

Closed
joeyparrish opened this issue Jan 29, 2016 · 30 comments
Closed

HLS manifest parser plugin #279

joeyparrish opened this issue Jan 29, 2016 · 30 comments
Assignees
Labels
component: HLS The issue involves Apple's HLS manifest format status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@joeyparrish
Copy link
Member

Initially only for browsers which support MPEG2-TS natively (Safari, Chromecast)

@joeyparrish joeyparrish added the type: enhancement New feature or request label Jan 29, 2016
@joeyparrish joeyparrish added this to the v2+ milestone Jan 29, 2016
@avelad
Copy link
Member

avelad commented Apr 15, 2016

Note: Microsoft Edge also supports MPEG2-TS natively

There will be support for Playready (Edge and Chromecast) and Fairplay (Safari)?

@joeyparrish
Copy link
Member Author

There is already support for Playready on Edge & IE. Playready has not been tested on Chromecast, though.

All DRM is through EME APIs, so any interoperable DRM system in any EME-compliant browser should work. The status of Fairplay through EME is unknown at this time.

@avelad
Copy link
Member

avelad commented Apr 15, 2016

So, HLS+Playready will work on Edge(IE has not support for MPEG2-TS without transmuxing)?

@joeyparrish
Copy link
Member Author

We expect so, yes. But we have not begun work yet, so we do not know what interoperability challenges we may find.

@avelad
Copy link
Member

avelad commented Jun 20, 2016

HLS supports Fragmented MP4 – and gets MPEG-DASH compatible! https://bitmovin.com/hls-news-wwdc-2016/

@joeyparrish
Copy link
Member Author

Given that new development, I would expect HLS with MP4 to work on almost every browser we support. Again, we haven't started work on HLS yet.

@sanbornhilland
Copy link
Contributor

I thought it could be useful to catalogue some of the issues with building HLS support into Shaka, as I come across them.

  1. As reported in Support Request: sourceBuffer_ detects incorrect timestamps on content. #439 a lot of HLS VOD content seems not to start at 0 but it so far seems impossible to know what the start time is of the content until the first segment is downloaded.
  2. HLS can include just an audio stream as it's lowest quality stream (see below), the intention being that if your bandwidth drops low enough then the player should switch down to this audio only variant. But it is not an audio stream in the sense that you can choose this audio stream vs some other stream (english vs spanish etc.). It seems to me like this doesn't fit nicely into Shaka's streaming model.
#EXT-X-STREAM-INF:BANDWIDTH=263851,CODECS="mp4a.40.2, avc1.4d400d",RESOLUTION=416x234,AUDIO="bipbop_audio",SUBTITLES="subs"
gear1/prog_index.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=28451,CODECS="avc1.4d400d",URI="gear1/iframe_index.m3u8"

#EXT-X-STREAM-INF:BANDWIDTH=577610,CODECS="mp4a.40.2, avc1.4d401e",RESOLUTION=640x360,AUDIO="bipbop_audio",SUBTITLES="subs"
gear2/prog_index.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=181534,CODECS="avc1.4d401e",URI="gear2/iframe_index.m3u8"

#EXT-X-STREAM-INF:BANDWIDTH=915905,CODECS="mp4a.40.2, avc1.4d401f",RESOLUTION=960x540,AUDIO="bipbop_audio",SUBTITLES="subs"
gear3/prog_index.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=297056,CODECS="avc1.4d401f",URI="gear3/iframe_index.m3u8"

#EXT-X-STREAM-INF:BANDWIDTH=1030138,CODECS="mp4a.40.2, avc1.4d401f",RESOLUTION=1280x720,AUDIO="bipbop_audio",SUBTITLES="subs"
gear4/prog_index.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=339492,CODECS="avc1.4d401f",URI="gear4/iframe_index.m3u8"

#EXT-X-STREAM-INF:BANDWIDTH=1924009,CODECS="mp4a.40.2, avc1.4d401f",RESOLUTION=1920x1080,AUDIO="bipbop_audio",SUBTITLES="subs"
gear5/prog_index.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=669554,CODECS="avc1.4d401f",URI="gear5/iframe_index.m3u8"

#EXT-X-STREAM-INF:BANDWIDTH=41457,CODECS="mp4a.40.2",AUDIO="bipbop_audio",SUBTITLES="subs"
gear0/prog_index.m3u8

@joeyparrish joeyparrish modified the milestones: v2+, v2.1.0 Oct 4, 2016
@raskri
Copy link

raskri commented Oct 6, 2016

Any news on the ETA for HLS support in Shaka?

@joeyparrish
Copy link
Member Author

We have just scheduled the work for v2.1.0, which we intend to have out at the end of the year. As we make progress, you'll see commits and major milestones mentioned here.

@ismena ismena self-assigned this Oct 18, 2016
@avelad
Copy link
Member

avelad commented Oct 21, 2016

There will be support for..
CEA-608?
HLS + AES?
HLS + FairPlay(#382)?
Live and VoD profiles?
What version of HLS (4,5,6,7,..)?

@ismena
Copy link
Contributor

ismena commented Oct 21, 2016

We are just starting investigation and design work at this point.
We'll keep this issue up to date with the decisions on what we will and won't support as we get into them.

@dougdoe
Copy link

dougdoe commented Dec 9, 2016

Hi @joeyparrish and @ismena, I am wondering if you have an estimate for when this work will be ready for a pull request. I am attempting to do some planning, so if you have any information, it would be helpful. My team can also help perform testing when there is something to work with. Thanks.

@ismena
Copy link
Contributor

ismena commented Dec 9, 2016

Hi Doug,
When we did the investigation, we found out that we'll have to refactor our streaming model so it works for HLS as well as DASH (the player was initially written with DASH in mind and HLS doesn't fit nicely in our current model).
I'm working on that right now and will start looking into HLS as soon as it's done.
I plan to start with clear content support first.

My hope is to finish refactoring work this year or early January (it's a pretty big change), so you should start seeing first HLS commits early next year.

I want to be cautious in terms of speaking to the timeline until I've started the work and have full context, but I'll let you know more as soon as I can!

Thanks for the offer to help with the testing, we're always happy to get feedback.

@shaharmor
Copy link

@ismena Are you going to use your own HLS provider or hls.js? I highly recommend hls.js 👍

@joeyparrish
Copy link
Member Author

We are going to write a manifest parser plugin for HLS. We do not plan on using hls.js.

shaka-bot pushed a commit that referenced this issue Dec 28, 2016
Issue #279

Change-Id: Idf4241b4e2490876bdc6275685361a5c9bf132b0
shaka-bot pushed a commit that referenced this issue Jan 3, 2017
These properties are no longer used since we refactored for variants.
All compatible AdaptationSets are now implicitly squashed together.

Issue #279

Change-Id: Idc1922c54b0c1aa62f3199369b8e819e3a374b55
shaka-bot pushed a commit that referenced this issue Jan 3, 2017
Sorting by language then bandwidth led us to compare text tracks to
variant tracks, provided that they had the same language.

Text tracks don't have bandwidth info.  t1.bandwidth - t2.bandwidth
was undefined - number, which resulted in NaN.  This caused the sorted
order of variants to be wrong, as some video tracks got pushed to the
end when compared with text.

The fix is to compare type first, then language, then bandwidth.

Introduced during refactors as part of #279.

Change-Id: I1033b9d9252498db5fe90abe7508393fe2eddd22
shaka-bot pushed a commit that referenced this issue Jan 9, 2017
Issue #279.

Change-Id: I5b6f90b682d77849ce075a2a76a4202c56e5d882
@birme
Copy link
Contributor

birme commented Feb 10, 2017

Ok, so no TS support on Chrome/Firefox in the library?

@joeyparrish
Copy link
Member Author

Correct.

@ismena
Copy link
Contributor

ismena commented Feb 10, 2017

@avelad I'll take a look!

shaka-bot pushed a commit that referenced this issue Feb 10, 2017
Issue #279.

Change-Id: I860d72f7c22b2d4a8eee863dfcc4277cf80b5fc6
shaka-bot pushed a commit that referenced this issue Feb 10, 2017
Issue #279.

Change-Id: Ic082b268877c2b5336080113c96a73f029a1503c
@ismena
Copy link
Contributor

ismena commented Feb 10, 2017

@avelad Done, but there is a catch. In order to play this stream shaka.hls.HlsParser.DEFAULT_TIME_OFFSET constant will have to be changed from 10 to 0.
10 seconds seems to be a default start time offset on Apple-encoded content that's why we also set our expectation accordingly.

We're still in the process of finding a better way to detect the start time of the content if none has been specified in the manifest. If a manifest specifies EXT-X-START:TIME-OFFSET=n we will respect this value over the default.

shaka-bot pushed a commit that referenced this issue Feb 10, 2017
Issue #279.

Change-Id: I3b3935906e7e5989db6788648f2b2400b66369f5
shaka-bot pushed a commit that referenced this issue Feb 15, 2017
Issue #279.

Change-Id: Ie32ab228ab0d00f0def9f2ee8d7c1e496b346ef8
shaka-bot pushed a commit that referenced this issue Feb 21, 2017
An init segment is not required for all streams, some streams are
self-initializing (e.g. MPEG2-TS).

Issue #279

Change-Id: I99556ee26f6568cc5e712b50d0bb4de78cb2bd9d
shaka-bot pushed a commit that referenced this issue Feb 21, 2017
When appending MPEG2-TS segments, we seem to always enter a
PARSING_MEDIA_SEGMENT state in the SourceBuffer.  While we are in this
state we can't change the timestampOffset.  This means that we can't
change Periods or adapt to a different resolution.

To fix this, we call abort() before setting the timestampOffset to
reset the state.  Because abort() also resets the appendWindowEnd,
this merges the two operations so we set timestampOffset and
appendWindowEnd at the same time (since we do already).

Issue #279

Change-Id: Icd893ded9e3137179f262ba10e55e41d06ec5a77
shaka-bot pushed a commit that referenced this issue Feb 28, 2017
Issue #279

Change-Id: I491e0e7da2a814276e071fcd98deb66753c03122
shaka-bot pushed a commit that referenced this issue Mar 2, 2017
Apple encoded content has a default time offset of 10 seconds.
Every other packeger we've encountered so far doesn't.
New config will default to 0 and allow the application to specify
the offset for their content according to the packager's standards.

Issue #279

Change-Id: I65b16b05a5974a2f0318cd1f9847c3a56c38b745
shaka-bot pushed a commit that referenced this issue Mar 15, 2017
Currently HLS parser expects only one media tag to have a given
group id. According to the spec that might not be the case.
This change adds support for multiple tags with the same gruop id
and insures the parser creates variants for all of them.

Issue #279.

Change-Id: I327e52387f7513464fc56c4b6b8d07ead689d6cc
@DanielEliraz
Copy link

Can we use the hls feature already?
I cloned the master branch and built it, but I had error 4011 when i injected my stream.

@joeyparrish
Copy link
Member Author

@DanielEliraz: The implementation in master is not complete, but error 4011 indicates that the browser doesn't support the content. If it's MPEG2-TS content, Chrome & Firefox do not support that, and Shaka Player does not transmux to MP4.

shaka-bot pushed a commit that referenced this issue Mar 23, 2017
Until we implement support for protected content for HLS, we
reject it. We used to determine it by the presence of an
'EXT-X-KEY' tag. However, it is possible for the manifest to
have the tag, but describe clear key content if the 'METHOD'
attribute of the tag is 'NONE'. This CL insures we don't reject
this kind of playlists.

Issue #279.

Change-Id: Iee853dd23116c40a43b228f0876efe373c3111af
shaka-bot pushed a commit that referenced this issue Mar 29, 2017
This change enables HLS parser to get DRM information
from the manifest and create DrmInfo objects.
Note that until we actually add support for any of the
drm systems, we will still reject encrypted content.

Issue #279.

Change-Id: I4d0652411a567bc75d919c5bf732f20e870a5aeb
shaka-bot pushed a commit that referenced this issue Mar 29, 2017
According to the HLS spec, CODECS attribute should have a comma-
separated list of codecs. The example in the spec doesn't contain
spaces between the elements of the list.
However, I encountered spaces in the codecs list in content
encoded by Apple. It's easy to support both ways, so I decided to
do it rather than fight that battle.

Issue #279.

Change-Id: Iecb706207365a51b5964f013e32ffe13e99604c6
shaka-bot pushed a commit that referenced this issue Mar 29, 2017
We wanted to see if Media Source would accept a list of codecs for
a presentation without specifying which one belongs to which stream.
If it was possible, we wouldn't have to try and guess the codecs
and also wouldn't be limited to a made up list of codecs that we
know Media Source supports.
Been there, done that, doesn't work :|

Issue #279.

Change-Id: Id706022887beaa576eb0f68f2f97a278a0730f30
shaka-bot pushed a commit that referenced this issue Mar 30, 2017
This will allow me to use it outside of prototype methods in an
upcoming change.

Issue #279

Change-Id: Iaa7c9a92787d0f33b86dc1ba823f750aa268b9b1
shaka-bot pushed a commit that referenced this issue Mar 30, 2017
For some reason, in some of my testing, the captured "uri" variable
was undefined by the time the Promise was resolved.  Instead, use
"response.uri", which accounts for redirects anyway.

Issue #279

Change-Id: Ibaef99a57dc01a665d095fec4765ac9b32d537ac
shaka-bot pushed a commit that referenced this issue Mar 30, 2017
Widevine HLS manifests have a data URI that needs to be parsed to
generate DrmInfo.  Rather than write another parser, factor the data
URI networking plugin to expose the parser to other classes.

Issue #279

Change-Id: I71f174b86cc3b0ae0e8dbc31701ea9d36cd157ee
shaka-bot pushed a commit that referenced this issue Mar 30, 2017
Issue #279

Change-Id: I7a7de1f7321210322144469188fd5d99d0040c0b
shaka-bot pushed a commit that referenced this issue Mar 31, 2017
This abstracts the creation of DrmInfo to parse the EXT-X-KEY tag
differently per KEYFORMAT.

Issue #279

Change-Id: I2e187dcfc01f7306183c9090c54de58e81872bc4
@joeyparrish joeyparrish added the component: HLS The issue involves Apple's HLS manifest format label Mar 31, 2017
@joeyparrish
Copy link
Member Author

We have support for MP4 VOD HLS, in the clear and encrypted with Widevine. We have TS working on Edge and Chromecast.

I've created new issues for some of the remaining HLS features:

CEA 708 captions: #276
Safari FairPlay: #382
Live streaming: #740
Key rotation: #741
Trick mode: #742
Safari TS: #743

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests