AFathi / ARVideoKit

Capture & record ARKit videos 📹, photos 🌄, Live Photos 🎇, and GIFs 🎆.
Apache License 2.0
1.62k stars 226 forks source link

App freezes for a moment when starting recording #135

Open nazdream opened 2 years ago

nazdream commented 2 years ago

I am trying to record ARSKView with RecordAR. The problem I am facing is that every time I call RecordAR.record()the app freezes for a moment. Also, text-to-speech pronunciation is very laggy if I call it right after the record function.

Is there any way to avoid this issue? I couldn't find any possible way to prevent this issue in docs and in the internet. Any feedback is highly appreciated, thank you!

hypafrag commented 2 years ago

Did you try dispatching record() call to background queue? I'm having same issue with freeze, that's first thing I wanna try.

Ashes1st commented 2 years ago

Try to call record with viewDidLoad. It's work for me. Issue looks like specific initialisation when first time starting record.

let recThread = Thread() { self.recorder?.record() sleep(1) self.recorder?.stop() } recThread.name = "rec" recThread.start()

CaglarDemirci commented 1 year ago

I am trying to record ARSKView with RecordAR. The problem I am facing is that every time I call RecordAR.record()the app freezes for a moment. Also, text-to-speech pronunciation is very laggy if I call it right after the record function.

Is there any way to avoid this issue? I couldn't find any possible way to prevent this issue in docs and in the internet. Any feedback is highly appreciated, thank you!

I have the same problem did you find something ? @nazdream

DangHung301 commented 10 months ago

self.showLoading() DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1), execute: { self.startTimer(recoder: record) DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(3), execute: { print("done") self.resetCoudown() self.showView() isFirstApp = false }) })

I also had the same problem and solved it by adding the above code after I initialized RecordAR @nazdream