Search Unity

Bug Video rendering crash (ImageFilters::Blit)

Discussion in 'Audio & Video' started by KimmoFactor, Nov 30, 2022.

  1. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    39
    Hi, I've gotten a weird video rendering crash a two times in a week in 2022.1.23f1 (in editor play mode, haven't done builds in a while). I have a game that's constantly playing a video in the background, and so just randomly when in play mode it crashed the whole editor with the below stack trace. Clearly deep in Unity internals. Just wanted to make thread to check if someone else has encountered this? I can't really make a bug report (at least yet) since I can't reproduce this reliably or have more information than this.

    Stack Trace

    Received signal SIGSEGV
    Obtained 17 stack frames

    0x00007ff7d6926df0 (Unity) ImageFilters::Blit
    0x00007ff7d6926bfd (Unity) ImageFilters::Blit
    0x00007ff7d88c1765 (Unity) video_YUV420_convert::Blit
    0x00007ff7d789d7d3 (Unity) WindowsVideoTextureOutput::UpdateTexture
    0x00007ff7d789d356 (Unity) WindowsVideoMedia::UpdateTexture
    0x00007ff7d88bff0e (Unity) VideoMediaTextureOutput::OutputTexture
    0x00007ff7d787be07 (Unity) VideoClipPlayback::GetTextureAtTimeInternal
    0x00007ff7d7881e01 (Unity) VideoPlayback::GetTexture
    0x00007ff7d7878046 (Unity) VideoPlayer::VideoUpdate
    0x00007ff7d7877acd (Unity) VideoManager::TickEditor
    0x00007ff7d6154699 (Unity) CallbackArray::Invoke
    0x00007ff7d7b207e4 (Unity) Application::TickTimer
    0x00007ff7d7f8759a (Unity) MainMessageLoop
    0x00007ff7d7f8c3b4 (Unity) WinMain
    0x00007ff7d930448e (Unity) __scrt_common_main_seh
    0x00007ffa07c874b4 (KERNEL32) BaseThreadInitThunk
    0x00007ffa07f626a1 (ntdll) RtlUserThreadStart
     
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Hi. Is it possible you are saving your scene in play mode while the video is playing? Another user reported a bug with a similar stack trace when saving a timeline, so it could be something related to saving a scene, for example.

    So can you try the following:
    1. Changing something on the VideoPlayer
    2. Go into play mode
    3. Wait for your video to start playing
    4. Save the scene
    If it is the same issue, you should get a crash
     
    Last edited: Dec 1, 2022
  3. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    39
    Ok. First I was a bit confused because I don't know how to save a scene during play mode, I only get "You must exit play mode to save the scene"? I don't use Timeline in my project either right now. BUT, then with that idea I get it to crash reliably if I just select File -> Save Project during play mode. No need to do anything other than to enter play mode and save project and it's the same crash. Do you want me to try to make a bug report, or is it already handled?
     
  4. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Awesome! The issue was that we were caching some pointers, and saving would cause problems with them. So now, we hope you experienced this issue and not something else. As a temporary workaround, don't save anything while the VideoPlayer is playing, and you should be good until the fix lands on your version. You shouldn't need to report it as it seems to be the same issue, but don't hesitate to reach out again if you see the same behaviour in other scenarios.

    You can follow the issue here, and as you can see, a fix will land in the next 2023.1 alpha, and for the rest, we are working on backporting them. https://issuetracker.unity3d.com/is...taining-a-video-while-the-timeline-is-playing
     
    KimmoFactor likes this.
  5. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    39
    That's great, thanks a lot!