aussieaddons / plugin.video.abc_iview

ABC iView add-on for Kodi
http://aussieaddons.com/addons/abc_iview/
GNU General Public License v3.0
60 stars 24 forks source link

No sound in any videos #3091

Open TonyPuryer opened 1 year ago

TonyPuryer commented 1 year ago

Sound isn't available for any shows. If I go to the audio stream setting in Kodi it says 'None'.

This behaviour has started this week after years of faultless performance. An upgrade to Kodi 20 had no effect as expected.

The shows work using the official ABC iView app on the same tv box (Xiaomi Mi Box).

I tried to download a show using Youtube-dl (now yt-dlp) and it says "WARNING: The stream has AES-128 encryption and pycryptodomex is not available; extraction will be delegated to ffmpeg".

I have used Youtube-dl/yt-dlp a lot in the past and have never seen this warning before so I'm suspecting this is the cause of the no audio issue.

Edit: I'm adding this edit after andybotting and glennguy have posted below.

It would have helped if I had added the offending urls.

These streams have previously played fine with the iView plugin so it appears ABC have done some changes to them over the past week. I've also found that, like Glen's experience, some files work and some don't.

https://iview.abc.net.au/video/DO2109H001S00 https://iview.abc.net.au/video/DO2109H002S00 https://iview.abc.net.au/video/DO2109H003S00

have no audio

https://iview.abc.net.au/video/DO1703H001S00

has audio

andybotting commented 1 year ago

Hi @TonyPuryer,

I've just tested a few shows on my NVIDIA Shield with the standard Kodi v20 installed from the play store and I can't reproduce the issue.

I do have a Mi Box as well, which I might test tomorrow (it's unplugged atm)

I might also try ytl-dl. I've not used it for anything on iView for a while, but I've also not seen that error. I'm on Linux though.

glennguy commented 1 year ago

Thanks for chiming in Andy.

It's a bit hit and miss here. The kids were able to watch some Bluey episodes and not others.

Turns out the issue is partly due to some malformed master m3u8 playlists.

Here's one:

#EXTM3U
# Created with KeyOS MultiPack (mp4hls) version 1.2.0r637

# Subtitles
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="English",LANGUAGE="en",URI="../subtitles/en/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/subtitles.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls"

# Media Playlists
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=1263712,BANDWIDTH=2105828,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1280x720,AUDIO="audio_aac",SUBTITLES="subtitles"
../3000000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=485798,BANDWIDTH=522567,CODECS="avc1.4D401E,mp4a.40.2",RESOLUTION=320x180,AUDIO="audio_aac",SUBTITLES="subtitles"
../220000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=1276465,BANDWIDTH=2115604,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1280x720,AUDIO="audio_aac",SUBTITLES="subtitles"
../4500000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=629444,BANDWIDTH=764260,CODECS="avc1.4D401E,mp4a.40.2",RESOLUTION=512x288,AUDIO="audio_aac",SUBTITLES="subtitles"
../500000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=723467,BANDWIDTH=885934,CODECS="avc1.4D401E,mp4a.40.2",RESOLUTION=640x360,AUDIO="audio_aac",SUBTITLES="subtitles"
../650000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=1048631,BANDWIDTH=1702455,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1024x576,AUDIO="audio_aac",SUBTITLES="subtitles"
../1500000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=866400,BANDWIDTH=1218017,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=800x450,AUDIO="audio_aac",SUBTITLES="subtitles"
../1000000/hdntl=exp=1682768450~acl=%2f*~data=hdntl~hmac=32a523edb0980469fada15344c23c6efbc78a6b8884108b65ea40d89c8841e6a/stream.m3u8?aka_me_session_id=AAAAAAAAAABCAk1kAAAAAKsaKvqIH0w1wV4jCEesqqUtuYDo0vnvXiO5frhdmBhsO%2ftGT0U8rNMdjZn53qA2DJpuzMLVx5Hy&aka_media_format_type=hls

Normally the streams are packaged with a combined video/audio stream - the .ts segments contain audio and video tracks.

This playlist has video streams that reference separate audio streams (AUDIO="audio_aac")

The problem is that those audio streams don't actually appear in the master playlist! And, the .ts files in the video streams are still containing audio!

Forcing inputstream.adaptive to ignore the AUDIO attribute gives playback as expected.

So we can hope that ABC will fix the issue which may only happen if its affected an official platform. I'm not sure what's actually being used but I know web uses the mpeg dash streams (which by the way I spent a fair amount of time getting the auth going for, only to discover that we're stuffed on non-android/linux x64 platfoms as they have VMP enabled for Widevine) but there may be other platforms like older tvs still using HLS.

Or, we can proxy the HLS playlist and fix it - parse the master playlist and if there are video streams referencing a non-existent audio stream, remove the audio tag. If we go that way I'd prefer to only proxy the master playlist and not everything. Since there's relative urls we'd have to rewrite it with absolute.

glennguy commented 1 year ago

One more bit of info to note - the hls-latest streams that are in the currently non-working programs have split video/audio streams, but there's an issue with the ADTS demuxer. It won't start with sound, but seeking fixes it. Not viable until it's sorted in IA.

glennguy commented 1 year ago

Found the issue in inputstream.adaptive, this will only help users on Kodi v20/v21 though so it might still be worth implementing the playlist proxy for older versions.

TonyPuryer commented 1 year ago

Forcing inputstream.adaptive to ignore the AUDIO attribute gives playback as expected.

glennguy, are you able to advise how to accomplish this with Kodi? I have inputstream.adaptive version 20.3.8 (latest) and this issue is still occurring so a hacky workaround would be great in the meantime until the iView plugin is fixed.

glennguy commented 1 year ago

I did that by hard coding to ignore that tag, but this breaks most other streams. You can try this: Change these 2 lines in comm.py https://github.com/aussieaddons/plugin.video.abc_iview/blob/master/resources/lib/comm.py#L94-L95 So that both occurrences of 'hls' are instead 'hls-latest' like so

if 'hls-latest' in playlist.get('streams'):
    hls_streams = playlist['streams'].get('hls-latest')

Careful to preserve the identation of each line. You'll need to restart Kodi for the code changes to take effect.

You'll need a recent version of inputstream.adaptive on Kodi 20 for this to work properly. And you'll notice that when seeking you sometimes lose video for a few seconds.

Other than that, I started working tonight on a proxy as a workaround.

glennguy commented 1 year ago

Hi Tony,

My apologies for the delay. I have a zip file for you to try: plugin.video.abc_iview.zip

This implements a proxy server to rewrite the master playlist file. The above playlist will be altered to look more like:

#EXTM3U
# Created with KeyOS MultiPack (mp4hls) version 1.2.0r637

# Subtitles
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="English",LANGUAGE="en",URI="https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/subtitles/en/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/subtitles.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls"

# Media Playlists
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=854431,BANDWIDTH=934119,CODECS="avc1.4D401E,mp4a.40.2",RESOLUTION=640x360,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/650000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=1173258,BANDWIDTH=1355539,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=800x450,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/1000000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=1567686,BANDWIDTH=1896077,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1024x576,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/1500000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=2143475,BANDWIDTH=3240503,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1280x720,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/3000000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=2230162,BANDWIDTH=4035066,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1280x720,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/4500000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=506855,BANDWIDTH=529543,CODECS="avc1.4D401E,mp4a.40.2",RESOLUTION=320x180,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/220000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=730142,BANDWIDTH=808685,CODECS="avc1.4D401E,mp4a.40.2",RESOLUTION=512x288,SUBTITLES="subtitles"
https://iview-vod-hls.akamaized.net/prod/do2/DO2109H001S00MA2D1/20230419233309/hls/500000/hdntl=exp=1684848598~acl=%2f*~data=hdntl~hmac=06454bd845aa25a86a3f0078348cfd041cb873dacd34788da063c58a14a8edfb/stream.m3u8?aka_me_session_id=AAAAAAAAAADWv2xkAAAAABOykWd6Qf8gypUJZ5gKFGgwMhu3xYgVAslz7Bt7CorlDr2FLGE0BGooTkk2qqrbHhWm83tLSar0&aka_media_format_type=hls

The relative urls are rewritten to their full path - this is so the rest of the stream won't go through the proxy server. And the instances of AUDIO=audio_aac are removed so that inputstream.adaptive will pick up the actual audio stream that's included in the video files.

The proxy will only be used when the playlist is malformed.

Hoping to get your feedback :)

TonyPuryer commented 1 year ago

Hi Glenn,

I have tested the plugin and it works great. No issues to report.

All the previously silent videos now have sound, and all other videos play fine too.

Thank you from all of my family for fixing this. ABC TV gets a good workout here and it's much easier to browse it through Kodi than through the official app.

glennguy commented 1 year ago

@andybotting any issues with the approach taken in https://github.com/aussieaddons/plugin.video.abc_iview/commit/e69d41dbb46ce26841bed122d0d8e9e9daa80548 ?

I started with reusing the thumbnail download proxy code from 7plus and went from there. There's a little bit of 'magic numbering' going on like relying on the audio attribute to not be first (searching for leading comma) but I don't expect there to be an issue unless the packager is changed completely - in that case I'd expect a lot more than this to break.

andybotting commented 1 year ago

@glennguy Looks great to me. There's a few commented out lines, which would be nice to either clean up or document why, but the code looks good otherwise :+1:

glennguy commented 1 year ago

I'll put some notes in and make a release.

I spent a while implementing DASH/Widevine which has it's own extra auth stuff needed, only to find out that they've configured the license server to enforce 'Verified Media Path' on at least Windows. That means that it will only generate a license if the program running the content decryption module has been signed by Widevine - so definitely not us! I've left the code in there for future if it's needed. It should run on Android and possibly some of the Linux platforms.

bob-mcsnow commented 1 year ago

This appears to be resolved.... at least for bluey. I put in a request this morning to ABC that they fix the sketchy m3u8 playlists.... they have either done this or you guys fixed it in yesterdays patch. Either way very grateful for your work.