-
-
Notifications
You must be signed in to change notification settings - Fork 12
Playback issues (skips in the video) of some streams #4
Comments
This issue has been documented already for Retrospect (retrospect-addon/plugin.video.retrospect#1089) and in Kodi (xbmc/xbmc#16003). |
On Kodi 18 and older, and Raspberry Pi 3 and older, you can workaround this problem by enabling Allow hardware acceleration » OMXPlayer in the settings at Settings » Player » Videos » Processing. This will not fix all issues, but it makes watching the streams more enjoyable. |
The OMXPlayer workaround is implemented in the add-on. So this ought to work better out of the box on Raspberry Pi 3 and older, using Kodi v18 (Leia). |
Okay, maybe this is all nothing new, but I'll document it here for completeness :) I've used http://inspectstream.theoplayer.com/ to check the HLS stream of the first episode of De Mol, season 7. This list of things that are wrong is extensive, but what rings a bell is:
I've remember reading somewhere that Kodi had only a buffer of 8 seconds. That's not enough for this. |
@michaelarnauts That is a great find! It would also mean that selecting the 400kbps stream would not have issues, while the others do have issues. And lo and behold, if I select a maximum bitrate of 500kbps (in Retrospect), it plays without delays. As soon as I move it to max 1Mbps, the issue starts to appear again. Using OMXPlayer I have no issues with this episode! So I currently see no issues on the VIER-VIJF-ZES add-on because it enables OMXPlayer by default. So we should look into why OMXPlayer works fine (just like the web player) and how Kodi can handle this issue better. It is possible. |
@michaelarnauts I am convinced that you have found the cause of this problem. So, I can confirm that the problem is related to a crappy HLS encoder/segmenter that outputs segments with large delays between the video and the audio streams. Kodi VideoPlayer has indeed only a time buffer of 8 seconds, so Kodi cannot play HLS-segments with an audio stream that is shifted more than 8 seconds from the video stream. I investigated this problem using a small script and found out that increasing the VideoPlayer queue to 10 seconds can already solve this problem for De Dag, episode 3. I didn't investigate other programs yet. Here is a list with possible timecodes where this problem should occur for De Dag, episode 3:
Please report if all timecodes are correct. |
Okay, long text, but bear with me in this one. TLDR: There are two issues, one with the 8 second buffer that isn't large enough in some cases, and one with the HLS processing that causes Kodi to jump around trying to fix itself. I'm using De Mol S07E01 as example, since the issue there happens already in the first segment, URLs that are currently valid, but I don't know for how long. I guess they don't expire that fast.
The first segment contains the video for the first 19 seconds and audio for the first 10 seconds. The audio for the last 9 seconds of video in I think there is also a problem that Kodi doesn't process the 2nd segment until it's finished with the current segment, but only in a HLS context. When playing trough the addon, after the first 10 seconds, Kodi notices that there is no audio in the buffer to be seen, and tries to fix things, I guess by seeking to some known point (maybe the next keyframe?). This point happens to be exactly the start of the next segment, so maybe it just skips the current segment when this happens. Okay, now when I only play segment0.ts, trough the file browser, Kodi plays it fine untill the end (19 seconds), although of course, the audio drops out at 10 seconds. This seems to indicate that the video player can actually continue without sound. Next thing, I just concatinate the two files ( This 1.5 seconds is the time needed for additional audio frames to enter the buffer (8 seconds kodi buffer + 1.5 seconds = 9.5 seconds a/v out of sync). The math adds up, and I'm also quite certain that increasing the 8 seconds buffer is a valid fix in this case. But one thing still doesn't make sense. When playing this combined file, Kodi continues normally, with the 1.5 second silence, but it doesn't start seeking. This seem to indicate that there is code that is only executed during HLS processing, that causes the stream to fix. This code is also an issue. If it wouldn't start jumping around, this 1.5 second of sound mute is not so much of an issue (I mean, it is, but at least you can watch the program). I hope this all makes sense, and it might help somebody else out who knows more about the Kodi internals on this. Note: When you combine the ts files with ffmpeg ( |
(Renamed the title since it's not limited to ARM devices) |
I just did the same test. The silence gap of 1.5 seconds is caused by the empty time buffer. I compiled Kodi 19 with an increased VideoPlayer queue of 10 seconds and the concatenated .ts file just plays flawlessly. |
I proposed our fix upstream to Kodi here: xbmc/xbmc#17646 |
I understand this issue is not related to the plugin as such, but I've always had this issue and now still on matrix. It's sooo annoying on everything I play from goplay.. |
Yes, the workaround is in here: xbmc/xbmc#17646 There is a solution described that needs implementing to get fixed. |
Thanks for the reference (and all your efforts btw), i can see your proposed solution to increase the cache, but what is the workaround exactly except having to compile it with those changes |
@rottweilerken The discussion that followed tries to explain what is needed to have my change merged, but it appears that more people are confused about what exactly is needed. That may be Kodi's biggest problem. It needs better documented or refactored code in order to get more people involved. |
Does everyone has these issues with all programs? Because I only notice these issues during 'De Mol': video stops, but audio keeps going, after some seconds video is back ok. We also watch 'Container Cup' and 'Blind Gekocht', these episodes are playing perfect, without any issues. I'm running Kodi on a Pi3B+ |
Yes, I’m also having these issues since a very long time. It’s worse than you describe since sometimes the playback jumps all the way back to the beginning (happened 3 times during the last episode of ‘de mol’ for example). I sincerely hoped Matrix would solve it, but it did not. Anyway, I think you’re doing great work and I understand from the discussions it’s not up to you to fix it. By the way, I think we also have these issues with other programs such as ‘blind getrouwd’ but I must admit I’m not sure. I’ll try to pay attention. I’m running Matrix (libreelec) on RPI 4b. |
CVideoPlayerVideo CVideoPlayerAudio |
Same problem here on Libreelec 10 for pineH64 during "De Slimste Mens S16-Afl.1". I will try to recompile LE with the kodi patch from @peak3d. |
Some streams run in a loop, or are having other issues.
This issue can be used to keep track of those streams, so we know which one to test, and to come up with a solution.
A few examples, although almost every video is affected multiple times:
The text was updated successfully, but these errors were encountered: