How to record video from ARKit?

风流意气都作罢 提交于 2019-12-02 22:25:24

You can record everything seen on the screen (or live stream it to services like Twitch, for that matter) using ReplayKit, ARKit and SceneKit content included.

(As Apple pointed out at WWDC, ReplayKit is actually the basis for the Control Center screen recording feature in iOS 11.)

Don't know if you have managed to answer this by now or not, but lacyrhoades, the person who wrote the class you referenced, has released another project on github that seems to do what you're asking for. I've used it and it manages to record the SceneView with AR Objects as well as the camera input. You can find it through this link:

https://github.com/lacyrhoades/SCNKit2Video

If you want to use it with AR though, you have to configure the ARSceneView to the project he's make, as his one just runs a SceneView, not one with AR.

Hope it helps.

I just found this framework, called ARVideoKit, and it seems to be easy to implement plus they have more features such as capturing GIFs and Live Photos.

The framework official repo is: https://github.com/AFathi/ARVideoKit/

To install it, you'd have to clone the repo and drag the .framework file into your project's embedded binary.

Then the implementation is pretty simple:

  1. import ARVideoKit in your UIViewController class

  2. Create a RecordAR? variable

    var videoRec:RecordAR?

  3. Initialize your variable in viewDidLoad

    videoRec = RecordAR(ARSpriteKit:sceneView)

  4. Prepare RecordAR in viewWillAppear

    videoRec.prepare(configuration)

  5. Begin recording a video

    videoRec.record()

  6. Stop and export to camera roll!

    videoRec.stopAndExport()

Take a look at the framework's documentation, it supports more features to use!

You can find their documentation here: https://github.com/AFathi/ARVideoKit/wiki

Hope that helped!

If you can keep your device connected to your Mac, it is really easy to just use QuickTime Player to record screen (and sound) from your iOS device.

In QuickTime choose new Movie Recording in the File menu, then in the record dialog near the big red record button there is a little dropdown arrow, where you can pick audio input and video input. Choose your i-device there and you're set to go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!