Video stutter 25Hz Videoplayback with Hardwaredecoding Libreelec 9.0

  • All videos (24fps, 30fps and 60fps) are playing fine, only files with 25fps are stuttering since libreelec 9.0


    If there are overlays like when skipping back, media info, or if i activate debugging with an overlay in the upper left corner, the stuttering is gone.


    Also if i switch to software decoding the stutter is gone.


    With libreelec 8.2.5 and older everything works fine.


    I'm running libreelec on NUC DN2820FYKH

  • I got the same problem and would have thought it was just in my case


    It stutters randomly only with mpeg2 content at 25fps (dvd, mkv etc) if i pause the playback and resume the stutter is gone for a while


    evil77 you need to provide full log files, otherwise the devs here can't help you

  • Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem.

    Note: Full logs only. No partial or modified logs.

    Do not post your logs directly into the forum, use pastebin.com and post the link.
  • DaVu   Klojum


    Here is my log but i have to agree with the op that if you enable debugging the stutter is gone! Weird!


    After i disabled logging the dvd starts to stutter again, so i have no clue.


    ps i'm not trying hijacking this thread if anyone think in that direction, but it is a weird problem i would have thought i was the only one and did not report it jet.

  • I think the log will not provide any answers because while logging with overlay it does not stutter


    Here is my log:


  • Here is a second log, this time i put in

    Code
    1. <advancedsettings>
    2. <loglevel>1</loglevel> <!-- Change this to "1" to hide the on-screen debug log text -->
    3. </advancedsettings>


    that means no overlay while video-playback, and my 25fps video stutters.

    The feeling is that at least every second frame is not displayed or delayed.


    Since displayrefresh rate is 50Hz i can't be shure which of two possibilitys happens.

    possibility a) every second frame of the videofile is droped, that means on a 50Hz display refreshrate i get a new picture every 4 frames.

    possibility b) the frames are not evenly distributed to be shown every two frames, instead this could be happening:

    videoframe 1 is schown on refreshrateframe 1

    videoframe 2 is schown on refreshrateframe 2, 3 and 4

    videoframe 3 is schown on refreshrateframe 5

    videoframe 4 is schown on refreshrateframe 6, 7 and 8

    videoframe 5 is schown on refreshrateframe 9

    and so on.





  • I tried to show this problem to a friend yesterday, using some test videos (see link in post of CvH here). We even tried a fresh installation of LibreELEC 9, without any addons and with only necessary setup changes.


    We found out that the problem is even worse!


    It does not only stutter when playing 25fps videos with hardware decoding enabled, it also stutters with hardware decoding disabled or with 50fps videos!


    The only difference: With a 25fps video and hardware decoding enabled, it starts to stutter after 1-2 seconds and keeps stuttering until playback is stopped or an overlay is activated. So you can easily see it. With a 50fps video or with hardware decoding disabled, everything looks fine at first. But if you wait long enough, it starts to stutter for a few seconds from time to time. It does not stutter immediately and not all the time. When not using a special test video but a normal video, you may not always notice this.


    To me the stutter looks like there is something wrong with the frame buffer switching. Like, if decoding the next frame was very "fast", switching the frame buffers (to display the next frame) is done at a wrong moment in time. That would explain the difference between hardware decoding enabled or disabled. With hardware decoding enabled the decoding is always "fast"(?) and the buffer switching is done wrong. With hardware decoding disabled the decoding is sometimes "fast" and sometimes "slow", depending on the video and the speed of the CPU, so it sometimes stutters.

  • I'm using the same test videos you do and I can't see any problems with it.


    Make sure you have


    - "sync playback to display" disabled

    - "adjust display refreshrate" is set on "star/stop"

    - matching whitelist options are set. e. g. 1920*1080: 60, 59.94, 50, 30, 29.97, 25, 24, 23.976 (if available)


    If enabled, you don't need the "sync playback to display" option at all. That option is for Kodi on screens which aren't capable of a matching fps (e. g. PC Monitors which tend to support only 60fps). If your TV supports all those fps, the "sync playback to display" option isn't needed anymore.


    If you don't set "adjust display refreshrate" to "start/stop" and leave it on off, then Kodi will use the FPS which is generally set to. Means if you set Kodis GUI to use 60fps, every video will be played at that fps, which could also cause stuttering.

  • jhschulz

    I think the stutter with hardware decoding disabled is due to the slow cpu-performance.

    It is not a bug and it existed also on the previous versions of libreelec and kodi.

    So no reason to complain with hardware decoding disabled.



    DaVu

    Matching refresh rate is missing 25Hz, 29,97Hz and 30Hz.

    Theses are accomplished with framedoubling, so the system uses 50Hz an 60Hz. (nearest match)


    and here goes something wrong, wich worked fine in the previous versions of libreelec or kodi.


    DaVu

    what platform are you using?



    i don't have 30fps material, it would be interesting to find out if it also stutters, if so, it should have something to do with framedoubling.

  • DaVu

    - "sync playback to display" is disabled

    - "adjust display refreshrate" is set on "start/stop"

    - matching whitelist option is set to 1920*1080: 50, 24, 23.976

    - generally setting is 1920*[email protected]


    If I add 25Hz to the whitelist, it is used for 25fps videos (instead of 50Hz), but that does not remove the stutter completely. It looks good at first, but still stutters from time to time. Like with 50fps videos and 50Hz display, as I wrote. (And if I add 25Hz to the whitelist, each time I switch channels in live TV, the display switches from 50Hz to 25Hz and back to 50Hz.)


    evil77

    The stutter with hardware decoding disabled is not due to slow cpu performance. Total cpu usage is below 30% all the time when playing the test videos with hardware decoding disabled.

  • I few days ago I filmed my TV (with a 50fps video camera) to show how the stuttering looks like. See here.


    When looking at the filmed video frame by frame I could see why it stutters. If a 25fps video is played with a 50Hz display rate, the frames of the video should by shown like this:


    1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8


    But instead they are shown like this:


    1 2 2 2 3 4 4 4 5 6 6 6 7 8 8 8


    And when playing a 50fps video (with 50Hz display rate) the frames of the video are played like this:


    1 2 3 4 5 6 7 8 8 9 11 12 13 14 15 16 17 18 18 19 21 22 23 24 25...


    So, first everything is OK, but then one frame (number 8/18/...) is shown twice and then one frame (number 10/20/...) is skipped. This looks like a problem with the video-audio synchronization.


    Does anybody have an idea what could cause this problems and how to fix it? I'm still using LE 9 to be able to do some tests if necessary, but this stuttering makes it nearly unusable.

  • I just wanted to chime in and say I’m having the same issue. It’s frustrating to watch but I think you’re right about the audio and video sync. Something to do with VAAPI as it becomes less apparent if I turn hardware acceleration off.

  • Ok, so I've managed to sort my system out; firstly I changed the Monitor setting from Default to HDMI which allowed more whitelist entries to appear. I then enabled all 1920x1080 whitelist entries (I'm only running a FullHD system with a DN2820 NUC). I then changed the Adjust refresh rate to Always. No more stutter here but YMMV.


    Hope this helps.