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

[PropertiesUtils] Add streams_config property #1250

Draft
wants to merge 2 commits into
base: Omega
Choose a base branch
from

Conversation

CastagnaIT
Copy link
Collaborator

@CastagnaIT CastagnaIT commented May 4, 2023

Description

This PR add a new property: inputstream.adaptive.streams_config
the name a bit generic to allow in future possibile new extensions of these configurations relative to streams without add new properties (if you want suggest a better naming say so)

the values are handled in similar way of a pair values (or something similar of python dict) as follow:
key=value;
more values are so concatenated:
key=value;key2=value2;key3=value3;

inputstream.adaptive.streams_config

Supported configuration keys:

  • audio_langcode_default: Set the "default" flag to the audio streams with specified language code (need to match the manifest)
  • audio_langcode_original: Set the "original" flag to the audio streams with specified language code (need to match the manifest)
  • audio_prefer_stereo: Can be set to true when you want prefeer stereo track as default instead of multichannels (it depends from audio_langcode_default and/or audio_langcode_original)
  • audio_prefer_type: Can be set to original to prefer set default streams with original language, or impaired to prefer set default streams for impaired, otherwise left empty value for default behaviour.
  • subtitles_langcode_default: Set the "default" flag to the subtitle streams with specified language code (need to match the manifest)

Example:
audio_langcode_default=pt_br;audio_prefer_stereo=true

Motivation and context

Completed fix for #422 for DASH and in more general way,
after the recent parser rework i have improved the behaviour of AdaptationSet tag ISA custom attributes:
default, impaired, forced, original
where now can be add and used to full override default manifest stream attributes,
the reason is that Kodi stream flags have not always have the same meaning of manifests attributes
and/or there are video services that dont follow exactly the specs and lead to wrong flags set to the audio/subtitle tracks

ofc add these custom ISA attributes needs to implement a proxy on a video add-on not so easy to do for novice devs but also expensive for low end devices, therefore this PR add two new properties that allow to set (and so override) the default stream language and original stream language in easy way

HLS manifest note

This manifest type not always have appropriate language codes and also not always provide right number of audio channels in th metadata, therefore above configurations may fails, strictly depends on the service provider

WIP - i will evaluate this part in the coming days:

i will need to make some more tests
use json for property values

How has this been tested?

Tested with a sample dash

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

@CastagnaIT CastagnaIT added Type: Feature non-breaking change which adds functionality v21 Omega labels May 4, 2023
@CastagnaIT CastagnaIT force-pushed the stream_lang_flags branch from b47bc99 to aa6d500 Compare June 7, 2023 09:07
@CastagnaIT CastagnaIT changed the title [PropertiesUtils] Add stream_audio_cfg, stream_subtitles_cfg properties [PropertiesUtils] Add streams_config property Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature non-breaking change which adds functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant