RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
235 stars 28 forks source link

DisplayUGUI not showing correct last frame when video was played with some hard lags using NotchLC codec #877

Closed Crazy-BAD closed 3 years ago

Crazy-BAD commented 3 years ago

Describe the issue We using RGBA video for ui background. On some hard workload (for example app start) video was freezed not on last frame which difenetly incorrect. Also i was tryed to subscrive media to player events and seek to last frame after video playback finished. This also not solwed issue.

Your Setup (please complete the following information):

To Reproduce

  1. play video without loop. last frame fully clear - i.e. all content removed by alpha channel.
  2. make script with random hard lags.
  3. sometames vide was stopped with image on screen (non last frame)

script that was used to attempt to fix issue (but unsuccessful) public class MediaPlayerEndFrameFix : MonoBehaviour { private void Start() { var meidaPlayers = gameObject.GetComponentsInChildren(true); foreach (var mp in meidaPlayers) { mp.Events.AddListener(OnMediaPlayerEvent); } }

    private void OnMediaPlayerEvent(MediaPlayer sender, MediaPlayerEvent.EventType ev, ErrorCode code)
    {
        if ( ev == MediaPlayerEvent.EventType.FinishedPlaying )
        {
            var totalTime = sender.Info.GetDurationFrames() / sender.Info.GetVideoFrameRate();
           UnityEngine.Debug.LogWarningFormat("Force seek form [{0} to {1}] - [{2}]", sender.Control.GetCurrentTime(), totalTime, sender.gameObject.GetPathInScene() );
            sender.Control.SeekToFrame(sender.Info.GetMaxFrameNumber());
        }
    }
}

00 01 02

Crazy-BAD commented 3 years ago

as you can see, same video in same (end) position showing different image, which difenetly wrong.

AndrewRH commented 3 years ago

Could you please send us this video file to unitysupport@renderheads.com or attache it here if it's not too large.

This seems to be a bug. We will investigate this.

Thanks,

Crazy-BAD commented 3 years ago

hires video. other video also sometimes caused same behavior.

https://user-images.githubusercontent.com/87861885/126826130-77d1ff8a-2d96-47d7-b55d-a106997a8941.mov

Crazy-BAD commented 3 years ago

simple way to reproduce - in update use Sleep(x), x is public variable in monobeh (checkd in range 1000-10000) to allow change delays without player restart. in this case i also saw other different bugs, every playback (manual press pause\play) in editor - even with normal fps (>60, delay was removed) video ended incorrectly not with last frame, until video manually was reloaded (in editor\player by pressing button). but this case reproduce not checked.

AndrewRH commented 3 years ago

Thanks for the video and the reproduction steps. This seems like a genuine bug so we should be able to fix it pretty fast.

Crazy-BAD commented 3 years ago

thanks, we need this fix, i hope you can fix this fast.

AndrewRH commented 3 years ago

While we look into it, could you try enabling the Low Latency option, and make sure you have Use Custom Mov Parser disabled?

image

Does this workaround solve your issue?

Meanwhile we'll continue to look into the root cause..

Thanks,

AndrewRH commented 3 years ago

We have reproduced the problem and have a fix for it. We will try to get this next release out very soon for you.

Thanks for reporting the issue and for your patience while we fixed it.

AndrewRH commented 3 years ago

Version 2.1.8 should be released tomorrow (Tuesday) with this fixed, and other NotchLC improvements.

When you test it, please let us know if this fixes this issue for you.

Thanks,

AndrewRH commented 3 years ago

@Crazy-BAD version 2.1.8 is available now

kahnivore commented 3 years ago

@Crazy-BAD did this fix your issue?

AndrewRH commented 3 years ago

I am closing this issue as we have not heard back and believe that the issue has been resolved with the 2.1.8 version.

Thanks,