Landscape Video Recording Problem on iPhone 8 Running iOS 14.2
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
Preview of Video Recorded in Landscape Left Mode
Preview of Video Recorded in Landscape Right Mode
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.
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.
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:
-
The Issue on iPhone 8 running iOS 14.2: https://gofile.io/d/IhS4hL
-
The Expected Result on iPhone 11 Pro running iOS 14.2: https://gofile.io/d/UPucYH
I hope this helps clear up the issue.
Thank you.
Hi @v-grigoriev! Have you found any clues regarding this issue? Thanks again!
Hi @pandraos! Unfortunately, I haven't had time to look at the issue. I will look at the weekend.
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.
@v-grigoriev Thanks for the update.
We have the same issue with iPhone 12 pro, but in our case we have a flipped and mirrored video.
Is there any updates?
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.
Ok, we will provide it asap.
Hello! I've made a reproducible demo based on an example app: https://github.com/DragonSpirit/SCNRecorder
Thank you! I will take a look.
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.
When it will be ready we will check it on all of our devices (7, SE, 11 and 12) iphones.
Hey, @v-grigoriev! Is there any news?
@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.
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).
Is this issue still around? Or has it been fixed?
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.