Video Player performance problem with Unity 2022

Hi, we have a game with video content. So we’ve built a video manager around the Unity Video Player to manage the loading and viewing of several videos in succession. Everything was going great.

We recently upgraded from Unity 2019 to Unity 2022. Since then, we’ve been experiencing performance problems with the Video Player on WebGL. Freezes, video and/or sound speeding up or slowing down. I have the impression that these problems mainly occur when using a Bluetooth headset. I sometimes have the problem without, but only at the beginning of the video.

I’ve tried several fixes, but to no avail (Audio Output Mode, last version of Unity 2022.3, etc.). I also tested with a small project using the Video Player without artifice, same problem.

Has anyone encountered similar problems? I despair a little…

I’ve carried out other tests, including 2 builds, one with 2019.4.40 and the other with 2022.3.9. It works correctly with the 2019, not the 2022. Same code, same scene… Definitely not good days to be a Unity game dev…

hello,
well here too …
thought it would have been improved like the doc’s say…
no… VideoPlayer is worse in 2022 … much better in 2021 but since 2022 is unusable on AppleTV for example…
M.

Hi, we are experiencing the exact problem. We play thousands of MP4 H.264 videos within our app, no issue until 2022. We are now using 2022.3.16, and there is stuttering, audio glitches at the start of each video and when we jump to points within the video for a few seconds. This is with the WebGL version (the only one we have tested) The issue is serious enough that the program is not usable with our education customers. We have tried changing the VideoPlayer parameters and retesting, no change. We unchecked “Skip on Frame Drop”, and we have “Wait For First Frame” enabled.

Our testing shows that the issue is related to the processor speed of the playing device. No issue on a gaming computer, some on a standard laptop or Chromebook (worse if other programs active), and really bad on a phone or tablet browser. It appears that Unity’s video player code is no longer optimized for playback of MP4 videos as it was before. Note our videos are 720 x 480, 30 fps, low bandwidth.

For use cases like ours with over 1,000 videos in a library, it is not possible to easily switch to another video format. Please let me know if there is a solution or update. Thanks.

Hi, using Unity 2022.3.19, I’ve got the same problem, pretty much exactly like @vinodlobo . On PC it’s fine but it’s really unusable on Android.

For the record, I’ve tried MP4 h264, h265, WEBM VP8 and VP9. I’ve went from 1080p to 720p, and now 480p, without improvements.
I understand that Android devices are less powerful, but running a 480p video shouldn’t be such a big problem

Unity please look into this

Hi !
Same problem here with unity 2023.2.13
The video play too fast and jump to previous frames but only on mobile devices (Android & IOS) (same problem if I use bluestack)
Did anyone find a solution ?

Nope, I’m switching to sprite Animations. Breakdown video frames into sprites and then animation. I only have a few small videos for tutorials, so this is my 2nd best option.

If this is the same problem I am aware of, I have confirmed that the WebGL build of the Unity6 beta version resolves the problem on mobile.
We do not recommend this as it is a beta version.

I bumped my project from 2022.3.24f1 to 2022.3.30f1 and on android, the issue is gone.
Best of luck for your projects everyone.

There is Still this issue in 2022.3.14f. My Client have a simple laptop with no gpu. It skipping frames. Not experienceing on my Desktop with rtx4070. Will upgrade project to 2022.3.50f1. Will share the results.

@Unity if there is any workaround.

Same issue but reproducible even on a gaming computer with RTX 2060S.

It’s only the audio that’s stuttering, and usually only the beginning, so maybe that’s why it isn’t getting as much attention because for some reason audio always takes a backseat, but it’s a really annoying user experience.

We have updated to Unity 6 and are hearing the issue but less serious than before. Basically the video player is trying to “catch up” the audio to video by speeding up first few seconds. Really noticeable in songs. We are using MP4 video files, and the beginning of the videos speeds up the audio for certain cases. This seemed to get better when we added a 0.5 second delay to first play after the scene loads, since our videos play right after a new scene loads. We also wait for Prepare event to succeed. As we have over 1,000 videos, we have not tried reencoding: ours are created with Handbrake using the Animation optimization and Variable Bitrate. Not sure if other encoding would help.

Hi,
If you are still facing this issue, maybe HISPlayer can help you with video player?
Our WebGL Video Player supports Unity Versions: 2020, 2021, 2022, 2023, Unity 6
You can find it here and try free demo in advance: Video Streaming Player WebGL | Video | Unity Asset Store
Hope it solves all video player problems on WebGL. Let us know if you need any help.

HISPlayer also lets you transcode all your mp4 videos into HLS and DASH streams with Variable / Adaptive Bitrate, in case you need it @vinodlobo.

Yes but it’s not free. Not everyone have initially money to spare into video players.
Unity definitely should do something regarding their video player.