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(HLS concatenation): Use posixpath for any path joining written in self.content #91

Merged
merged 75 commits into from
Sep 8, 2021

Conversation

mariocynicys
Copy link
Contributor

Changes:

  • Namespacing the BaseURL tag that we insert under "urn:mpeg:dash:schema:mpd:2011". It would work fine either way(with or without the namespace) since we register this namespace we insert as the default namespace a couple of line later. But this change was to fix a potential error that could occur if we stop registering default_dash_namespace(=="urn:mpeg:dash:schema:mpd:2011") to be the default one.
  • Using posixpath module for joining the paths to the media segments. Since we write these paths in media playlist files at the end, they should all be using a forward slash as a separator, which is not the case for windows using os.path. This wasn't breaking in Shaka Player for some reason, but i reckon it might break in other HLS players.

Before the `Channel count as an input feature` PR or rather `Channel layout as an input feature` shall i say, we had this problem where we are not guaranteed that a lower channel count exists for every input.  For example, an input(period) might have six channel and no two channel, while another input might have two channels AND six channels, though in this configuration we have 2 & 6 channels but we can't generate 2 playlists (2 & 6), what we can do instead in this case is to generate two playlists, one has (2 and 6 channels) and one having (6 and 6 channels), And we have to mark both playlists with `CHANNELS="6"` because both of them has a maximum of 6 channel count across all periods, and also since the audio playlist is a media playlist, so no way for shaka player to know the bitrate for each playlists, so shaka player will just look at these playlists as identical.

With the new change, we are guaranteed to have the lower channel for some input if a higher one exist (e.g if an input has 6 channels so it must have 2 also).

This way we can set the `CHANNELS="val"` attribute appropriately and we guarantee that we will generate a playlist for each unique channel layout we have in the inputs.
Use `posixpath` module instead of `os.path` when updating the media files paths, `os.path` will resolve to `ntpath` on Windows, which uses a backslash for path joining instead of a forward slash.
@mariocynicys mariocynicys changed the title Multi period fix(HLS concatenation): Use posixpath for any path joining written in self.content Sep 8, 2021
Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

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

Nice!

@joeyparrish joeyparrish merged commit 282db9d into shaka-project:master Sep 8, 2021
@mariocynicys mariocynicys deleted the multi-period branch September 9, 2021 12:08
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 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.

2 participants