xbmc / inputstream.adaptive

kodi inputstream addon for several manifest types
Other
443 stars 240 forks source link

[Bug] Playback freezes in manifests with ads #1571

Open Paco8 opened 1 month ago

Paco8 commented 1 month ago

Describe the problem

When streaming content from PeacockTV on Kodi, playback freezes when ads are inserted in the middle of the video. In some instances, after several freezes and slowdowns, the ad eventually plays and then the content resumes.

Possible fix

No response

Steps to reproduce

You can reproduce it with the latest version of the plugin.video.skyott addon (notice that this addon works only on android devices) and a free peacocktv account.

In the addon settings turn on the option "commercial breaks". Turn off the options to modify the manifest and improved subtitles.

The manifest and the log I attach are from the TV show "Pitch Perfect: Bumper in Berlin", episode 1x1. An ad should appear in the 21:00 minute.

Debug log

https://paste.kodi.tv/olatojiraj.kodi

Stream manifest file(s)

manifest.txt

Additional info

No response

Operating system(s)

Android

Operating system version(s)

Any android

InputStream Adaptive version(s)

21.4.9

Kodi version(s)

21.0

tmm1 commented 1 month ago

I've seen this behavior with live stream. Could be similar. cc #1175 #1540 #1541

CastagnaIT commented 1 month ago

free peacocktv account

i tried to create an account to test but it allow me to create only a payment account and not free

from the log periods seem switched in right way

2024-06-02 00:37:27.995 T:25473 warning : ActiveAE - large audio sync error: 3430.611635

large asyncs sometimes happen with ads periods when they have different pts on packages, the most worrying thing is many android errors like these

2024-06-02 00:37:24.488 T:25692   error <general>: CDVDAudioCodecAndroidMediaCodec::Decode ExceptionCheck
2024-06-02 00:37:24.495 T:25687   error <general>: CDVDVideoCodecAndroidMediaCodec::AddData error

and i have no idea the reasons, some details about this should be shown in the android logcat, it might give some more insight

Paco8 commented 1 month ago

free peacocktv account

i tried to create an account to test but it allow me to create only a payment account and not free

Unless they changed something, you don't need to subscribe to any plan. Just by registering you should able to play some movies and TV shows. That's the account I have. Whenever I login there's a huge banner remembering me to subscribe to a plan, but if I click in "Watch peacock" at the top I can finally enter in the website.

CastagnaIT commented 1 month ago

if website address is right www.peacocktv.com when i try make a registration it force me to select one payment plan immagine no free option

Paco8 commented 4 weeks ago

I've just sent you to your email my login credentials.

CastagnaIT commented 4 weeks ago

thank you i will try make an attempt next days

CastagnaIT commented 4 weeks ago

i made a first test and i can confirm that there are some kind of problems manifest_1718004982.txt kodi.log on a my old android box ads are viewed correctly from playback start (first 2 periods), but after that when starts to play the encrypted period/chapter start the problems, black screen and infinite errors like these:

2024-06-10 09:37:31.657 T:8155    debug <general>: CDVDVideoCodecAndroidMediaCodec::AddData current state (2)
2024-06-10 09:37:31.735 T:8155    error <general>: CDVDVideoCodecAndroidMediaCodec::GetPicture dequeueInputBuffer failed
2024-06-10 09:37:31.737 T:8155    error <general>: CDVDVideoCodecAndroidMediaCodec:GetOutputPicture dequeueOutputBuffer failed
2024-06-10 09:37:31.737 T:8155    error <general>: CDVDVideoCodecAndroidMediaCodec::GetPicture dequeueInputBuffer failed
2024-06-10 09:37:31.739 T:8155    error <general>: CDVDVideoCodecAndroidMediaCodec:GetOutputPicture dequeueOutputBuffer failed

this sound like as there is some bad decoding problem, but idk exactly... android logcat unfurmately dont provide info that help me, and replicate the same long list of kodi errors:

--------- beginning of main
06-10 11:12:58.022  7236  7339 E Kodi    : 2024-06-10 11:12:58.022 T:7339    error <general>: CDVDVideoCodecAndroidMediaCodec::GetPicture dequeueInputBuffer failed
06-10 11:12:58.024  7236  7339 W System.err: java.lang.IllegalStateException
06-10 11:12:58.024  7236  7339 W System.err:    at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
06-10 11:12:58.024  7236  7339 W System.err:    at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2698)
06-10 11:12:58.024  7236  7339 E Kodi    : 2024-06-10 11:12:58.024 T:7339    error <general>: CDVDVideoCodecAndroidMediaCodec:GetOutputPicture dequeueOutputBuffer failed
06-10 11:12:58.026  7236  7339 W System.err: java.lang.IllegalStateException
06-10 11:12:58.026  7236  7339 W System.err:    at android.media.MediaCodec.native_dequeueInputBuffer(Native Method)
06-10 11:12:58.026  7236  7339 W System.err:    at android.media.MediaCodec.dequeueInputBuffer(MediaCodec.java:2635)
06-10 11:12:58.026  7236  7339 E Kodi    : 2024-06-10 11:12:58.026 T:7339    error <general>: CDVDVideoCodecAndroidMediaCodec::GetPicture dequeueInputBuffer failed
06-10 11:12:58.028  7236  7339 W System.err: java.lang.IllegalStateException

atm i have no ideas on how to investigate this i will try test it also on my shield device to see if there are some differences that can give some cue

Paco8 commented 3 weeks ago

The ads themselves are not encrypted. When they appear before the video, they play correctly, and the transition to the encrypted content is seamless. The problem happens when ads are inserted in the middle of encrypted content. Is it possible that Kodi is trying to use an incorrect codec or attempting to decrypt a stream that is actually unencrypted?

KB1RD commented 3 weeks ago

I see this issue with the Pluto TV addon as well. Ads and the video segements after it regularly freeze and crash (stop playing and go to home screen) when transitioning. With Pluto TV, subsequent ads also stutter and freeze. Fortunately, the Pluto TV addon is free, so it might be easier to test. I have tried multiple devices, and I see this issue on every LibreELEC (Nexus) device that I try. I do not see it on an android tablet. I also notice that when it freezes, CPU jumps up to 100%.

I am able to nearly fix this issue by setting the stream selection type to "Manual OSD." There is sometimes a stutter, but it mostly doesn't freeze anymore.

CastagnaIT commented 3 weeks ago

on Pluto TV the problem is caused by the video provider itself that send malformed manifests, it has already been widely discussed on already closed issues and workarounds are provided to mitigate the provider problem