RenderHeads / UnityPlugin-AVProVideo

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

Frame index is not consistent #1332

Closed cecarlsen closed 1 year ago

cecarlsen commented 1 year ago

Describe the issue The actual frame displayed and the frame index that you can deduct from the values provided by AVProVideo does not always match up. This is extremely important in my case because I am unpacking each frame using frame index specific metadata.

Your Setup (please complete the following information):

To Reproduce

  1. Download test package from here [redacted] (also send to support email)
  2. Run the scene "VideoPlayerFrameIndexConsistency".
  3. Pause the Editor at random times and you will see that the index in the video and the index computed are not matching.

Screenshots FrameIndexInconsistencyAVProMedia

Forum posts https://forum.unity.com/threads/released-avpro-video-complete-video-playback-solution.385611/page-98#post-8320803 https://forum.unity.com/threads/released-avpro-video-complete-video-playback-solution.385611/page-98#post-8390547

Chris-RH commented 1 year ago

Hi @cecarlsen, If you use Directshow video API, it is more accurate the MediaFoundation.

cecarlsen commented 1 year ago

I am already using DirectShow. I need accurate, not "more accurate".

Ste-RH commented 1 year ago

We believe this is a rounding error. Whilst we investigate, you can make the following adjustment in Helper.cs that should provide you with a 1:1 relationship. Do let us know.

image

cecarlsen commented 1 year ago

Thanks for getting back @Ste-RH unfortunately it does not help. I am testing using the test project I send you. Unity 2020.1.11.f1.

Ste-RH commented 1 year ago

Using the editor to pause is not a reliable way to test.

Instead I added video pausing/playing to your AVProVideoMediaPlayerController class:

void Update()
{
    if (Input.GetKeyUp(KeyCode.Q))
    {
        _player.Pause();
    }
    if (Input.GetKeyUp(KeyCode.P))
    {
        _player.Play();
    }
}
cecarlsen commented 1 year ago

Aha! I see. It actually works. + 0.01 ... who would have known! Thank you =)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.