A very serious issue has occurred. I urgently request a prompt response. "initializeOffscreen dosent work with new version of deepAR"

"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)
    }

++++++

  1. When I switch to a new version, even if I use initializeOffscreen, the frameAvailable callback doesn’t seem to be triggered. I previously asked a question about this issue, and the suggested solution was to use startCapture, but that also doesn’t work. I tried placing startCapture inside didInitialize, 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.
  2. 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.”

1 Like

Thanks for the report, we’re looking into it.

how can i get a lower version of deepAR SDK for ios?

What method did you use for adding the SDK?
If it’s added as a package dependency, the version can be specified in the project setting under “Package Dependencies” or if you’re using CocoaPods it can be specified in the Podfile.

"This is what I found when I tried to receive all versions through CocoaPods and checked:

  1. When I update by specifying a specific version like this: pod 'DeepAR', '5.4.1', it seems that versions earlier than 5.3.0 do not exist. Here is the error log:
[!] CocoaPods could not find compatible versions for pod "DeepAR":
  In Podfile:
    DeepAR (= 5.2.0)

None of your spec sources contain a spec satisfying the dependency: `DeepAR (= 5.2.0)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

  1. Starting from version 5.4.2, the mentioned initializeOffscreen bug is present. While thread priority issues seem to have been resolved, from version 5.4.2 to the latest version, didInitialize does not execute when initializeOffscreen is called.

Please be aware of this bug and if it gets resolved, kindly reply to this topic. Currently, I’ll continue using version 5.4.1."

If you have any further questions or need assistance with resolving the issues you mentioned, please feel free to ask.

1 Like

I also need a solution here ASAP. Either a fix or a way to download an older SDK release that works. Quick assistance would be much appreciated!

I’ve sent you 5.5.1 to test with

1 Like

latest version 5.5.2 still has bug.

Does anyone know if this issue is addressed in the newly released v5.6.0 ?

To answer my previous question, the answer is no. Even on the latest v5.6.11 this issue is still present. Please, please fix this already!! It’s been almost THREE YEARS!

My company pays for DeepAR and yet we are still stuck on 5.4.1. The regression/bug was introduced in v5.4.2.

And now we are seeing a new crash on iOS 18 which is fixed in v5.6.11 but not 5.4.1…

I am also facing a similar issue. The effects I created from the DeepAR Studio template are not working with version 5.4.1. Is there any way to downgrade DeepAR Studio? thank you so much.

The new version of the iOS SDK (v5.6.12) should solve this issue.
Could all affected test if that is the case and let us know? Thank you!

Awesome!

v5.6.12 is mostly working for me now. frameAvailable is being called and the AR effects are displaying.

However when I try to record video (not through deepAR since deepAR is still rendering offscreen), I get this error

Domain=AVFoundationErrorDomain
Code=-11847 "Operation Interrupted"
UserInfo={
  NSLocalizedDescription=Operation Interrupted,
  NSLocalizedRecoverySuggestion=Stop other operations and try again.
}

I will look into it further as perhaps I can change something on our end to resolve, but thought it would be good to post here. Perhaps DeepAR is still using some AVFoundation resources despite rendering offscreen?

Could you provide more info on how you’re doing the recording?

We are using an AVAssetWriter and appending a CMSampleBuffer from each frame to the AVAssetWriterInput.