How to make your own Augmented Reality Video Recorder

Sample code for creating an augmented reality video camera.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 12/16/2021 at 20:31
Last Updated on 12/23/2023 at 04:38
A diagram showing frequencies being mapped to a histogram.

This tutorial does not include Audio Input - which can be found here.

For those looking for a TLDR, jump straight to Solution.

Download an AR camera starter project

Problem

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.

Solution

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.

Contact UsView All PostsView All Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe