"I’m using an older version of DeepAR, probably around version 4. In that version, I’m using initializeOffscreen
and a custom camera to capture frames. After receiving the frame buffer, I render it in DeepAR using the deepAR.enqueueCameraFrame(sampleBuffer, mirror: self.mirrorCamera)
function. Then, I display the rendered filter on the screen using frameAvailable
. However, I’m facing several issues.
Here is the code I use when starting DeepAR:
++++++
public func initializeWithFrameSize(frameWidth: Int, frameHeight: Int, metalView: MetalView) {
self.metalView = metalView
self.deepAR = DeepAR()
self.deepAR.delegate = self
self.deepAR.setLicenseKey(self.licenseKey)
self.deepAR.changeLiveMode(false)
self.deepAR.enableAudioProcessing(false)
// 이거 안하면 안나옴;
// let arView = self.deepAR.createARView(withFrame: self.view.bounds)
// self.deepArView = arView
deepAR.initializeOffscreen(withWidth: Int(frameWidth), height: Int(frameHeight))
self.setDeepAREffectByPath(slot: .face, path: DeepAREffects.makeup_kim.rawValue.path)
}
++++++
- When I switch to a new version, even if I use
initializeOffscreen
, theframeAvailable
callback doesn’t seem to be triggered. I previously asked a question about this issue, and the suggested solution was to usestartCapture
, but that also doesn’t work. I tried placingstartCapture
insidedidInitialize
, but it still doesn’t work. However, it works in the older version, so I feel like there’s no explanation for what changed in this new version 5.5.2. We’ve been using this SDK for almost two years as a company, and I find this situation quite problematic. Please note that this topic is from my personal account. - I’m currently using version 4.x, and I’m using filters that rely on face tracking. The problem is that when the face is not detected, the frames become choppy. Even when testing with filters provided by deepAR as free assets, the same issue occurs. How can I resolve this problem?"
===============================================================================
“I’ve noticed a few things: When I execute self.deepAR.changeLiveMode(false)
, didInitialize
doesn’t run at all. Moreover, if I set it to true or don’t use it, didInitialize
runs normally, but it doesn’t reach frameAvailable
. Lastly, if self.deepAR.changeLiveMode(false)
is executed after didInitialize
has run, then at deepAR.processFrame(pixelBuffer, mirror: self.mirrorCamera)
or deepAR.enqueueCameraFrame(sampleBuffer, mirror: self.mirrorCamera)
, I encounter a ‘Thread 7: EXC_BAD_ACCESS (code=1, address=0x0)’ error and the app crashes.”