How to make your own Augmented Reality Video Recorder
This tutorial does not include Audio Input - which can be found here.
For those looking for a TLDR, jump straight to Solution.
The legend goes that Apple’s ReplayKit is the only way to capture AR — but this breaks all the time, without explanation — often pushing all further video to a Apple TV somewhere for no apparent reason with no way to stop casting your videos other than restarting your phone, leaving developers bashing their heads against walls hoping it works again.
ReplayKit comes with the problem that it presents the video in its own skin, leaving a lack of customization for that video presentation. What if you want to create your own workflow — well… tough luck, bud.
There are repo’s out there such as AFathi’s ARVideoKit but these do not suffice for capturing content that composed of ARReferenceImages or ARReferenceObjects.
But, after many trials and tribulations, today. There’s a way.
Step One: Add the recording functionality
Tie these functions to your buttons — Note that self.saveVideo(…) is at the end — this is in Step 3.
Step Two: Add the capturing frames functionality.
As explained in this post, “in your func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) call the following function — and yes, it does have to be coded this way, else your system freezes or crashes.”
Step Three: Add the Save Video Functionality.
That's a wrap
Please email us any questions that you may have using the contact form.