Closed alexandrefresnais closed 5 months ago
Hi,
Did the same experiment but using WebcamTexture instead of VideoKit inside the simple camera feed scene. I have no problem switching quickly and infinitely between my AR scene and my WebcamTexture scene.
So this should be possible with VideoKit right ? Maybe VideoKit is not freeing all its resources ?
Regards
@alexandrefresnais fix coming in 0.0.18.
Fixed in VideoKit 0.0.18.
Hi,
My team is developing an application using both AR Foundation and VideoKit.
As AR Foundation is not always required, but we need a camera feed, we switch between a VideoKit Camera Preview and an AR Camera to maximize performance and energy savings.
It works very well on iOS, but crashes on Android when switching camera feeds.
How to reproduce
The most no code solution I got is to create two scenes:
VideoKit scene
Just like the documentation, create a CameraManager and a CameraView. Add a button to jump to AR Scene
AR Scene
Create the most simple AR scene, using either the AR template or by yourself. Add a button to jump to Videokit scene
Symptoms
Crashing when going doing: VideoKit -> AR -> VideoKit
At rare occasion no crash occurs, but repeating the process will crash very soon.
Logs
Logs upon entering VideoKit scene the second time.
More info
Tested using Unity 2022.3.21f1. VideoKit 0.0.17 Working well on all iPhones since iPhone 12. Crashing on Google Pixel 7 pro running Android 14.
What makes me think it is a VideoKit bug, is that the following order works: AR scene -> Videokit -> AR scene
So I do not believe that ARCore is restraining Camera usage.
This is affecting pretty badly our user experience as they have to stay in AR. Thank you very much for any time spent on this.