"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

VideoPlayback terminated due to memory issues

Hello!

 

I'm trying to work with VideoPlayback sample. I've set my own key and everything was OK untill I added my own Targets DB and my own videos. So now it crashes every time I launch it

Steps & environment

- XCode 10, iPhone8 (11.4)

- Targets DB with 13 images

- One video file (now) sized 13MB which I use to all targets. But I'm planning to use 13 differents videos with size 13-30MB each

1. Just run and try to open camera screen

logs:

2018-10-09 13:32:11.111758+0700 app_name [9949:3566519] User pre-granted access to the camera 2018-10-09 13:32:11.111980+0700 app_name [9949:3566519] INFO/AR(9949) 2018-10-10 13:32:11: Vuforia selected rendering API OpenGL ES 2.x 2018-10-09 13:32:11.112067+0700 app_name [9949:3566519] INFO/AR(9949) 2018-10-10 13:32:11: Vuforia SDK version 7.2.23 2018-10-09 13:32:11.118707+0700 app_name [9949:3566387] self.navigationController.navigationBarHidden: Yes 2018-10-09 13:32:11.218040+0700 app_name [9949:3566519] INFO/AR(9949) 2018-10-10 13:32:11: Vuforia Fusion: Detected and enabled use of ARKit 2018-10-09 13:32:11.218809+0700 app_name [9949:3566519] Rendering mode set to: OpenGL ES 2.0 2018-10-09 13:32:11.227102+0700 app_name [9949:3566519] Rendering mode set to: OpenGL ES 2.0 2018-10-09 13:32:11.568498+0700 app_name [9949:3566387] DEBUG/AR(9949) UIView has CAEAGLLayer layer class 2018-10-09 13:32:11.571379+0700 app_name [9949:3566387] DEBUG/AR(9949) UIView responds to selector renderFrameVuforia Message from debugger: Terminated due to memory issue

 

It happens every launch. But if I change my video to example's video (VuforiaSizzleReel_1.mp4) everything goes well. The only one different between them is size (13 mb to 4.7mb). According to allocation tool from XCode: while preparing each video-augmented target memory usage jumps from 13MB to 146MB and than crash occurs. Maybe it happens beacuse of iOS who looks at the app and sees that at one moment it increases memory usage in 13 times and terminates it.

E.g. if I comment this lines

if (NO == [player load:filename playImmediately:NO fromPosition:videoPlaybackTime[i]]) {             NSLog(@"Failed to load media");         }

no videos are loaded and no crashes are occured. So I'm sure the reason only in loading all targets into memory at the same time. I also tried to do it after some delay, e.g. each loop's iteration loads data for his player after 2 sec delay, but it took no effect. Now I'm really need to fix it but I don't know how it can be done. May be there are some settings or there is a some way to lazy load video only after detecting in camera target linked with it?