Search Issue Tracker

By Design

Votes

0

Found in

2021.3.30f1

2022.3.10f1

2023.1.14f1

2023.2.0b10

2023.3.0a5

Issue ID

UUM-49630

Regression

No

The Editor becomes unresponsive when playing many videos simultaneously

--

-

Reproduction steps:
1. Open the attached project "ASDQWE"
2. Open the “Assets/Scenes/TestScene.unity” Scene
3. Enter the Play Mode
4. Inside the Game View, in the Text Input Field input 150
5. Press the “Create Videos” button

Expected results: The videos are created and reproduced successfully
Actual results: Some videos are created and the Editor freezes

Reproducible with: 2022.3.10f1, 2023.1.14f1, 2023.2.0b10, 2023.3.0a5

Reproducible on: Intel macOS 13.5
Not reproducible on: No other environment tested

  1. Resolution Note:

    The VideoPlayer, and video codecs in general, are not design to scale unboundedly like is done in this scenario. Different codecs/platforms will report the issue differently. Microsoft Media Foundation will emit errors when resources get exhausted, but the webm/vp8 software decoder we're using will not produce such messages (because memory resources don't get exhausted in this non-hw-accelerated case); instead, the scheduling system will get into a situation where it's spending more CPU time dispatching than actually running decoding. Whether or not this gets detected/reported by Unity, the result will unfortunately be the same (video decoding will not be usable).

    One approach that can be usable, depending on the workflow details, is to prepare a single large video where all animations are played in a grid (one grid cell for each animated icon). You can then isolate each icon using texture coordinates. This will drastically reduce the number of VideoPlayers that have to be active at a time, and bring back resource usage to a more conservative level. You can segment your animations by groups of 100, for example, and only show the 2-3 videos that are currently in view in your library.

    This admittedly makes for a more complex asset preparation step but will ultimately provide a smoother runtime experience.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.