xbmc / inputstream.adaptive

kodi inputstream addon for several manifest types
Other
452 stars 241 forks source link

NAL Unit exceeds subsample definition #208

Closed matthuisman closed 5 years ago

matthuisman commented 5 years ago

Hi @peak3d

3 out of 4 streams work with this provider.

But one stream errors with a bunch of 'NAL Unit exceeds subsample definition'. I have tried the stream via their official Android app (exoplayer) and it does playback (using same MPD file & Widevine license).

Using KODI RC1 Windows 64bit

Let me know if you need a live test stream and I can sort for you

matthuisman commented 5 years ago

Looks like this NAL Unit error is happening on all streams on Android.

matthuisman commented 5 years ago

@peak3d Seems this is popping up with some other add-ons now as well.

Any ideas? Did you want me to get you a test stream?

peak3d commented 5 years ago

@matthuisman pls. download the video init.m42 and the m4s file where the issues start

in the log above: https://neunlds638oc.akamaized.net/nlds/skysportsfanpass/drm_sky1/as/live/nlncp/drm_sky1_hd_1600_video/Time=init.m4s and https://neunlds638oc.akamaized.net/nlds/skysportsfanpass/drm_sky1/as/live/nlncp/drm_sky1_hd_1600_video/Time=1543446998000.m4s

I cannot read from log if audio or video is the issue, so pls. restict in inputstream.adaptive settings to video / audio and look which stream is the bad one.

joshjryan commented 5 years ago

Additional info, for reference: when I see this same error (referenced in https://github.com/maxgalbu/xbmc.plugin.video.nba/issues/87), I hear audio, but no video is displayed. If it's helpful, I can try to also get additional logging sometime today.

cablegoon commented 5 years ago

I am having the same issue on a fire tv and sheild (android tv) with various releases on kodi. Let me know if you want logs from my end too. this happens with the NBA league pass app

micahg commented 5 years ago

I get this too with my sportsnet addon. It works on Ubuntu (64bit) but fails on my Android machines. Please let me know if I can assist.

joshjryan commented 5 years ago

Note: I am still seeing the same issue with RC3.

Lakersfan16 commented 5 years ago

@cablegoon @joshjryan Any solutions for the only Audio problem yet?

UniqueSports commented 5 years ago

We have the same audio only issue on Android devices (checked on a mobile and an NVIDIA SHIELD). Our source is same as the NBA league pass app. Can provide logs and the video chunks in question if interested.

@matthuisman You might wanna remove sensitive info such as tokens from the logs before posting them publicly.

ivankokan commented 5 years ago

Hi @peak3d, I have been comparing implementations of WV_CencSingleSampleDecrypter::DecryptSampleData under all three wvdecrypter*.cpp files, and noticed some differences at the methods' beginnings. Are these intentional, are they maybe the root cause of "audio+ video-" issue on Android TVs?

joshjryan commented 5 years ago

If helpful, here are the logs from when I receive the "NAL Unit exceeds subsample definition" error: http://paste.kodi.tv/ijeqojuduy

lyossy commented 5 years ago

hey guys for those of you who are able to compile kodi , I've discovered a patch that seems to eliminate this issue . I have not tested it extensively , please test and inform the results . The patch is in the file that outputs the message ( the one that ends in "_jni.cpp" ) and is inserted just before the test the causes the message .
here it is : // bypass all validity tests if packet is complete if (packet_in == packet_in_e )//packet completed ok { data_out.SetDataSize(data_out.GetDataSize() + data_in.GetDataSize() + configSize + (4 - fragInfo.nal_lengthsize) * nalunitcount); return AP4_SUCCESS; }

// old test , do not change this in the original code , just insert the above lines before this test . // as i've modified the old test for debugging , no need to modify original code . if (nalsize + fragInfo.nal_lengthsize + nalunitsum > Clear + Cipher)

lyossy commented 5 years ago

this file is in the wvdecryper folder . If anyone succeeds in building an apk with this patch and it works , please share it .

lyossy commented 5 years ago

for the first time in almost a year , i am able to watch league pass on kodi android . ( denver game ) . I'll update if it survives till the end of the game .

lyossy commented 5 years ago

It did

UniqueSports commented 5 years ago

It did

@lyossy Hey, Nice work!

Do you know how to cross compile the patch on Ubuntu for Android arm devices ?

lyossy commented 5 years ago

kodi themselves have a file called "readme.md" that has instructions compiling on ubuntu 16.04 for all 3 platforms : arm7,arm8,x86 .. google "compiling kodi for android" . I was not able to generate the full apk , as on my setup it reached 99% and failed . I was able to build just the buggy library for arm v7 . It is called "libssd._uv.so" . by replacing this library with the one i built with said patch , i was able to watch streams that previously only played audio .

UniqueSports commented 5 years ago

@lyossy Hey, thanks for the reply. Yes, I was using the guide on https://github.com/xbmc/xbmc/blob/master/docs/README.Android.md

I'm not sure how to generate the apk from the modified local version. I'm not a C++ guy and have even less experience with the kodi development itself.

Did you just target arm7 when building the library itself (not the apk) ?

lyossy commented 5 years ago

hi I initially selected the armv7 enviorment as it runs fine on the other platforms . I am running it on an x86 cheapo chinese tablet and it runs fine .

UniqueSports commented 5 years ago

@lyossy Okay, thanks. I'm going to try it again on an AWS instant since my VPS ran out of space when compiling the build tools.

lyossy commented 5 years ago

first of all i tried to build the apk . this sets up the enviionrment for compiling the addons . later , i just ran the make process in the library folder . I'm not sure if it's allowed , but i can send you a patched apk that i created that includes the patched library .Can somebody comment if this is allowed ? If so , send me a link to a location i can upload to ( file is 62 MB )

lyossy commented 5 years ago

works on mibox 3 ( amlogic s905x androidtv )

Lakersfan16 commented 5 years ago

@lyossy what exactly do I need to change now to get video and audio? (Sorry im new to this)

lyossy commented 5 years ago

are you a programmer or at least proficient in programming ?

Lakersfan16 commented 5 years ago

@lyossy im a bit proficient

lyossy commented 5 years ago

you need to edit a cpp file whose name ends with "_jni.cpp" in the wvdecryper folder . you have to insert the 3 lines of cpp code i posted a few hours ago just before the test that causes the "NAL" error to appear . than , rebuild the kodi apk ( make sure you have rebuilt the addons ) . uninstall your current leia installation and install the apk you built .

Lakersfan16 commented 5 years ago

@lyossy you said earlier you can send us the apk. So is this still the case?

lyossy commented 5 years ago

You must realize that i was not able to build the apk from source , so i modified the existing rc5.2 apk to include my patch . I don't know what is the policy of team kodi regarding distribution of such an apk . If somebody can verify it's ok , and provide an upload link that can host 60+ mb i will upload the apk .

Lakersfan16 commented 5 years ago

I think as long as you dont say that it is an official version it should be alright. https://uploadfiles.io

lyossy commented 5 years ago

Hi Is this a public location ? I prefer sending just to you .

On Fri, Jan 18, 2019, 13:42 Lakersfan16 notifications@github.com wrote:

I think as long as you dont say that it is an official version it should be alright. https://uploadfiles.io

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/peak3d/inputstream.adaptive/issues/208#issuecomment-455519076, or mute the thread https://github.com/notifications/unsubscribe-auth/AsoqEWvAnr2wgQ0nfxsCOw9yo84Ji05sks5vEbMYgaJpZM4Y2amG .

Lakersfan16 commented 5 years ago

@lyossy no its not. You just have to message me the Link that you get after uploading.

lyossy commented 5 years ago

What is your email ?

Lakersfan16 commented 5 years ago

justin.pullmann@gmx.de

lyossy commented 5 years ago

OK , give me a few minutes .

Lakersfan16 commented 5 years ago

@lyossy Thanks man. Appreciate it

lyossy commented 5 years ago

OK , I sent you the link . note that the file will be available for an hour , as I am not sure I'm allowed to share it . Remember you need to uninstall previous Leia installation , otherwise apk will not install ( it is not accepted as an update ) Please inform the forum how it goes .

lyossy commented 5 years ago

You can test it immediately using archived games . also I noted that the league pass add-on is not working well after installation of the add-on . after a reboot it works much better

Lakersfan16 commented 5 years ago

It works perfectly. Thanks man. Finally i can watch the NBA on the big screen. Appreciate your effort. 🐐

lyossy commented 5 years ago

Have fun 😋 Can you specify your device , CPU , android version . Verified on MINIX neo u9 , a logic s912 , regular android 6.0

Lakersfan16 commented 5 years ago

@lyossy Device: Orbsmart S84 CPU: AML S912 Octa Core ARM Cortex-A53 Android 7.1

peak3d commented 5 years ago

Sorry for absense, was anyone able to pull a sample stream (segment) ? Simply look into kodi log, and pick the URL of one downloaded segment (video I guess)

The "fix" provided above will not be accepted until the root cause is clear.

Thx for the work done here!

angus1225 commented 5 years ago

Thanks for the big work!! Don't leave us apart!!

blairhandley commented 5 years ago

Hey @lyossy there could I please have a copy aswell

lyossy commented 5 years ago

Sorry , I am not allowed to distribute it . however , I believe an official solution is coming soon . if you can't wait , you can build the apk yourself . please note that this is just an ad hoc patch , until an official solution is available , and is proven working only on current NBA international league pass . I have no idea if it works with other sources . I did this out of a personal need , and made it public to help fellow lp subscribers . It was not my intention to offend anybody .

UniqueSports commented 5 years ago

@peak3d Here are few chunks form a while back. https://www.mediafire.com/folder/vbtb4z8u84v1y/ this contain a playlist, two init chunks (video) from two different bitrates, one regular video chunk and an audio init chunk.

let me know if you need anything else.

peak3d commented 5 years ago

Thx @UniqueSports , will look today at the issue

matthuisman commented 5 years ago

@peak3d I've also just emailed you some files :)

peak3d commented 5 years ago

I pushed the fix, version is 2.3.13, pls. verify, thx! B.t.w. thx @UniqueSports / @matthuisman for providing sample files!

dwane3 commented 5 years ago

Where is download 2.3.13?

dwane3 commented 5 years ago

peak3d, please update to 2.3.13 version on official repo..