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

troubleshouting setting to ignore inputstream.adaptive #255

Merged
merged 1 commit into from
May 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ msgctxt "#30869"
msgid "Log level"
msgstr ""

msgctxt "#30871"
msgid "Use InputStream Adaptive"
msgstr ""


### MESSAGES
msgctxt "#30951"
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.nl_nl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ msgctxt "#30069"
msgid "Log level"
msgstr "Log level"

msgctxt "#30871"
msgid "Use InputStream Adaptive"
msgstr "Gebruik InputStream Adaptive"


### MESSAGES
msgctxt "#30951"
Expand Down
Binary file added resources/lib/__init__.pyo
Binary file not shown.
13 changes: 8 additions & 5 deletions resources/lib/kodiwrappers/kodiwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,19 @@ def get_proxies(self):

return dict(http=proxy_address, https=proxy_address)

# NOTE: InputStream Adaptive is not pre-installed on Windows and in some cases users can uninstall it
def has_inputstream_adaptive_installed(self):
return xbmc.getCondVisibility('System.HasAddon("{0}")'.format('inputstream.adaptive')) == 1
def has_inputstream_adaptive(self):
if self.get_setting('useinputstreamadaptive') == 'true':
return xbmc.getCondVisibility('System.HasAddon("{0}")'.format('inputstream.adaptive')) == 1
return False

def has_credentials(self):
return bool(self.get_setting('username') and self.get_setting('password'))

def can_play_drm(self):
kodi_version = int(xbmc.getInfoLabel('System.BuildVersion').split('.')[0])
return kodi_version > 17
if self.get_setting('useinputstreamadaptive') == 'true':
kodi_version = int(xbmc.getInfoLabel('System.BuildVersion').split('.')[0])
return kodi_version > 17
return False

def get_userdata_path(self):
return xbmc.translatePath(self._addon.getAddonInfo('profile'))
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/vrtplayer/streamservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def get_stream(self, video, retry=False, api_data=None):
drm_stream = (vudrm_token or uplynk)

# Select streaming protocol
if not drm_stream and self._kodi.has_inputstream_adaptive_installed() or drm_stream and self._can_play_drm and self._kodi.get_setting('usedrm') == 'true':
if not drm_stream and self._kodi.has_inputstream_adaptive() or drm_stream and self._can_play_drm and self._kodi.get_setting('usedrm') == 'true':
Copy link
Collaborator

@dagwieers dagwieers May 19, 2019

Choose a reason for hiding this comment

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

~If I remember it right and has precedence over or which means that all of the following conditions need to be met:
Update: I was wrong.

Copy link
Collaborator

@dagwieers dagwieers May 19, 2019

Choose a reason for hiding this comment

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

I prefer to rewrite it like this:

                if not drm_stream and self._kodi.has_inputstream_adaptive():
                    protocol = 'mpeg_dash'
                elif drm_stream and self._can_play_drm and self._kodi.get_setting('usedrm') == 'true':
                    protocol = 'mpeg_dash'

Still, I am not sure this is what is intended if we disable the use of inputstream.adaptive.

I am also not sure how MPEG_DASH or HLS related to inputstream.adaptive.

  • Can we play both MPEG_DASH and HLS without inputstream.adaptive ?
  • Can we play both MPEG_DASH and HLS with inputstream.adaptive ?

Would it make sense to also have an option like:

  • Preferred streaming format: HLS / MPEG_DASH

Maybe we need a matrix in the Wiki to describe working combinations wrt. DRM, inputstream.adaptive and Kodi (OMX player vs MMAL player).

Copy link
Collaborator Author

@mediaminister mediaminister May 19, 2019

Choose a reason for hiding this comment

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

  1. InputStream Adaptive is indispensable to play MPEG DASH (with or without Widevine DRM protection)
  2. Widevine DRM-support (for InputStream Adaptive) is not available on Kodi 17 at all.
  3. We can play HLS with Inputstream Adaptive but also with standard Kodi player
  4. In Kodi 17 different older versions of InputStream Adaptive are available with less functionality.
  5. There are 7(!) different Kodi 17 releases and it's unclear how well InputStream Adaptive works on all these versions.

So, in streamservice I made choices to limit possible streaming combinations:

  • InputStream Adaptive installed: always play MPEG-DASH
  • InputStream Adaptive is missing: always play HLS

This is a simple workflow and it guarantees video and audio will always play on every Kodi version and platform.

Making HLS or MPEG-DASH a user choice makes little sense. The useinputstreamadaptive setting basically has the same effect because of the choices I made in streamservice.

Splitting up the if statement for cosmetics is okay (both can_play_drm and has_inputstream_adaptive functions listen to the useinputstreamadaptive setting.)

Documenting stream compatibility in the wiki won't hurt but is not a priority for me.

Copy link
Collaborator

@dagwieers dagwieers May 19, 2019

Choose a reason for hiding this comment

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

@mediaminister Thanks for the detailed description. It may be useful to detail this in the code, and maybe even in the settings when we disable InputStream Adaptive (e.g. this forces use of HLS) in the help (which isn't shown yet, needs fixing in Kodi).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mediaminister I noticed you have been promoted to Collaborator so you can now assign things to me, or ask me to review something. Welcome :-)

protocol = 'mpeg_dash'
elif vudrm_token:
protocol = 'hls_aes'
Expand Down
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
<setting label="30865" help="30866" type="action" id="refresh_favorites" action="RunPlugin(plugin://plugin.video.vrt.nu/?action=refreshfavorites)"/>
<setting label="30867" help="30868" type="action" id="clear_tokens" action="RunPlugin(plugin://plugin.video.vrt.nu/?action=clearcookies)"/>
<setting label="30869" help="30870" type="select" id="max_log_level" values="Quiet|Info|Verbose|Debug" default="Info"/>
<setting label="30871" help="30872" type="bool" id="useinputstreamadaptive" default="true"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can also make this option visible only when inputstream.adaptive is installed.

I am also considering to add in this window a few text-fields that contain important debug information, e.g.
inputstream.adaptive version, inputstreamhelper version, Widevine information (if possible), etc.

ANd maybe add some section headers to group things together.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Done.

</category>
</settings>