-
Notifications
You must be signed in to change notification settings - Fork 55
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
Video completely distorted and glitchy #3
Comments
Wow. Strange yet cool. Will update iOS now to see whats wrong. |
Tested on iPhone SE iOS 11 Beta 10. Can’t reproduce. |
Weird, I've even created a new AR Kit project and I still see the error. What device were you using? |
I was on iPhone SE |
I was testing on an iPhone 7 Plus with SceneKitRecorder 1.0.3. I created a new Xcode Project with the ARKit template. |
I've just tested the same project on my iPad Pro. The video is not distorted, but it is really choppy. |
Can you test this issue with 1.2.0 please? |
As you showed there is a bug in 1.2.0 |
The issue still persists with 1.1.0 |
Please try with sample configuration. Don't forget to add prepare() on viewDidAppear |
I've tried the sample configuration, but the video still looks like that. |
I have the same issue. I'm using an iPhone 6S on iOS 11, I think I was on the 1st beta. I'm currently updating to the last one (beta 10). I'll retry after and tell you. |
I updated my iPhone 6S to iOS 11 beta 10. I retested and I'm still having the same issue. |
I have a strange theory and a really bad way to test it. @LeonardRockstar @mariedm
This huge switch is because printing the enum or its rawValue didn't work. I am getting |
Just tried it, it keeps printing "invalid". |
Interesting. Are you getting a whole video like this, or do you crash or do you have a video with one frame frozen? |
I'm getting the whole video like that. |
Another idea: can you try with 30fps video please. This is really hard to debug when i cant reproduce the issue |
@mariedm are you using 6s or 6s plus? |
Still looks the same when using 30fps. |
@LeonardRockstar can you put the switch to SceneKitVideoRecorder.swift under line 74 and also changing switch to
|
It prints bgra8Unorm_srgb |
That looks correct. One more thing to try. Can you pass in a block to updateFrameHandler of SceneKitVideoRecorder and get an image from there to see if its the same with the video. |
I don't know if I understand you correctly. The UIImage returned by PixelBufferFactory.make (and passed into updateFrameHandler) is also distorted, but looks a lot brighter than the video. |
same issue |
@GoodbyeCain can you please share your device, os version, pod version so we can check if a pattern is forming. |
I’m using a regular 6S. |
I'm getting the same error as @sanboxapps. |
I updated the pod, when calling I readded both switch statements. The one in Then in the |
@mariedm if you are seeing bgra8Unorm_srgb as pixelFormat I don't know why but it should be fixed for you. Can you run the demo project in the latest pod please. |
I didn't manage to run the demo project but I recreated it. I could record and I have the audio (!) but the video is distorded. If I change to 30 fps I get the same outputs. If I change to |
Please try this when the video is colorful like above and share the output. Thanks all!
|
This is the output: |
@warrenm I found your answer about Metal Video Recording on StackOverflow. This issue looks like a corruption you wrote on SO. Can you help us solve it? |
Sure. The texture whose bytes you're copying probably has a format of |
@warrenm Thank you very much for your guidance. It provided some perspective to try other solutions. @mariedm @LeonardRockstar @sanboxapps @GoodbyeCain Can you please run the latest (1.2.7) version of this project and let me know about the results please? |
It crashed at line 20 in PixelBufferFactory: with the error: |
@warrenm Can you suggest a source for how to convert these pixelFormats to one another? Also I don't believe that this pixelFormat is something should be returned by a MTLTexture coming from a SceneKit scene CAMetalLayer. Documentation tells the only following should be returned: .bgra8Unorm with bgra8Unorm_srgb being the default. |
I have the same crash & error outputs than @LeonardRockstar. |
@okaris It's unfortunate that this breaking change occurred, and that neither the change nor the format itself is documented. I don't know if XR biplanar format can be read or sampled by a shader, but if it can, you could bind the framebuffer as a source texture and "re-render" the frame to a bgra8Unorm target (with a full-screen quad pass) in order to get around this limitation. That will measurably impact the performance of the recorder. You might be able to recover part of the framerate hit by not taking a copy and building a UIImage every frame; that's an extremely expensive operation that doesn't seem to be necessary for the primary function of the framework. |
Thank you @warren. I am still working on the pixel format but dropping UIImage helped for the performance. @mariedm @LeonardRockstar @sanboxapps @GoodbyeCain |
I can reproduce this readily on iPhone 7, iOS 11 GM. |
I am actually working on xCode 9 GM with an iPhone 7 on iOS 11 GM. |
I'm using the Xcode 9 GM and iOS 11 GM on an iPhone 7 Plus. |
Response from Apple:
I am planning on changing this core functionality over the weekend. |
Please try the latest version (1.3.1) |
The distortion is gone on my iPhone 7 Plus!! |
I can't make the new version work. I'm probably doing something wrong. I call |
@mariedm I just updated the demo project. Please try that and if that doesn't work please open a new issue. |
The only difference is the |
When using SceneKitVideoRecorder on an ARSCNView, the video is completely distorted.
This is happening on my iPhone 7 Plus running Beta 10.
The text was updated successfully, but these errors were encountered: