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

Align streams after opening and seeking #133

Closed
wants to merge 1 commit into from

Conversation

rbuehlma
Copy link
Contributor

This prevents a delay in the video or audio stream on playback start or after seeking

The issue is discussed here:
https://www.kodinerds.net/index.php/Thread/58635-PVR-Addon-f%C3%BCr-Zattoo-und-Reseller/?postID=454271#post454271

Is this a good way to solve this issue? Should it be possible to enable/disable this aligning in the settings?

While testing with Zattoo, this patch solved the issue and the stream start time was only marginally longer if noticeable at all.

This prevents a delay in the video or audio stream on playback start or after seeking
@quthla
Copy link

quthla commented Jul 10, 2018

@peak3d is this pr faulty?

I have the same delay @rbuehlma describes. It's not that big of an issue actually but if there's a fix available already then why not.

@peak3d
Copy link
Contributor

peak3d commented Jul 11, 2018

This PR workarounds an issue, it does not hit the root cause.

@quthla
Copy link

quthla commented Jul 11, 2018

I understand. Could you maybe point @rbuehlma to the actual issue? He might be able to come up with a fix then.

@peak3d
Copy link
Contributor

peak3d commented Jul 11, 2018

Can someone pls. provide (link) a debug log here?

@rbuehlma
Copy link
Contributor Author

Here you are:

https://gist.github.com/rbuehlma/f73d2c663e80a9439269ab2f6146f4e6

The log starts just before selecting the channel. In this case, the audio had a delay of about 2 seconds compared to the video stream.

@rbuehlma
Copy link
Contributor Author

Hi @peak3d do you have any news on this one? Unfortunately, the issue is still there.
Just to be clear:
Its only about the audio starting 1-3 seconds after the video. As soon as the audio is there, it is in sync with the video.

@dagwieers
Copy link
Contributor

@rbuehlma I can confirm this issue.

@mafiwa2167
Copy link

@rbuehlma Maybe it's time to close this pr. @peak3d has no interest in fixing this because it doesn't concern him. It's his software so we should just accept his decision.

@basrieter
Copy link

@mafiwa2167 I really think you should change your attitude!

Many of the Kodi Devs do essential work to the product and related add-ons. However, we have not been cloned so there is only one of each of us to do work. And sometimes we prioritize other things. Without @peak3d there would not be a lot of online streaming at all. So keep your negativity to your self.

@mafiwa2167
Copy link

@basrieter Funny you consider yourself a "Kodi Dev" because you're the developer of an addon but that's off topic

I did not mean to be negative or disrespectful in any way. As I said, it's @peak3d's software so he can do whatever he want's with it and if he has no interest in fixing this, then we must accept that and be thankful for all the work he put into the addon and that he shares it with us for free.

I wasn't even complaining or anything so please stop putting words in my mouth.

@rbuehlma
Copy link
Contributor Author

While this change does fix the (minor) issue for me, it most probably is not the right way to solve it and probably more of a workaround. The idea of this PR is to help @peak3d to find a proper way of solving the issue.
Since the issue is not yet solved, there is no point of closing it from my side and probably the only one else allowed to do so, is @peak3d. Since he did not do it yet, there is still hope ;)

@peak3d
Copy link
Contributor

peak3d commented Nov 19, 2019

@rbuehlma can you pls. provide some steps for reproduction? Is maybe a .strm file already enough?
Or do I need to install one of your zattoo addons? If so, which one?

@mafiwa2167
Copy link

mafiwa2167 commented Nov 19, 2019

You can use any stream hosted on nxload.com (hls) for example. Only to reproduce it as the audio sync issue is very much noticeable there.

That will also reveal an even bigger issue that the addon can lose the audio stream due to seeking and then the video stream starts to skip randomly by itself. If you get lucky, the audio might come back after a few skips but it also happens that the stream needs to be completely restarted.

@peak3d
Copy link
Contributor

peak3d commented Nov 19, 2019

@mafiwa2167 Can you try to create a .strm file with one of the not working streams pls?
Or does it need auth tokens when requesting it?

#KODIPROP:inputstreamaddon=inputstream.adaptive
#KODIPROP:inputstream.adaptive.manifest_type=hls
[HLS master playlist URL]

@mafiwa2167
Copy link

mafiwa2167 commented Nov 19, 2019

Unfortunately this is the only example I could find right now. Usually I don't approve this kind of stuff and neither do you I guess but at least it's a safe and easy way to reproduce the audio sync issue and also the random stream skipping with no audio issue I mentioned before.

You'll probably know how to get the m3u8 via the network inspector. I think there's something like a session id in the URL else I'd get it for you.

As soon as you skip you'll notice either the video or audio is delayed by up to 10 secs or the audio stops playing and Kodi skips the stream by itself by about 20 secs.

You can delete this commend after you saw the link.

@peak3d
Copy link
Contributor

peak3d commented Nov 19, 2019

@mafiwa2167 inputstream.adaptive cannot handle mkv files. Seems that you arrived another issue, which should be placed in forum.kodi.tv

Edit: misread what you wrote, sry, nvm my post :-)

@mafiwa2167
Copy link

Thanks for taking the time to look into it.
Have you been able to reproduce the aforementioned issues with the example provided?

@peak3d
Copy link
Contributor

peak3d commented Nov 19, 2019

Just looked into the streams, issue is that video segment 1 is declared as 20s. duration, but has in reality 25 seconds included. This affects all subsequent segments leads to the fact, that seeking / starting at a position > 0 shows the described behaviour.
I'll look if something can be changed here, but its quite clear that the hls is not correct written.

@mafiwa2167
Copy link

Good to know. I wasn't aware of that. At least in Chrome and Firefox there are no issues at all with seeking. Audio and video will start with no delay right away from any seek position. Not sure though how they make it work in spite of the broken hls / segment lengths.

@peak3d
Copy link
Contributor

peak3d commented Nov 21, 2019

@mafiwa2167 your seek issues should be better now with the latest commits in master branch.
Same for @rbuehlma, but only seeking seems fine now for me, startup is a different issue I'll have to look for separately.

@mafiwa2167
Copy link

mafiwa2167 commented Nov 22, 2019

@peak3d Yes, no more issues there. I'm not sure if this is related to any of the previous now fixed issues, but inputstream won't even start playing this file at all

https://jetload.net/p/vcxtgL6JTvdW (BigBuckBunny)

If it's not related, I can open a new issue.

@peak3d
Copy link
Contributor

peak3d commented Nov 22, 2019

if it's not related, I can open a new issue.

@mafiwa2167 inputstream.adaptive is only capable playing master playlists, which contain multiple sub-playlists. The one you linked seems to ba a normal playlist and should be played with ffmpeg (not using inputstream.adaptive)

@mafiwa2167
Copy link

@peak3d Sorry for the false alarm then. Even without inputstream.adaptive Kodi is not playing it but guess there's no point reporting it at the Kodi repo when ffmpeg is the cause.

@rbuehlma
Copy link
Contributor Author

@peak3d thank you very much. Seeking is indeed great now. Would be great if the startup works equally :) And would it be possible to cherry-pick the change to Leia branch or is the diff already too big?

@rbuehlma
Copy link
Contributor Author

Closing this PR since audio delay on channel startup and seek seems to be gone. Thank you

@rbuehlma rbuehlma closed this Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants