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

Fix for gap size warning in Low Latency mode #985

Conversation

CaitlinOCallaghan
Copy link
Contributor

The issue

  • With LL-DASH mode enabled, the gap size warning was hit and printed to the console every time a new segment was registered to the manifest.
  • This occurred because the first chunk's size and duration were being stored for each segment, rather than the full segment size and duration. Note, only the first chunk's metrics are known at first because in low latency mode, the segment is registered to the manifest before it is finished being processed and written.
  • Because of this, the gap size check was comparing the end time of the first chunk in the previous segment to the beginning time of the current segment, causing the check to fail every time.

The Fix

  • Update a low latency segment's duration and size once the segment file has been fully written.
  • The full segment size and duration will be used to update the bandwidth estimator and the segment info list.
  • Updating the segment info list to hold the full duration is necessary for satisfying the gap size check found in Represenation.cc.
  • NOTE: bandwidth estimation is currently only used in HLS

Testing

  • ./mpd_unittest --gtest_filter="SegmentTemplateTest.OneSegmentLowLatency"
    image

  • manual
    image

@CaitlinOCallaghan CaitlinOCallaghan changed the title Update low latency segment duration Fix for gap size warning in Low Latency mode Aug 30, 2021
@joeyparrish joeyparrish merged commit c87c5bc into shaka-project:master Sep 3, 2021
@joeyparrish
Copy link
Member

Thank you!

@CaitlinOCallaghan
Copy link
Contributor Author

Thank you for your help and support Joey!

@joeyparrish
Copy link
Member

My pleasure!

@kevleyski
Copy link

Thanks again Caitlin

sr1990 pushed a commit to sr1990/shaka-packager that referenced this pull request Feb 18, 2023
## The issue
- With LL-DASH mode enabled, the gap size warning was hit and printed to the console every time a new segment was registered to the manifest.
- This occurred because the first chunk's size and duration were being stored for each segment, rather than the full segment size and duration. Note, only the first chunk's metrics are known at first because in low latency mode, the segment is registered to the manifest before it is finished being processed and written.
- Because of this, the gap size check was comparing the end time of the first chunk in the previous segment to the beginning time of the current segment, causing the check to fail every time.

## The Fix
- Update a low latency segment's duration and size once the segment file has been fully written.
- The full segment size and duration will be used to update the bandwidth estimator and the segment info list. 
- Updating the segment info list to hold the full duration is necessary for satisfying [the gap size check found in Represenation.cc](https://github.com/google/shaka-packager/blob/master/packager/mpd/base/representation.cc#L391).
- NOTE: bandwidth estimation is currently only used in HLS
sr1990 pushed a commit to sr1990/shaka-packager that referenced this pull request Feb 18, 2023
## The issue
- With LL-DASH mode enabled, the gap size warning was hit and printed to the console every time a new segment was registered to the manifest.
- This occurred because the first chunk's size and duration were being stored for each segment, rather than the full segment size and duration. Note, only the first chunk's metrics are known at first because in low latency mode, the segment is registered to the manifest before it is finished being processed and written.
- Because of this, the gap size check was comparing the end time of the first chunk in the previous segment to the beginning time of the current segment, causing the check to fail every time.

## The Fix
- Update a low latency segment's duration and size once the segment file has been fully written.
- The full segment size and duration will be used to update the bandwidth estimator and the segment info list. 
- Updating the segment info list to hold the full duration is necessary for satisfying [the gap size check found in Represenation.cc](https://github.com/google/shaka-packager/blob/master/packager/mpd/base/representation.cc#L391).
- NOTE: bandwidth estimation is currently only used in HLS
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants