-
Notifications
You must be signed in to change notification settings - Fork 238
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
Conversation
This prevents a delay in the video or audio stream on playback start or after seeking
This PR workarounds an issue, it does not hit the root cause. |
I understand. Could you maybe point @rbuehlma to the actual issue? He might be able to come up with a fix then. |
Can someone pls. provide (link) a debug log here? |
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. |
Hi @peak3d do you have any news on this one? Unfortunately, the issue is still there. |
@rbuehlma I can confirm this issue. |
efa4a86
to
a5b1fab
Compare
@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. |
@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. |
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. |
@rbuehlma can you pls. provide some steps for reproduction? Is maybe a .strm file already enough? |
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. |
@mafiwa2167 Can you try to create a .strm file with one of the not working streams pls?
|
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. |
@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 :-) |
Thanks for taking the time to look into it. |
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. |
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. |
@mafiwa2167 your seek issues should be better now with the latest commits in master branch. |
@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. |
@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) |
@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. |
@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? |
Closing this PR since audio delay on channel startup and seek seems to be gone. Thank you |
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.