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

Low latency dash support #3

Merged

Conversation

CaitlinOCallaghan
Copy link
Owner

@CaitlinOCallaghan CaitlinOCallaghan commented Aug 13, 2021

Overview

  • Added control hooks to enable LL-DASH streaming within Shaka Packager.
  • Allows for multiple UTC Timing values to be added, matching Shaka Packager's support.
  • Corresponding unit tests are included.
  • Provides a sample pipeline configuration for LL-DASH mode

Copy link
Owner Author

@CaitlinOCallaghan CaitlinOCallaghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with the 'can process LL-DASH streaming' unit test. I added some questions/comments to the test.js file regarding this problem.

tests/tests.js Show resolved Hide resolved
tests/tests.js Show resolved Hide resolved
rebufferingGoal: 0.01,
}
});
await player.load(manifestUrl);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This await is never resolved causing the test to fail :(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can debug in the http server in the python script that runs the tests to see what requests the player is making. That might give us a clue as to what's wrong.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this insight! I will check it out.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I figured out the issue! The run_end_to_end_tests.py process will sleep until the DASH or HLS stream is ready for playout. The readiness for the DASH case is determined by the function dashStreamsReady(). This function uses regex to check the MPD for the presence of a segment tag <S>, which indicates that a segment is available. LL-DASH MPDs do not contain <S>, so the LL-DASH stream was never able to trigger the ready state.

To fix this, I added a check for the availableTimeOffset attribute in the LL-DASH case. This attribute is equal to the segment duration minus the chunk duration. The availableTimeOffset value indicates to the player the earliest time that a segment can be played out, since, in the LL-DASH case, the segment can be downloaded and played before it is fully written.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good. Nice work!

@joeyparrish
Copy link

I'm going to be out of town soon. Will it be too late to help when I return on the 23rd?

@CaitlinOCallaghan
Copy link
Owner Author

I'm going to be out of town soon. Will it be too late to help when I return on the 23rd?

Have a wonderful holiday! When will you be leaving?

streamer/controller_node.py Outdated Show resolved Hide resolved
streamer/controller_node.py Outdated Show resolved Hide resolved
rebufferingGoal: 0.01,
}
});
await player.load(manifestUrl);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good. Nice work!

'is_low_latency_dash': true,
'utc_timings': [
{
'scheme_id_uri':'urn:mpeg:dash:utc:http-xsdate:2014',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might prefer replacing the scheme ID with a more readable enum, in the name of making the config files easier to write, but I don't think it's worth holding up this PR. Something to consider for later, though, if you have time.

I think we would restrict that enum to values equivalent to the "xsdate" and "head" schemes.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh, I like the idea of using an enum - I'll make sure to add it later.

The UTCTiming information is funky to format and very easy to mess up. The standard lists the following as the possible options.

https://dashif-documents.azurewebsites.net/DASH-IF-IOP/master/DASH-IF-IOP.html
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but we wouldn't have to offer all of those. I think xsdate and head are the simplest and easiest to explain in docs, and should cover most people's needs. For Streamer, I would tend to err on the side of "easy" and add power later if people request it.

streamer/pipeline_configuration.py Outdated Show resolved Hide resolved
@@ -309,6 +319,19 @@ class PipelineConfig(configuration.Base):
default=EncryptionConfig({})).cast()
"""Encryption settings."""

is_low_latency_dash = configuration.Field(bool, default=False).cast()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

design nit: I tend to think that "is" belongs on boolean getters, to see the state of a thing. For a declaration like this to instruct the pipeline to do something, I would call it something like "low_latency_mode". I would also make it apply to both DASH & HLS.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I totally agree. I'll change it to "low_latency_dash_mode" for now since my Packager fork supports only LL-DASH. HOWEVER! :D I was tinkering this weekend and made promising progress for LL-HLS support! 🥳 I'll finish that up, and once LL-HLS is working, I'll comb over the naming/comments/logic to make sure everything is changed to general "low latency" rather than LL-DASH specific.

@CaitlinOCallaghan CaitlinOCallaghan marked this pull request as ready for review August 16, 2021 21:36
@CaitlinOCallaghan
Copy link
Owner Author

Update: The failing test that was holding up this PR has been fixed! See here: #3 (comment)

Other style / formating / wording fixes were applied.

The following TODOs were also added:

  • Include LL-HLS once it is supported by Packager
  • Use an enum to simplify the UTCTiming schemeIdURI pipeline configuration input

@CaitlinOCallaghan CaitlinOCallaghan merged commit bdb76f3 into low-latency-dash-support-staging Aug 19, 2021
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.

3 participants