Closed shi-yan closed 4 years ago
@shi-yan you can get that directly from ARKit using ARFrame's capturedImage
@shi-yan see the following instructions,
@digitallysavvy that's a good point. In addition to the option to retrieve the original frame using the ARFrame.capturedImage
, you can also use ARVideoKit's RenderARDelegate
. To set the the RenderARDelegate
, make sure to follow these steps:
renderAR
of RecordAR
to a class conforming to RenderARDelegate
.recordAR?. renderAR = self
RenderARDelegate
has the required method
class MyViewController: UIViewController, RenderARDelegate {
...
...
...
func frame(didRender buffer: CVPixelBuffer, with time: CMTime, using rawBuffer: CVPixelBuffer) {
// Use `rawBuffer` here to retrieve the original frame
// Use `buffer` to retrieve the rendered frame
}
}
Thank you. I'm aware of capturedImage. The reason for raising the question was that if I use capturedImage, I need to implement my own video encoding code?
@AFathi Thank you very much for the answer!
@AFathi: Sorry, bloody beginner's question. What do I have to write – HERE – to make this work?
func frame(didRender buffer: CVPixelBuffer, with time: CMTime, using rawBuffer: CVPixelBuffer) { – HERE – }
If I want to only capture the video stream without the AR overlay, can I do it?
I want to use AR to guide video recording, but I don't want to record the AR overlay.
Thanks!