plugin.video.youtube icon indicating copy to clipboard operation
plugin.video.youtube copied to clipboard

Wrong framerate (only through MPEG-DASH)

Open lennartgoosens opened this issue 3 years ago • 0 comments

Context

Please provide any relevant information about your setup

  • Add-on Version: 6.8.20
  • Kodi Versions: 18.9.0 (LibreELEC) / 19.4.0 (Windows)
  • Kodi GUI Language: English
  • Operating Systems: LibreELEC 9.2.6 on Intel x86-64 / Windows 10 Pro version 1909 (build 18363.1556) on Intel x86-64
  • Operating System Language: English (LibreELEC) / Dutch (Windows)

Expected Behavior

Video is started in the right frame rate right away.

(And depending on settings, Kodi can then correctly adjust the refresh rate from the start.)


Current Behavior

Video is started in [frame rate 1] (WRONG), then after 5 seconds switches to [frame rate 2] (RIGHT).

  • 23.976 fps (WRONG) -> 24.000 fps (RIGHT)
  • 29.970 fps (WRONG) -> 30.000 fps (RIGHT)
  • 59.940 fps (WRONG) -> 60.000 fps (RIGHT)

But, NO sudden switch for video that is either actually in one of those fractional frame rates, or 25fps and 50fps. (My wild guess: could this be due to some rounding error, as the NTSC and non-NTSC frame rates are so close?)


For the sake of completeness, how Kodi reacts to this change in frame rate:

  1. it causes the picture to go blank for a moment

and if the option "Adjust display refresh rate" is enabled in Kodi Settings > Player (I have it on "On start"):

  1. it also causes the display to go blank (for far longer at least on my TV) and readjust to a new refresh rate (often after it had just gone blank adjusting to the wrong refresh rate five seconds before), and
  2. usually but not always, it causes the audio to be temporarily interrupted as well.

As a PARTIAL WORKAROUND, turning that option off at least stops (2) and (3) from occurring, but the picture still flickers. Also, turning this off can only be done globally AFAIK, and means looking at judder in half the video's from any source/add-on. So bye bye Vsync...! :(


Steps to Reproduce

  1. Play either a 24fps, 30fps or 60fps video through MPEG-DASH:
  • 30fps: https://www.youtube.com/watch?v=PjOE6qlZ3rU
  • 30fps: https://www.youtube.com/watch?v=dYpu3qW2UdQ
  • 24fps judder test: https://www.youtube.com/watch?v=eQ9pk2SgY9s
  • 30fps judder test: https://www.youtube.com/watch?v=yUeJ3rjDztQ
  • 60fps judder test: https://www.youtube.com/watch?v=WrS2HBLScbc

Press O for Player process info ASAP, after 5 seconds the framerate unexpectedly switches (for instance) from 29.970 fps (WRONG) to 30.000 fps (RIGHT).

  1. Play the same video without MPEG-DASH enabled;

Press O for Player process info ASAP, the framerate is and remains (for instance) 30.000 fps (RIGHT).

  1. (OPTIONAL) Play any of these UNAFFECTED videos through MPEG-DASH:
  • 23.976fps judder test: https://www.youtube.com/watch?v=FLkHN0Pgq50
  • 29.970fps judder test: https://www.youtube.com/watch?v=SG2oKibyrT0
  • 59.940fps judder test: https://www.youtube.com/watch?v=WnGYBUuTsPg
  • 25fps judder test: https://www.youtube.com/watch?v=kpod7SaeZcU
  • 50fps judder test: https://www.youtube.com/watch?v=t8Rtwr70HOc

Press O for Player process info ASAP, the framerate is and remains (for instance) 25.000 fps (RIGHT).


Log

Log of playing the first video in the list above: https://paste.kodi.tv/ewedojumud.kodi

What jumps out to me (almost exactly 5 seconds apart):

line 1354: 2022-10-19 23:54:10.299 T:13900 DEBUG : ActiveAE::SyncStream - average error of -57.821371, start adjusting line 1355: 2022-10-19 23:54:10.299 T:13900 DEBUG : ActiveAE::SyncStream - average error -27.844047 below threshold of 30.000000

line 1394: 2022-10-19 23:54:15.095 T:19232 DEBUG : CVideoPlayerVideo::CalcFrameRate framerate was:29.970030 calculated:30.000000 line 1395: 2022-10-19 23:54:15.126 T:19232 DEBUG : CRenderManager::Configure - change configuration. 1920x1080. display: 1920x1080. framerate: 30.00.


Additional Information

  • I have downloaded the source material of the first video in the list using an online tool, to verify the actual framerate. Both the WEBM/VP9 and MP4/H.264 files are all 30.000 fps, and playing them from file does not trigger the issue.
  • Switching between VP9 or H.264 in the "MPEG-DASH" tab makes no difference.
  • I've played with every setting in the "MPEG-DASH" tab and under "Configure InputStream Adaptive" until my fingers got sore, nothing makes a difference.
  • Switching between hardware and software decoders in Kodi makes no difference.

Thank you for making this add-on, I wouldn't want go back to a time without it! :) Anything to help you squash a bug. (Or the folks at Inputstream Adaptive if the issue is in their code.)


lennartgoosens avatar Oct 19 '22 22:10 lennartgoosens