Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Video VideoPlayer.StepForward and missing frameReady Events

Discussion in 'Audio & Video' started by faustus67, Sep 19, 2019.

  1. faustus67

    faustus67

    Joined:
    Apr 15, 2014
    Posts:
    14
    Hi,

    I am using the Unity VideoPlayer to step through a paused video file frame by frame.
    To do this, I pause the videoPlayer and register a frameReady event
    In my frameReady event handler I use StepForward to move to the next frame.

    Everything works great on my video files until I reach frame 28, When I call StepForward I see my video display frame 29 but I never get the frameReady event. I have multiple test MP4 files that this happens on.

    When it sticks on frame 28, if I call StepForward an extra time, then it completes the rest of the video with no issues.

    Thanks for any light anyone might be able to shed on this, it's a bit frustrating, I'd rather not have to manually code a "If frame 28 then call step forward twice", eek.

    Unity 2019.2.4f1, running on MacOS

    For what it's worth the code snippet is:

    Code (CSharp):
    1.     void OnFrameReady(VideoPlayer source, long frameIndex) {
    2.  
    3.         Debug.Log("FrameReady: " + frameIndex);
    4.         // poseEstimation.AddPose(source.texture as RenderTexture, frameIndex);
    5.         source.StepForward();
    6.     }
    7.  
    and

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         videoPlayer.Pause();
    4.         videoPlayer.sendFrameReadyEvents = true;
    5.         videoPlayer.frameReady += OnFrameReady;
    6.     }
    7.  
     
  2. Domas_L

    Domas_L

    Unity Technologies

    Joined:
    Nov 27, 2018
    Posts:
    111
    Hello! Could you please submit a bug report with a minimal reproduction project for this issue and reply in here with the issue ID?
     
  3. faustus67

    faustus67

    Joined:
    Apr 15, 2014
    Posts:
    14
    I have submitted the bug with a minimal reproduction project but have not been issued with an issue ID, is there anywhere I can check whether it submitted correctly?
     
  4. faustus67

    faustus67

    Joined:
    Apr 15, 2014
    Posts:
    14
    Ah, sorry, just delayed, here is the issue ID: 1187256
     
    Domas_L likes this.