Search Unity

Question Videoplayer stutters and speeds up in build, but plays fine in editor

Discussion in 'Audio & Video' started by Steven-1, May 18, 2021.

  1. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    I have a 1920x1080 30fps mp4 video I use as a cutscene inbetween 2 levels (scenes).
    I do this by loading a scene that has only a camera, a videoplayer and a small script that loads the next scene after the video is done playing.
    The videoplayer is set to PlayOnAwake and WaitForFirstFrame.
    It seems to work fine in the editor, but when I make a build, the video starts slowly (stuttering), then suddenly speeds up.
    Which is exactly the kind of behaviour I would expect could happen if WaitForFirstFrame was set to false, but as I said, it's set to true.

    Any idea what can cause this, and how to fix it?

    I'm using Unity2019.3,
    It's for a Windows build
     
    Last edited: May 18, 2021
    Awan212 likes this.
  2. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    Anyone?
     
  3. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    Any help?
     
  4. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    Does no one else have this issue?
     
  5. Sam_Johns

    Sam_Johns

    Joined:
    Jul 15, 2015
    Posts:
    13
    Hi Steven,

    Are you using the .Prepare() method and waiting for isPrepared = true; on the video player before running .Play()? It could be that the video is still loading when .Play() is called, and taking a few seconds to loading before catching back up to speed.

    Let me know!
     
  6. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    Yes, I have tried that as well, even thought according to the docs I shouldn't have to, as I've set WaitForFirstFrame to true.
    But it makes no difference anyway, the video still stutters even if I only start playing it after waiting for isPrepared to be true.
     
  7. Sam_Johns

    Sam_Johns

    Joined:
    Jul 15, 2015
    Posts:
    13
    ah that is annoying, how are you loading the video clip in? Is it loaded by Addressables or StreamingAssets, or dragged and dropped into the video player in the scene? Do you know what codec the video uses as well? We've had a few video issues and sometimes encoding them differently would give quite different results. I would also take a quick look at the profiler to make sure nothing's going on that you're not expecting during that scene load up!
     
  8. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    It's a local video, assigned in the inspector, so it's part of the build, I would expect that to work better than loading it externally.
    The codec is H.264, and it's 30 fps.
    I should also mention that Unity messes up the audio: only the left side remains, the right is silent, which is not the case when watching the video in any other player.

    I'll have a look at it with the profiler.
     
  9. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    nothing?
     
  10. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    I have similar framedrop issues when I build our app for standalone. It used to run fine in unity 2018, but since we moved to unity 2020 we have this issues. Did you ever try it on a newer version of unity? And did you ever try to contact Unity about it?
     
  11. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Decoding a video is an expensive operation and if there are spikes it is possible that the video can't provide the frame at the right speed. I would be curious to see the profiler.
     
  12. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    The weird thing is in the Editor is actually works okay. Not great but still okay.
    But the build (made with the unity2020) has real performance issues. Here are the profiler stats when running in the editor and controlling the video using my Playbar and setting the VideoPlayer.time property.

    And by the way, thanks for getting back. I didn't think anybody would reply here. It's nice to see that you guys care to help.
     

    Attached Files:

  13. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    I managed today to upgrade our project to the latest Unity 2021 version (2.8.f1) and I still have the same issue:
    Poor video performance, especially in the Build. The editor is still kinda okay.
    In all cases, using the Play() function, the video runs really smooth, even in the build. The only problem is when I use videoplayer.time (or frame). I tried many different video files (different resolutions, different file sizes etc.), all with the same result.
    And again, it still works very well with Unity 2018, especially when building the app.

    Please let me know if you think I should report this bug, and how to report it?
     
  14. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Are you able to record what you mean by "framedrop issues"? Because I can't reproduce it on 2020.3.26f1.
     
  15. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Yes, absolutely, thanks for looking into it.

    1. Unity Editor 2018 (works fine):
    https://www.dropbox.com/s/zmutqe1til3d7mm/unityEditor2018.mp4?dl=0

    2. Standalone Mac app, made with Unity 2018 (works even better than in the Editor2018):
    https://www.dropbox.com/s/xsacwkv0w15ixu5/standalone2018.mp4?dl=0

    3. Unity Editor 2020 (works still okay):
    https://www.dropbox.com/s/cw81wumfu4bxt32/unityEditor2020.mp4?dl=0

    4. Standalone Mac app, made with Unity 2020 and same results in Unity 2021 (frames are very slowly being loaded. Only in Playmode they run totally fine. But when searching with the Playbar for the frame, the framerate "of the video" is really low):
    https://www.dropbox.com/s/da991s03eckhfj7/standalone2020.mp4?dl=0

    The only thing that comes into my mind is that some Build "quality" settings in Unity2020 might have changed and could affect the performance, but I have no idea which settings that could be. Any idea?
     
  16. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Hi! Sorry for the wait. I had to investigate because it is now the third post on a similar bug. I found out that we did fix a similar issue recently, but the patch has not landed on all versions. So the next thing I would recommend is upgrading your project to the latest 2022 versions. We are not suggesting that you start using 2022 in production, but this will let you know in advance if the fix we are talking about is indeed solving the issue. If it is indeed that, we will try to accelerate the process. For more details, I would recommend checking the full answer from my colleague. https://forum.unity.com/threads/vid...-2020-1-16-to-2020-3-25.1226742/#post-7828875
     
  17. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Hi, Sorry for my late reply. I tried our project now with the beta of Unity 2022 and here's the result is okay. It seems to be better than Unity 2021, but still a lot worse than the performance we achieved with 2018. Here's a recorded video of a test:
    https://www.dropbox.com/s/pzo65mjoxatcthx/standalone2022.mp4?dl=0

    Would this fix eventually be available in Unity 2020.3 or would we have to go to Unity 2022?
     
  18. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Yes. It is currently getting backported to 2019, 2020, and 2021. You can see the progress in this issue tracker. https://issuetracker.unity3d.com/is...-dot-width-and-height-returns-expected-values

    As a lot of things changed between 2018 and today, I don't know exactly what causes this. You didn't share your script so I can't give you pointers on your code but, things you should look at are pausing when scrubbing and not continuously seeking. Try this script and check if it improves your solution.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using UnityEngine.Video;
    4.  
    5. public class ScrubbingController : MonoBehaviour
    6. {
    7.     public VideoPlayer player;
    8.  
    9.     private bool isSeeking;
    10.     private Slider slider;
    11.  
    12.     void Awake()
    13.     {
    14.         slider = GetComponent<Slider>();
    15.     }
    16.  
    17.     private void Player_seekCompleted(VideoPlayer source)
    18.     {
    19.         isSeeking = false;
    20.     }
    21.  
    22.     void Start()
    23.     {
    24.         slider.maxValue = (float)player.length;
    25.     }
    26.  
    27.     public void BeginScrub()
    28.     {
    29.         //It is recommended to pause the player when seeking as otherwise,
    30.         //you will continuously fight the VideoPlayer from playing and buffering frames.
    31.         player.Pause();
    32.  
    33.         //To know when the player has finished seeking      
    34.         player.seekCompleted += Player_seekCompleted;
    35.         isSeeking = false;
    36.     }
    37.  
    38.     public void UpdateScrub()
    39.     {
    40.         //If you are currently seeking there is no point to seek again.
    41.         if (isSeeking)
    42.             return;
    43.  
    44.         //Don't seek, if the time between the slider value and the current player time is too small.
    45.         //We will seek to the closest frame so if the delta is 0.00001f you will most likely seek the same frame.
    46.         //Change the value to fit your use case.
    47.         if(Mathf.Abs((float)player.time - slider.value) < 0.01f)
    48.             return;
    49.  
    50.         player.time = slider.value;
    51.         isSeeking = true;
    52.     }
    53.  
    54.     public void EndScrub()
    55.     {
    56.         //You don't want random event when you are not using this script
    57.         player.seekCompleted -= Player_seekCompleted;
    58.         player.Play();
    59.     }
    60. }
    61.  
     
  19. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Thanks for getting back and for showing how it's supposed to be used. I didn't find it this detailed in the documentary. I'm basically only using VideoPlayer.time to get the frame, but I try to make sure that I don't do that every update by comparing the calculated frame:

    Code (CSharp):
    1. public void UpdateVideoFrameTo (float time, float maxTime)
    2.     {
    3.         // maxFrames is VideoPlayer.frameCount
    4.         calculatedFrame = (long)(maxFrames / maxTime * time);
    5.  
    6.         if (calculatedFrame != currentFrame)
    7.         {
    8.             currentFrame = calculatedFrame;
    9.             //vp.frame = currentFrame;      // vp.frame doesn't work as good as vp.time, because sometimes it kinda just resets the video and then start from the beginning
    10.             //print(currentFrame);
    11.             vp.time = time;
    12.         }
    13.     }
    What I should mention is that before I use this function in my slider, I pause the video once using VideoPlayer.Pause().
    Do you see any issue with my implementation?
     
    Last edited: Feb 4, 2022
  20. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Do you check if you are currently seeking with player.seekCompleted?
     
  21. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    What you see in my code is everything I do in terms of video manipulation.
    I don't use the function seek() and I don't use seekCompleted().
    Should I check seekCompleted() every time before I even start looking for new frames? Would that help with processing the setting of vp.time?
     
  22. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Every time you change the time in the VideoPlayer, you are doing a seek operation. During a seeking operation, the VideoPlayer has to move to the requested time and start buffer frames. Now if you do that every frame, the VideoPlayer requests frames without being able to use them as he gets requested for the same thing again and again. You are racing against your GPU to see if your GPU can provide a frame before you cancel the operation. This creates unexpected stalling/freezing.

    So when scrubbing, my recommendation is:
    1. Pause the VideoPlayer.
    2. Make sure the jump is big enough, or that you don't already seek.
     
    Last edited: Feb 23, 2022
  23. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    1. The VideoPlayer is paused.
    2. As you can see in my code I only search for new frames and do not repeatedly search for old frames. So I am not searching if it is still seeking.

    Thanks for the help, but I kinda think we are stuck here. Is this now considered a bug that is going to be fixed or not?
     
  24. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
  25. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Ok, thanks.
    So this means, nobody has yet reported this bug?

    It will take me some time to create a minimal reproduction case project. But I will try to report it as soon as I can.
     
  26. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    I have reported the bug now. Looking forward to hearing from your team and getting it fixed soon.
    Cheers!
     
    The_Island likes this.
  27. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    I have reported the bug over a month ago, with a minimum reproduction project. I didn't receive any answer in the bug reporter ticket by the unity team. Is anybody going to take a look at this? It is really annoying since this is an important feature in our app for many years now, and I'm sure it could be fixed in no time since it use to work perfectly back in unity 2018. As reported I have tried every other version since and it is still working very badly. Please let your support team take a look at the reported bug. The case-nr is: 1422101 Thank you!
     
  28. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Sorry for the delay, our QA team didn't have the time yet to investigate the issue. The last two weeks have been busy for us. Next week, I will have a look at it.
     
    travelsound84 likes this.
  29. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Hi! I did work on the issue today. As you know now, when the VideoPlayer seeks, we start a job on another thread. If you ask to seek again and the previous seek is still not done, we stop the last one and create a new job. This is why I proposed you to wait for the seek to be done before seeking again. But while testing your project on my Mac, I realized it was not enough. As you said, the video seems to freeze, and it is worst in the build. While digging in, I realized that the image has never been blit on the texture. So you do a seek, we decode one frame, but before we have time to blit the texture, we get asked to seek again. This does give the feeling that the player is freezing but in fact, the VideoPlayer is racing you to blit the image. So the solution would be to wait for one update after getting the seekCompleted callback to give the time to the VideoPlayer to update the texture. This is the change, I did to improve the scrubbing and tested in your project.
    Code (CSharp):
    1.     void seekCompleted(VideoPlayer par)
    2.     {
    3.         StartCoroutine(WaitToUpdateRenderTextureBeforeEndingSeek());
    4.     }
    5.     public void UpdateVideoFrameTo(float time, float maxTime)
    6.     {
    7.         //If you are currently seeking there is no point to seek again.
    8.         if (!seekDone)
    9.             return;
    10.         //Don’t seek, if the time between the slider value and the current player time is too small.
    11.         //We will seek to the closest frame so if the delta is 0.00001f you will most likely seek the same frame.
    12.         //Change the value to fit your use case.
    13.         if (Mathf.Abs((float)vp.time - time) < 0.01f)
    14.             return;
    15.         vp.time = time;
    16.         seekDone = false;
    17.     }
    18.     IEnumerator WaitToUpdateRenderTextureBeforeEndingSeek()
    19.     {
    20.         yield return new WaitForEndOfFrame();
    21.         seekDone = true;
    22.     }
    Can you test this and tell me if it does look similar to your original project? I tried to compare it to your recording but the file shared in the bug report, is not the same. Another thing you can do to improve the player is when the player is just a little bit behind the time instead of seeking you can change the playback speed. It will feel far better than seeking and whenever the distance is too big you can then seek at the specific time. I wish it does help.
     
  30. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Hi, thanks for the reply. I used your code and it doesn't work, it seems like you missed pasting something.
    Anyway, I worked around understanding how you implemented waiting for the end of the Frame, but the performance is still very weak when running the Mac Build. Here's my code:
    Code (CSharp):
    1. public void UpdateVideoFrameTo(float time, float maxTime)
    2.     {
    3.         //print("jumpt to frame: " + (long)(maxFrames / maxTime * time));
    4.  
    5.         if (seekDone)
    6.         {
    7.             calculatedFrame = (long)(maxFrames / maxTime * time);
    8.  
    9.             if (calculatedFrame == 0)   // Because 0 gives a black frame, but I want the video to show the first frame
    10.             {
    11.                 calculatedFrame = 1;
    12.             }
    13.  
    14.  
    15.             if (calculatedFrame != currentFrame)
    16.             //if (Mathf.Abs(calculatedFrame - currentFrame) > 0.01f)
    17.             {
    18.                 currentFrame = calculatedFrame;
    19.                 vp.frame = currentFrame;
    20.                 print(currentFrame);
    21.  
    22.                 seekDone = false;
    23.                 StartCoroutine(WaitToUpdateRenderTextureBeforeEndingSeek());
    24.             }
    25.         }
    26.     }
    27.     IEnumerator WaitToUpdateRenderTextureBeforeEndingSeek()
    28.     {
    29.         yield return new WaitForEndOfFrame();
    30.         seekDone = true;
    31.     }
    In my implementation I used frame instead of time, as it's more straight forward to me. Does that make any difference to the performance?
     
    Last edited: May 31, 2022
  31. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    If it's not a problem, please upload the whole script with all your changes, so I can see why you say the performance is better on your end. Waiting for the end of the frame didn't help. I guess my implementation is just not ideal.
     
  32. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    No, they both call the same function. I preferred to use time just because we get time. I didn't want to share the whole code because I didn't want to share your code without your permission. I forgot to share the Start function. You need to set the vp.seekCompleted to the function.
    Code (CSharp):
    1.     // Start is called before the first frame update
    2.     void Start()
    3.     {
    4.         vp = GetComponent<VideoPlayer>();
    5.         //videoCam = GameObject.Find("Kameras/VideoCam").GetComponent<Camera>();
    6.         videoCam = GameObject.Find("Kameras/TaktikCam").GetComponent<Camera>();
    7.  
    8.         LoadVideoForTesting();
    9.         vp.seekCompleted += seekCompleted;
    10.     }
    Here is the full class.
    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Video;
    4.  
    5. public class VideoCreatorPlayer : Singleton<VideoCreatorPlayer>
    6. {
    7.     private VideoPlayer vp;
    8.     private ulong maxFrames;
    9.     private long currentFrame;
    10.     private long calculatedFrame;
    11.     private Camera videoCam;
    12.     private bool seekDone = true;
    13.  
    14.     // Start is called before the first frame update
    15.     void Start()
    16.     {
    17.         vp = GetComponent<VideoPlayer>();
    18.         //videoCam = GameObject.Find("Kameras/VideoCam").GetComponent<Camera>();
    19.         videoCam = GameObject.Find("Kameras/TaktikCam").GetComponent<Camera>();
    20.  
    21.         LoadVideoForTesting();
    22.         vp.seekCompleted += seekCompleted;
    23.     }
    24.  
    25.     void seekCompleted(VideoPlayer par)
    26.     {
    27.         Debug.Log("seekCompleted");
    28.         StartCoroutine(WaitToUpdateRenderTextureBeforeEndingSeek());
    29.     }
    30.  
    31.     public void UpdateVideoFrameTo(float time, float maxTime)
    32.     {
    33.         //If you are currently seeking there is no point to seek again.
    34.         if (!seekDone)
    35.             return;
    36.  
    37.         //Don't seek, if the time between the slider value and the current player time is too small.
    38.         //We will seek to the closest frame so if the delta is 0.00001f you will most likely seek the same frame.
    39.         //Change the value to fit your use case.
    40.         if (Mathf.Abs((float)vp.time - time) < 0.01f)
    41.             return;
    42.  
    43.         vp.time = time;
    44.         seekDone = false;
    45.     }
    46.  
    47.     IEnumerator WaitToUpdateRenderTextureBeforeEndingSeek()
    48.     {
    49.         yield return new WaitForEndOfFrame();
    50.  
    51.         seekDone = true;
    52.     }
    53.  
    54.     public void LoadVideo(string URL)
    55.     {
    56.         vp.url = URL;
    57.         vp.Prepare();
    58.     }
    59.  
    60.     public void LoadVideoForTesting ()
    61.     {
    62.         vp.Prepare();
    63.     }
    64.  
    65.     public void VideoInit ()
    66.     {
    67.         //vp.frame = 0; ATTENTION: for some reason, this messes up the frameCount
    68.         currentFrame = 0;
    69.         maxFrames = vp.frameCount;
    70.         vp.Pause();// damit man das erste frame sieht
    71.     }
    72.  
    73.     public bool IsVideoReady()
    74.     {
    75.         return vp.isPrepared;
    76.     }
    77.  
    78.     public void PauseVideoIfNotPaused()
    79.     {
    80.         if (vp.isPlaying)
    81.         {
    82.             vp.Pause();
    83.         }
    84.     }
    85.  
    86.     public void PlayVideo()
    87.     {
    88.         vp.Play();
    89.     }
    90.  
    91.     public float GetMaxTime ()
    92.     {
    93.         //print(vp.frameCount);
    94.         return (float)vp.length;
    95.     }
    96.  
    97.     public void ActivateCam (bool par)
    98.     {
    99.         if (videoCam.enabled != par)
    100.         {
    101.             videoCam.enabled = par;
    102.         }
    103.     }
    104.  
    105.     public void MuteVideo (bool par)
    106.     {
    107.         vp.SetDirectAudioMute(0, par);
    108.     }
    109.  
    110.     public bool GetHasAudio ()
    111.     {
    112.      
    113.         if (vp.audioTrackCount > 0)
    114.         {
    115.             return true;
    116.         }
    117.         //print("Hallo audio?");
    118.         return false;
    119.     }
    120.  
    121.     public Vector2 GetLoadedVideoResolution()
    122.     {
    123.         if (vp.url != "")
    124.         {
    125.             //print(vp.width + " and " + vp.height);
    126.             return new Vector2(vp.width, vp.height);
    127.         }
    128.         return new Vector2(0, 0);
    129.     }
    130.  
    131.     // Achtung, funtioniert noch nicht richtig
    132.     public void SetNewTargetTextureFromVP ()
    133.     {
    134.         print(vp.width + " and " + vp.height);
    135.         vp.targetTexture.Release();
    136.         RenderTexture rt = new RenderTexture((int)vp.width, (int)vp.height, 24);
    137.         transform.parent.Find("Spielfeld/Leinwand").GetComponent<MeshRenderer>().material.SetTexture(0, rt);
    138.         vp.targetTexture = rt;
    139.     }
    140. }
    141.  
     
  33. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Thanks for the code, it's not a problem at all to share that class.

    I tested it, and it does seem like a small improvement, but it's still a very poor performance on the video component, compared to how it used to be. So that's not solving the problem for us, especially with our new video analysis features that need to have a fluently performing player in order to interact with other GameObjects in the scene.

    To show you the difference using that same clip, here is a comparison:
    1. using the reported bug project and your code in unity 2020 (running even with a small window to improve performance):
    https://www.dropbox.com/s/ab56lyvodbihhn7/unity2020VideoPerformance.mp4?dl=0

    2. using our old app, which was released using unity 2018 (running in Fullscreen!):
    https://www.dropbox.com/s/0odwh0gfg9vxzil/oldAppVideoPerformance.mp4?dl=0

    The difference is still huge. So it must be something else that is causing this issue. Can you please dig deeper to find out how unity 2018 worked differently? It's a real step back for our customers. The performance issue is on other systems as well, but tremendously on Mac. I really hope you can see that.

    Kind regards
     
  34. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I realized I didn't mention it but had you tried webm? Our webm is completely separated from all other systems and supported on every platform. If your video doesn't have to be an mp4, I recommend trying it. Maybe it will react better to your needs.
     
  35. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Our platform exists since 2015 with mp4 being the required format, so our whole database and customers' devices are filled with only files of that format. So thanks, but that is not an option. Please help us find the reason for this performance loss of the Unity VideoPlayer component.
     
  36. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    We will make sure to work on this, but I fear it could take a while. People are starting to take their holidays, and we were not especially fast to provide a fix to our users :(. It is why I tried hard to find a workaround, but it seems you have to wait for a fix.
     
  37. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Okay, I understand. Thanks for taking this seriously, as it is damaging our business. Looking forward to hearing if you will have an estimation of when this could be fixed for Unity 2020, so we can plan a bugfix update for our customers.
     
  38. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I am going away for two weeks, but it should be pretty quick to find the issue and land in 2022. But the real problem is the backporting. I will probably do it myself, so it goes faster. Otherwise, you could wait for a while.
     
    travelsound84 likes this.
  39. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Thanks. Let me know if there will be something to test on my end.
    I am going to release our app as it is now. I found a really weird side effect that I wanted you to know, maybe it will hint to you in which direction to investigate next. And that is, I realized, that loading times (until the video component isPrepared) take very long with the built Mac app. But there is a trick how to make that instantly, and that is by going out of the screen with the mouse. I'm attaching a video of our app to demonstrate that. And I can assure you that I don't ever look for where the mouse is. So there must be something the Unity player is doing when I exit the Windowed app that forces the video component to load the frame.
    Check out at the end of the video, I'm even dragging the timeline outside the window and it reacts much much faster. Even though not as fast as we are aiming for, but I think this might help you find the issue.
    Here's the clip:
    https://www.dropbox.com/s/s9371jnbedqsmsi/videoPerformance.mp4?dl=0

    Enjoy your 2 weeks! Looking forward to hearing from you when you're back.
     
  40. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Hi, I just wanted to see if you had time to check it out? Did you see the hint I sent you in my post above and did that help?
    Cheers
     
  41. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I have been working on this on and off. I am doing a bisection to find the commit that introduced the regression. I know the regression happened between the transition from 2018 to 2019. It is taking longer than expected because I need to build code from 3 years ago, and I am having issues due to some tooling missing. Overall it is progressing, and I will update you whenever I get more results. Cheers!
     
  42. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Okay, thank you so much for your effort. Fingers crossed you will find the issue. Looking forward to hearing from you. Cheers!
     
  43. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    At this point, I should give you an update. I found a way to build the Editor on an old macOS, but I had to connect on a remote machine. It was tough to see if it was working or not as I had 300+ pings. A little bit after that, a QA started working on this. I had a quick discussion, and he pointed out that the regression also seems to happen on Windows. So I am trying to see if I can continue the bisection on Windows. Otherwise, I will have to let the QA finish his investigation.
     
  44. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Hi, thank you for your update. I saw that a new ticket was opened regarding my case on a new platform (Unity Bug Reporting Portal using Atlassian).
    Yes, Windows also has the issue, but when testing on Mac it's worse. Let me know if I can be of any help!
    Kind regards
     
  45. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    By the way, shortly after the ticket got opened I got an email from QA saying that the "Customer QA just finished investigating" with a survey on my experience. I'm not sure what I am supposed to do with it, since I think the case is still ongoing. Or am I wrong? Let me know if a fix is out already.
    Cheers!
     

    Attached Files:

  46. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Yeah, I asked for the ticket to be migrated to Jira (what we are using now). I am waiting for the QA to give me more detail, but we didn't receive the report yet, so definitely not fixed.
     
  47. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Hi, sorry to bother you, we are just releasing a new Update, so I was wondering how you guys are progressing? Just in case we could add the Unity fixes into this Update.

    Cheers!
     
  48. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    QA finished his work, and I am waiting for the Bisect team to start working on it. I am having a chat about this right now.
     
    travelsound84 likes this.
  49. Alex_Heizenrader

    Alex_Heizenrader

    Joined:
    May 16, 2019
    Posts:
    95
    Any updates here? We are noticing the exact same issue
     
  50. travelsound84

    travelsound84

    Joined:
    Jan 15, 2014
    Posts:
    34
    Any updates as to which version of unity has fixed this issue? I am working in Unity 2022.2.1 and still have severe performance issues when playing specific video files, as well as searching for frames on the time bar.

    I first thought the issue was fixed with unity 2022, but then realized that still quite a lot files are not playing well. So I guess it is now depending on the data in the video. Our customers converted a whole lot of videos in the past, these videos now don't run smoothly with this player.

    I understand that you can't guarantee that the video player will work on all files, but every other videoplayer I have plays those videos perfectly fine, and so did our app that was released with an earlier version.

    Can you please let me know where we can check on any progress? I had a confirmed issue tracker but nobody ever replied in that ticket.
     
    Last edited: Mar 9, 2023