xbmc icon indicating copy to clipboard operation
xbmc copied to clipboard

Turn on HDR cause lose high-bitrate audio

Open Liqianyu opened this issue 3 years ago • 5 comments

Addon used

  • [X] Amazon VOD (plugin.video.amazon-test)
  • [ ] Browser Launcher (plugin.program.browser.launcher)
  • Addon version:

Account type

  • [ ] primevideo.com
  • [X] amazon.(com/co.uk/de/jp)

System Setup (please provide the following information):

  • Hardware:Shield TV 2019 Pro
  • OS version:9.1.0
  • Kodi version number:20 Alpha 2

Upload Logs

Describe the bug

With HDR10+ turned on, I noticed that the audio was only DD+ 192Kbps. If it is SDR, it has two audio tracks of DD+ 192 and 640Kbps. Is this some kind of limitation of Prime Video? Add-On Technical limitations? Can someone confirm Dolby Vision?

Liqianyu avatar Jul 16 '22 20:07 Liqianyu

By using Shield's official Prime Video client, we can get more information. Quickly type "left-right-up-down-up-down" into the Prime Video client to switch to the PlayBack UX page. Play the video. We can see the real-time resolution, video bitrate, audio encoding, and audio bitrate. It seems that for DD+ content, the app will use 192Kbps whether in SDR or HDR, and for Atmos content. It will use 448Kbps. regardless of SDR, HDR. Add-ons will behave differently, SDR can use 192, 680Kbps, while HDR can only use DD+ 192Kbps. atmos 448Kbps, SDR does not seem to show Atmos tracks under. Hopefully someone can replicate my test, at the moment the issue I think is related to the Amazon platform.

Based on the comparison, I think HDR10 should be chosen, CBR has a much higher video bitrate than CVBR. This results in higher video quality in the vast majority of cases.

Amazon Prime - max 192kbps for 5.1 on some major titles https://forum.redfox.bz/threads/amazon-prime-max-192kbps-for-5-1-on-some-major-titles.81586/

Liqianyu avatar Jul 17 '22 02:07 Liqianyu

As far as I know, this problem comes from how Amazon presents audio streams in the manifest, and how inputstream.adaptive handles them.

With Amazon, all of the audio for one language is a single AdaptationSet. Within that set are multiple representations of the same stream, so the client can switch between them based on the currently available bandwidth. But IS.A doesn't do that, it just selects the first representation and rolls with it.

In the test plugin I wrote to get UHD / HDR working, I managed to fix this by splitting up the AdaptationSets, creating one for each representation. IS.A will then select the one with the highest bitrate (or the first one again, I am not sure). But you will be able to switch them in the audio options.

If a title has atmos, Amazon also does something interesting: The atmos track will be there with a bitrate of 448kbps, but additionally, there will be a non-atmos track with 640kbps. So IS.A will never pick the atmos track on its own.

StollD avatar Jul 18 '22 09:07 StollD

@StollD I have set the stream selection type of I.S.A to Manual OSD, Manual stream selection mode Audio/Video streams. I think this should show all the streams provided by mpd ? By comparing mpd files, I think unless there is a Hack method to mix audio and video streams of different mpd. Otherwise the mpd that contains HDR10 video streams only contains 192Kbps DD+ audio.

I would like to try your plugin.video.tmsp-amazon, but an error occurs when I login, details are as follows 07-18 18:40:02.421 22001 23191 E Kodi : File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.tmsp-amazon/default.py", line 13, in <module> 07-18 18:40:02.421 22001 23191 E Kodi : File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.tmsp-amazon/resources/lib/auth.py", line 55, in login 07-18 18:40:02.421 22001 23191 E Kodi : File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.tmsp-amazon/resources/lib/api/login.py", line 100, in login 07-18 18:40:02.421 22001 23191 E Kodi : File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.tmsp-amazon/resources/lib/api/login.py", line 83, in get_form_inputs

I wonder if it's because my account username is empty? https://github.com/Sandmann79/xbmc/issues/516

Liqianyu avatar Jul 18 '22 10:07 Liqianyu

That could be. I never intended my plugin to be widely used, so the login code is not very sophisticated.

StollD avatar Jul 18 '22 16:07 StollD

By capturing the Apple TV data, it looks like Amazon is also only offering DD+ (E-AC3) 192Kbps at the highest in tvOS, in addition to HE-AAC 32\64,AAC-LC 128Kbps. Next time I look at Dolby Atmos...

Liqianyu avatar Jul 21 '22 18:07 Liqianyu