SCNRecorder icon indicating copy to clipboard operation
SCNRecorder copied to clipboard

Landscape Video Recording Problem on iPhone 8 Running iOS 14.2

Open pandraos opened this issue 5 years ago • 18 comments

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.

pandraos avatar Dec 02 '20 10:12 pandraos

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.

v-grigoriev avatar Dec 02 '20 10:12 v-grigoriev

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.

pandraos avatar Dec 02 '20 12:12 pandraos

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

pandraos avatar Dec 03 '20 15:12 pandraos

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

v-grigoriev avatar Dec 03 '20 16:12 v-grigoriev

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 avatar Dec 11 '20 00:12 v-grigoriev

@v-grigoriev Thanks for the update.

pandraos avatar Dec 11 '20 23:12 pandraos

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?

itershukov avatar May 24 '21 14:05 itershukov

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.

v-grigoriev avatar May 24 '21 18:05 v-grigoriev

Ok, we will provide it asap.

itershukov avatar May 25 '21 09:05 itershukov

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

DragonSpirit avatar May 28 '21 13:05 DragonSpirit

Thank you! I will take a look.

v-grigoriev avatar May 28 '21 13:05 v-grigoriev

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.

v-grigoriev avatar May 31 '21 11:05 v-grigoriev

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

itershukov avatar May 31 '21 22:05 itershukov

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

itershukov avatar Jun 03 '21 16:06 itershukov

@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 avatar Jun 04 '21 19:06 v-grigoriev

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).

v-grigoriev avatar Jun 04 '21 19:06 v-grigoriev

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

giomurru avatar Aug 10 '23 08:08 giomurru

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.

v-grigoriev avatar Aug 14 '23 18:08 v-grigoriev