UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

Videos played in a square resolution except the first one

Open JoachimPeignaux opened this issue 1 year ago • 5 comments

Describe the issue Videos played in a square resolution except the first one

Your Setup: Unity version: 2021.3 AVPro Video version: AVPro Video - Core Edition - 2.9.1 Operating system version: Windows Device model: Windows 11 and Android Video specs (resolution, frame-rate, codec, file size): 16:9

To Reproduce

  1. Load a video by url _mediaPlayer.OpenMedia(MediaPathType.AbsolutePathOrURL, videoURL, autoPlay: false); The video is properly displayed. image

  2. On the same UI, call the _mediaPlayer.OpenMedia function again with the same or another video link again

  3. Notice the video is now displayed in square resolution image

I tried to call _mediaPlayer.CloseMedia, _mediaPlayer.Stop and _mediaPlayer.Cache.RemoveMediaFromCache before creating another media but I still have this issue.

My functions:

void SetVideo(string videoURL)
{
        if (videoURL != "")
                {
                    //Put the url in the video player component
                    _mediaPlayer.OpenMedia(MediaPathType.AbsolutePathOrURL, videoURL, autoPlay: false);
                    _mediaPlayer.AudioMuted = true;

                    //changing the media hints for content loaded via Path
                    MediaHints hints = _mediaPlayer.FallbackMediaHints;
                    hints.stereoPacking = StereoPacking.TopBottom;
                    _mediaPlayer.FallbackMediaHints = hints;
                }
}

and later i call:

public void DisplayVideo()
{
        gameObject.SetActive(true);
        _videoImage.gameObject.SetActive(true);
        _mediaPlayer.Play();
        _mediaPlayer.AudioMuted = false;
}

Any help would be welcomed, thank you

JoachimPeignaux avatar Feb 13 '24 08:02 JoachimPeignaux

  1. Can you reproduce this using a new project and our demo scenes?
  2. Does this only occur in portrait videos, or landscape too?
  3. Does it stay square or does it display properly after some time?
  4. Are you using our Display IMGUI or Display UGUI?

Chris-RH avatar Feb 13 '24 09:02 Chris-RH

I'll try in the beginning of next week and post here the result for 1 and 2 For the 3rd point, it stays square. For the 4th point, I use uGUI.

Before I already encoutered the same issue when I would call 2 times in the same frame OpenMedia( ), (link: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1728) but this time I checked and it's only called once

JoachimPeignaux avatar Feb 13 '24 13:02 JoachimPeignaux

Is that Unity UGUI or our Display UGUI component? https://renderheads.com/content/docs/AVProVideo/articles/component-display-ugui.html

Which settings are you using? What shader are you using?

Chris-RH avatar Feb 13 '24 14:02 Chris-RH

Could you please send a simple, reproducible project to [email protected]

Chris-RH avatar Feb 20 '24 12:02 Chris-RH

Could you please send a simple, reproducible project to [email protected]

Chris-RH avatar Feb 27 '24 10:02 Chris-RH