svhawks / SceneKitVideoRecorder

Record your SceneKit and ARKit scenes easily.
MIT License
260 stars 55 forks source link

Video completely distorted and glitchy #3

Closed LeonardRockstar closed 7 years ago

LeonardRockstar commented 7 years ago

When using SceneKitVideoRecorder on an ARSCNView, the video is completely distorted. This is happening on my iPhone 7 Plus running Beta 10. img_969164ed9258-1

okaris commented 7 years ago

Thank you @warren. I am still working on the pixel format but dropping UIImage helped for the performance.

@mariedm @LeonardRockstar @sanboxapps @GoodbyeCain I am discussing this with Apple Developer Technical Support. Can you please confirm that this is reproducable with iOS11 GM and XCode9 GM. And also please include your device model. Thank you.

ghost commented 7 years ago

I can reproduce this readily on iPhone 7, iOS 11 GM.

mariedm commented 7 years ago

I am actually working on xCode 9 GM with an iPhone 7 on iOS 11 GM.

LeonardRockstar commented 7 years ago

I'm using the Xcode 9 GM and iOS 11 GM on an iPhone 7 Plus.

okaris commented 7 years ago

Response from Apple:

After some investigation into the pixel format and how it is encountered by your library at run time, we’ve determined that your current approach is not recommended and you should consider alternatives.

In particular, the currentDrawable’s texture vended by SceneKit is not intended to be used this way and the texture format could change at any time. This is partly why this format is undocumented. I’m unable to disclose more, and don’t want to encourage you further down a non-viable path, so that’s all there is to say about the current approach.

I am planning on changing this core functionality over the weekend. I am sorry that we could not find a viable solution.

okaris commented 7 years ago

Please try the latest version (1.3.1)

LeonardRockstar commented 7 years ago

The distortion is gone on my iPhone 7 Plus!!

mariedm commented 7 years ago

I can't make the new version work. I'm probably doing something wrong.

I call recorder=try! SceneKitVideoRecorder(withARSCNView: sceneView) in viewDidLoad(). Then recorder.setupMicrophone() and recorder.startWriting() when pushing the record button. But startDisplayLink() is never called. So when finishWriting is called, isRecording is false and it returns without stoping the recording. (So when I push the record button again I get Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetWriter addInput:] Cannot call method when status is 3').

okaris commented 7 years ago

@mariedm I just updated the demo project. Please try that and if that doesn't work please open a new issue.

mariedm commented 7 years ago

The only difference is the setupMicrophone() moved to viewWillAppear which I tried and it's still not working. I'll open a new issue. Congrats for the image distortion btw!