Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Video VideoPlayer now depends on game framerate in unity 2022+

Discussion in 'Audio & Video' started by unity_key47, Sep 4, 2023.

  1. unity_key47

    unity_key47

    Joined:
    Jan 30, 2022
    Posts:
    10
    I realised that in both Editor and Player in unity 2023.1.7 VideoPlayer drops frames when current FPS is lower than video clip FPS. In Unity 2021.3.4 it was different. Video clips just played smoothly regardless current app FPS.
    Create empty URP project. Load any video asset in it. Setup video player and try to play video. Everything looks fine. Set Application.targetFramerato to 10. Look at the laggy video at 10 fps or too slow depending on "Skip on Drop" value. Set Application.targetFramerato to 300. Look at the smoothly playing video again. Repeat with 2021 unity and note that video never lags/slows regardless of the Framerate value.

    UPD#0:
    I also have opened bug report on the unity atlassian bug report portal with number IN-53261

    UPD#1:
    Unity issue tracker link https://issuetracker.unity3d.com/is...merate-is-set-lower-than-the-video-frame-rate
     
    Last edited: Sep 13, 2023
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    We added support for multiple clock sources in 2022.1+. Previously, we were always following the real-time instead of game time. Check you are still using the real-time and not game time clock source if you want to compare. There is also an issue with skip on drop but from my current exploration, it is an issue only with variable framerate clip. Try to disable SkipOnDrop in 2021 and check if the clip plays normally.
     
  3. unity_key47

    unity_key47

    Joined:
    Jan 30, 2022
    Posts:
    10
    @The_Island I suppose you are talking about VideoPlayer component parameter, added in unity 2022.1+ called UpdateMode (link to docs)
    Regardless of the value of UpdateMode i cant untie video playback process from Application target framerate.
    Also switching on and off SkipOnDrop doesnt help too. The only difference is when SkipOnDrop is on the video clip being constantly interrupted and when it is off the video clip slows down.