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

Only the part after the last advertisement is played. #8

Closed
michaelarnauts opened this issue Jul 6, 2019 · 29 comments
Closed

Only the part after the last advertisement is played. #8

michaelarnauts opened this issue Jul 6, 2019 · 29 comments
Labels
bug Something isn't working inputstream-adaptive This bug needs a fix in InputStream Adaptive. released A fix for this issue has been merged by upstream
Milestone

Comments

@michaelarnauts
Copy link
Collaborator

Some programs like "Wat Als?" season 3, don't start in the beginning, but it seems like they start from the point after the first commercial break.

@michaelarnauts michaelarnauts added the bug Something isn't working label Jul 6, 2019
@dagwieers
Copy link
Collaborator

dagwieers commented Jul 7, 2019

I noticed the same thing, need to look into the streams. We need to log more information to make that easier (not just for us, but also for users to troubleshoot and fix things for us).

It appears Kids shows are not affected, as well as possibly TV shows with short episodes (less than 20 minutes?).

@michaelarnauts
Copy link
Collaborator Author

I've troubleshooted this a bit further. It seems that the dash manifest that anvato returns has multiple Periods. Every Period is a part of the stream, and the ads also seem to be a Period, so this means that this addon wil also play the ads.

The big issue is that inputstream.adaptive doesn't seem to support Periods, and according to their README.md, they only play the first Period, but I guess they are currently playing the last one.

This is probably the reason why the last part of the program is playing and I guess this is also why the full stream length is unknown.

@michaelarnauts
Copy link
Collaborator Author

I've opened xbmc/inputstream.adaptive#287 for this.

@dagwieers
Copy link
Collaborator

dagwieers commented Jul 8, 2019

While trying some other episodes. The last episode of Married with children (S09E22) plays fine. Starts with the intro, subtitles play fine. And for some reason it lists 2 subtitles, one selected by default with a unique name, and then Dutch (I guess this was added using addStreamInfo()).

Some other episodes play nice as well (some have subtitles integrated in the stream, i.e. S09E21 was cut from CAZ). But from the same season there are episodes that have the same issue. It is weird that in a single season you have a myriad of streams.

@michaelarnauts michaelarnauts changed the title Programs aren't started in the beginning Programs aren't started at the beginning Jul 9, 2019
@michaelarnauts
Copy link
Collaborator Author

The manifest of "Married with children (S09E22)" seems to contain an embedded dutch subtitle (that's what kodi detects), but it seems it have no content. The VTT seems to be fine however. I'm not sure why it plays at the beginning, since it also seems to contain Periods.

@mediaminister
Copy link
Contributor

Look at the Period duration, inputstream.adaptive always plays the last period. For Married with children (S09E22) the last Period is 22 minutes, the duration of a full episode. First and second period is 10 seconds and 3 seconds long. This is a Coca-Cola commercial and a VTM GO banner.

@michaelarnauts
Copy link
Collaborator Author

Okay. Makes sense. I'm also wondering how this should be handled. Should all periods be merged into one stream? I assume the vtt subtitle position is depending on the episode, and the duration of the ads aren't taken into account in the subtitle timings.

@mediaminister
Copy link
Contributor

mediaminister commented Jul 10, 2019

For the end user it should look like one continuous stream, so all periods should be played in succession. You can find more info about Periods is in the DASH-IF guidelines: https://dashif.org/guidelines/

Currently, I have no clue how to implement this in inputstream.adaptive.
The combination of advertisements and subtitles does not seem easy to implement because this is not part of the MPEG-DASH manifest. VTM GO (Anvato streaming platform) uses a separate json for add cues. We can't add non-standard functionality to inputstream.adaptive, so controlling subtitles in combination with adds should be handled in the add-on itself.

@michaelarnauts
Copy link
Collaborator Author

You are right. The VTM GO app probably knows what periods contain the real episode, and adapts the timing of the subtitle to this. We should probably rewrite the vtt ourselves based on the cues.

@michaelarnauts michaelarnauts changed the title Programs aren't started at the beginning Inputstream Adaptive: Periods are not supported Jul 26, 2019
@michaelarnauts michaelarnauts added this to the Release 1.0 milestone Aug 5, 2019
@michaelarnauts michaelarnauts added the inputstream-adaptive This bug needs a fix in InputStream Adaptive. label Aug 5, 2019
@michaelarnauts michaelarnauts changed the title Inputstream Adaptive: Periods are not supported Only the part after the last advertisement is played. Aug 5, 2019
@Forceflow
Copy link

Forceflow commented Sep 4, 2019

Trying to understand this blocking issue:

  • Are all periods listed in the MPD file? (as in: are they all known before streaming commences)
  • Is there some logic to which periods are Widevine-protected and which aren't? I'm guessing program content has protection, and ads don't?
  • Would a very ugly fix be to parse the MPD file, and list the larger periods (as in: the ones which most likely aren't ads due to their length) as individual kodi media items? So you would end up with FooProgramName (part 1), FooProgramName (part2), etc ... ?

@mediaminister
Copy link
Contributor

mediaminister commented Sep 4, 2019

Are all periods listed in the MPD file?

Yes. vtmvod.txt

Is there some logic to which periods are Widevine-protected and which aren't?

Yes, each individual Representation in a Period has a ContentProtection tag

Would a very ugly fix be to parse the MPD file, and list the larger periods (as in: the ones which most likely aren't ads due to their length) as individual kodi media items? So you would end up with FooProgramName (part 1), FooProgramName (part2), etc ... ?

This can only be done in InputStream Adaptive add-on because all video and audio streams are segmented and each individual segment is encrypted: xbmc/inputstream.adaptive#287

@dagwieers
Copy link
Collaborator

With the latest master branch of inputstream.adaptive everything in VTM GO plays fine, including the commercials.

The known issues at this point are:

  • subtitles continue through commercials and so the offset is wrong because of commercials
  • during a transition from one period to the next (usually when switching from and to commercials) the video stalls briefly, and when video continues, the audio is gone briefly
  • proper chapter support for streams is part of Kodi 19 (Matrix) and hopefully we will also get a python interface so we can add chapter support for TV shows in VRT NU as well (so you can jump from topic to topic in a Het Journaal, or De 7de Dag)

So very good news. I think we are very close to releasing VTM GO when the new inputstream.adaptive hits all Kodi 18 platforms, even with the above shortcomings.

@michaelarnauts
Copy link
Collaborator Author

I agree. Subtitles is not critical to block the first release.

@dagwieers
Copy link
Collaborator

Only blocker is Linux/arm support at the moment. (LibreELEC and others)

@dagwieers dagwieers added the fixed A fix is available upstream but not yet released label Sep 9, 2019
@dagwieers dagwieers pinned this issue Sep 9, 2019
@peno64
Copy link

peno64 commented Sep 10, 2019

I tried this on windows x64 with the latest kodi 19 and inputstream.adaptive 2.5.0 and I still doesn't start from the beginning...

@mediaminister
Copy link
Contributor

@peno64 The fix is not yet released and is only available from the master branch: https://jenkins.kodi.tv/blue/organizations/jenkins/peak3d%2Finputstream.adaptive/detail/master/110/artifacts

@peno64
Copy link

peno64 commented Sep 10, 2019

@mediaminister hm, that is a 2.4.0 version and I already have a 2.5.0 version installed. I will wait until it is officially released...

@dagwieers
Copy link
Collaborator

@peno64 I agree it is pretty confusing that the automated builds have a lower version than what is available on your system. On LibreELEC we still have inputstream.adaptive 2.3.22. We are still waiting for VRT NU on a release for something that was fixed 4 months ago...

@peno64
Copy link

peno64 commented Sep 22, 2019

Totday an update of inputstream.adpative was released on the raspberry pi. It is now version 2.4.2.1. I also installed the latest vtm go plugin from release (plugin.video.vtm.go-0.9.0-master-05ebfc8.zip). But still it does not start from the beginning. The subtitles start from the beginning, but the movie not...
And to be sure, I did a reboot of the pi. So the problem still seems to be there. I tried with the movie I, Frankenstein

@peno64
Copy link

peno64 commented Sep 22, 2019

Or is the 2.5 version of inputstream adaptive needed for this to work?

@mediaminister
Copy link
Contributor

The fix is not yet released for RPi, you have to build the inputstream adaptive master branch yourself to make it work!

If you can't build this yourself, there are compiled versions available for a limited set of platforms at https://jenkins.kodi.tv/blue/organizations/jenkins/peak3d%2Finputstream.adaptive/detail/master/112/artifacts

@peno64
Copy link

peno64 commented Sep 22, 2019

Unfortunately the jenkins site does not have a rpi version.
Do you know where to find the instructions to build it myself for the rpi?

@mediaminister
Copy link
Contributor

Okay, it seems rather easy to cross compile this from a Linux pc. You need Raspberry Pi tools and firmware: https://github.com/xbmc/xbmc/blob/master/docs/README.RaspberryPi.md

And this are standard instructions to compile Inputstream Adaptive for Kodi 18 Leia:

git clone -b Leia https://github.com/xbmc/xbmc.git
git clone https://github.com/peak3d/inputstream.adaptive
cd ~/inputstream.adaptive && mkdir build && cd build
cmake -DADDONS_TO_BUILD=inputstream.adaptive -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
make
cd ~/xbmc/addons/
zip -r inputstream.adaptive.zip inputstream.adaptive

I will try this myself and come up with detailed instructions and a test zip for RPi if this works out.

@peno64
Copy link

peno64 commented Sep 22, 2019

@mediaminister
I followed your instructions on a raspberian system on my pi4 and succeeded in generating the inputstream adaptive addon without any errors.
Then I could successfully the generated addon on that pi4 booted with libreelec.
Then when I start a vtm go program which has commercials it now starts with a commercial and then it wants to start the beginning of the program so that is good, but then it either stops working or it starts again with the commercial getting into a loop...
I have to try if something else like vrt.nu or retrospect is still working but can't do this at this moment. Will let know if that still works

@peno64
Copy link

peno64 commented Sep 22, 2019

So I tried this again. When I just play something, for example I Frankenstein, then it starts with a commercial and then it shows a VTM Go advertise and then it wants to play the movie but after a couple of seconds it restarts and plays the commercial again and so on and on.
However if I press pause just at the moment that the movie starts and I wait a couple of seconds and then continue then the movie plays...
Note that scrolling foreward now also works which proofs I do use the latest inputstream adaptive.
Playing a kids program without commercial from vtm go (kabouter plop) or something from the addons retrospect or vrt.nu (het journaal) plays without a problem with this latest inputstream adaptive.
I should now try to run that movie from vtm go with the pause so that it continues and see what happens when it reaches the next commercial break...

@peno64
Copy link

peno64 commented Sep 22, 2019

Ok, so I tried this with the series "locked up". Same scenario. It starts with a commercial and then when the movie starts it restarts. But if i pause for a couple of seconds and then continue it starts to play and then I let it play until the commercial and after the commercial it just continues to play.
So the problem is only at the start of the movie. But the pause work-around is a small trick that solves this problem. Nobody else having this problem?

@michaelarnauts
Copy link
Collaborator Author

@peno64 on Windows and Linux x64, it seems to work fine. I haven't tested yet on arm.

@peno64
Copy link

peno64 commented Sep 28, 2019

​I compiled the latest inputstream.adaptive for libreelec on raspberry pi myself.
You can find it here: http://users.telenet.be/peno/kodi/addons/inputstream.adaptive/

Note that this version is 2.4.0

And believe me, that is the latest version. So make sure that your addons aren't updated automatically or it will be overwritten by an auto update of the kodi addons​

@michaelarnauts
Copy link
Collaborator Author

I've bundled all inputstream.adaptive issues that are already fixed upstream, but not yet released in issue #101.

@michaelarnauts michaelarnauts unpinned this issue Oct 12, 2019
@dagwieers dagwieers added released A fix for this issue has been merged by upstream and removed fixed A fix is available upstream but not yet released labels May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working inputstream-adaptive This bug needs a fix in InputStream Adaptive. released A fix for this issue has been merged by upstream
Projects
None yet
Development

No branches or pull requests

5 participants