Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone screen turns red while playing video that requires rotation when using MediaPlayer.ExtractFrame() #1626

Closed
thesanketkale opened this issue Aug 25, 2023 · 6 comments
Assignees
Labels
Bug 🐛 Something isn't working Fixed A fix will be in the next release iOS iOS platform
Milestone

Comments

@thesanketkale
Copy link

Describe the issue
I have a simple setup of playing a video on a 3D quad having a RenderTexture on an Unlit Material. Now, I am looking to recreate all the scaling modes of fitting the video inside a RenderTexture as available with Unity's VideoPlayer component. For this, I extract each frame of the video using MediaPlayer.ExtractFrame() and blit it onto a RenderTexture preserving its aspect ratio using a custom shader.

Now, this works fine with both MP4 and MOV videos on Android devices. While on iPhone this works well for MP4 videos but turns the whole screen red as soon as I play an HEVC (.MOV) video which was shot using the same iPhone's camera.

Your Setup (please complete the following information):

  • Unity version: 2022.3.4f1
  • AVPro Video version (number and edition (trial/core/ultra/enterprise)): AVPro Core 2.8.4
  • Operating system version: iOS 16.6
  • Device model: iPhone 14 Pro Max
  • Video specs (resolution, frame-rate, codec, file size):
    Codec: HEVC (.MOV)
    Resolution: 1920 x 1080
    FPS: 59.94

To Reproduce

  1. Create a 3D quad with RenderTexture on an Unlit Material.
  2. Create a script to add a media player at runtime with HEVC video in streaming assets and set auto-play and auto-start to true
  3. Start a coroutine to get MediaPlayer.ExtractFrame() and blit it onto the RenderTexture used above
  4. Build and Deploy on iPhone
  5. The whole screen will turn red as soon as the video starts playing

Logs
No error was thrown in the logs.

Screenshots
image

Videos
https://drive.google.com/file/d/1tn9Vf5F3w9obYR_mtlo2h5xG7SUejTCz/view?usp=sharing

@MorrisRH
Copy link
Collaborator

ExtractFrame works perfectly for me here with the video you provided so I suspect there is something awry with your custom code. Both H.264 and HEVC mov files work fine.

A sample project would be very helpful in pinpointing what is going wrong. If you can please send one to unitysupport@renderheads.com

@MorrisRH MorrisRH added iOS iOS platform Could not reproduce 🤷 Could not reproduce labels Aug 25, 2023
@MorrisRH MorrisRH self-assigned this Aug 25, 2023
@thesanketkale
Copy link
Author

I have submitted a sample Unity and Xcode project in the email with the issue. Kindly help me identify what could be going wrong. It somehow plays both MP4 and MOV videos on Android devices normally, while on iPhone it works for MP4 but not for MOV.

@MorrisRH MorrisRH added Bug 🐛 Something isn't working Fixed A fix will be in the next release and removed Could not reproduce 🤷 Could not reproduce labels Aug 30, 2023
@MorrisRH
Copy link
Collaborator

A fix for this issue will make it into the next release

@thesanketkale
Copy link
Author

Awesome, I look forward to it. I will test it once and then close this. Thanks.

@MorrisRH MorrisRH changed the title iPhone screen turns red while playing HEVC (MOV) video when using MediaPlayer.ExtractFrame() for blitting on a RenderTexture iPhone screen turns red while playing video that requires rotation when using MediaPlayer.ExtractFrame() Aug 30, 2023
@MorrisRH MorrisRH added this to the 2.8.5 milestone Aug 30, 2023
@Ste-RH
Copy link
Collaborator

Ste-RH commented Aug 31, 2023

v2.8.5 has now been released @thesanketkale. Please do let us know if this addresses the issue.

@thesanketkale
Copy link
Author

This is solved in the v2.8.5 version. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working Fixed A fix will be in the next release iOS iOS platform
Projects
None yet
Development

No branches or pull requests

3 participants