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

Landscape Video Recording Problem on iPhone 8 Running iOS 14.2 #20

Open
pandraos opened this issue Dec 2, 2020 · 18 comments
Open

Landscape Video Recording Problem on iPhone 8 Running iOS 14.2 #20

pandraos opened this issue Dec 2, 2020 · 18 comments

Comments

@pandraos
Copy link

pandraos commented Dec 2, 2020

Hello,

I encountered an unusual issue while working with SCNRecorder.

Videos recorded in landscape orientation on iPhone 8 specifically running iOS 14.2 are rotated sideways and almost look as if they were recorded in locked portrait mode.
Videos recorded in portrait orientation work just fine.

It is a bit difficult to properly describe this issue so please refer to the three screenshots below.

Preview of Video Recorded in Portrait Mode

portrait

Preview of Video Recorded in Landscape Left Mode

landscape-left

Preview of Video Recorded in Landscape Right Mode

landscape-right

I am using version 2.3.0 of SCNRecorder.

I have failed to replicate this issue on the following devices:

  • iPhone 7 running iOS 13.6.
  • iPhone 11 Pro running iOS 14.2
  • iPad Pro 12.9'' (2015) running iPadOS 14.2

I have also attempted to play around with the video settings (specifically the size and the scaling mode) rather than using the default video settings but that didn't seem to help.

Thank you in advance for looking into this.

@v-grigoriev
Copy link
Collaborator

Hi @pandraos!
The expectation was to see full-screen videos when recorded in the landscape modes?
May I ask you to upload videos? They have metadata that might help.

@pandraos
Copy link
Author

pandraos commented Dec 2, 2020

The problem is that the videos shot in landscape mode on iPhone 8 (iOS 14.2) have the wrong orientation (rotated sideways) and are cropped to fit a portrait aspect ratio.

To illustrate the problem, I recorded the same video sequence using the same build of the app on two different phones in both landscape orientations:

I hope this helps clear up the issue.

Thank you.

@pandraos
Copy link
Author

pandraos commented Dec 3, 2020

Hi @v-grigoriev!
Have you found any clues regarding this issue?
Thanks again!

@v-grigoriev
Copy link
Collaborator

Hi @pandraos!
Unfortunately, I haven't had time to look at the issue.
I will look at the weekend.

@v-grigoriev
Copy link
Collaborator

I know where is the issue and probably how to fix it, but absolutely don't have time.
I'm postponing this till the next year since percent of affected apps and devices is low.

@pandraos
Copy link
Author

@v-grigoriev Thanks for the update.

@itershukov
Copy link

We have the same issue with iPhone 12 pro, but in our case we have a flipped and mirrored video.
image
Is there any updates?

@v-grigoriev
Copy link
Collaborator

v-grigoriev commented May 24, 2021

No updates so far, but I can reprioritize this.
You can help me if build a simple app (probably modify the example app) so I have exact things to fix.

PS. I really already forgot the way I wanted to fix this, so will have to make a fix from scratch.

@itershukov
Copy link

Ok, we will provide it asap.

@DragonSpirit
Copy link

Hello! I've made a reproducible demo based on an example app: https://github.com/DragonSpirit/SCNRecorder

@v-grigoriev
Copy link
Collaborator

Thank you! I will take a look.

@v-grigoriev
Copy link
Collaborator

v-grigoriev commented May 31, 2021

There are two unrelated issues.
The first one is known and related to the video orientation.
The second, new one, is related to the changed underlying iosurface size/behavior.

I have a fix, I will share it in a few days when I finish verifying.

@itershukov
Copy link

When it will be ready we will check it on all of our devices (7, SE, 11 and 12) iphones.

@itershukov
Copy link

Hey, @v-grigoriev! Is there any news?

@v-grigoriev
Copy link
Collaborator

@itershukov Well, I can't find an absolute fix for now and I will be very busy for the next few weeks.

But, I have a temporal solution.
If u take the version from the develop branch.
And somewhere in your viewDidLoad set (sceneView.layer as? CAMetalLayer)?.framebufferOnly = false it will work as expected. At least as far as I tested it look good.
I never saw any drawbacks on setting framebufferOnly to false.

In general, I can't find a universal fix for now, since on different devices it behaves differently. Since I can't find any background info or documentation I will need to investigate deeper. It will take time.

@v-grigoriev
Copy link
Collaborator

If someone wants to help me the issue is:

If framebufferOnly is set to true the underlying iosurface has "portrait" orientation even if the texture has "landscape" orientation. And the orientation is different on different iOS versions or devices (I tested on SE with 14.0.1 and 12 with 14.5).

@giomurru
Copy link

Is this issue still around? Or has it been fixed?

@v-grigoriev
Copy link
Collaborator

It is still around. I didn't find any predictable way to guarantee video orientation without setting framebufferOnly to false.
Since I never faced any issues with setting framebufferOnly to false it doesn't make any sense for me to keep digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants