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

Set language info for dash audio streams and sort #5094

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GTechAlpha
Copy link

@GTechAlpha GTechAlpha commented Nov 25, 2024

Set audio track info, if present, in dash manifest

  • language id
  • language display name
  • main/default track

Sort audio formats so that main/default is first (for clients not using dash)

This resolves issue of incorrect/undesired audio when automatic translation is enabled by content creator (currently relatively rare, but likely to increase), and allows dash clients to correctly select default language and optionally offer multiple language streams.

closes #2007

Note: this should be a non-breaking change; if audio track info is not available, the behavior does not change from current

  - language id
  - language display name
  - main/default track
Sort audio formats so that main/default is first (for clients not using dash)

* Note: this should be a non-breaking change; if audio track info is not availablle, the behavior does not change from current
@GTechAlpha GTechAlpha requested a review from a team as a code owner November 25, 2024 19:38
@GTechAlpha GTechAlpha requested review from unixfox and removed request for a team November 25, 2024 19:38
@unixfox
Copy link
Member

unixfox commented Nov 25, 2024

Hello, thank you for the PR that's really interesting. If this solves #2007, could you add close #2007 in your PR description?

# Different representations of the same audio should be groupped into one AdaptationSet.
# However, most players don't support auto quality switching, so we have to trick them
# into providing a quality selector.
# See https://github.com/iv-org/invidious/issues/3074 for more details.
xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, label: fmt["bitrate"].to_s + "k") do
xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, label: displayname, lang: lang) do
Copy link
Member

Choose a reason for hiding this comment

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

In the case of different representations of the same language you'll end up with two AdaptationSet with the same label and lang. I think that might confuse some downstream clients (and users) if two audio tracks end up having the same label and language.

For example see the dash manifest for this video with this PR https://youtube.comwatch?v=urevinis_PU

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.

[Enhancement] Add support for multiples audio tracks
3 participants