googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
647 stars 191 forks source link

"Terminated due to memory issue" #60

Closed zrxq closed 6 years ago

zrxq commented 8 years ago

I'm using a GVRVideoView from GVRSDK (0.8.1) to play remote video.

Message from debugger: Terminated due to memory issue
zrxq commented 8 years ago

In fact, the app ends up "Terminated due to memory issue" even when the video (the large one, 1st link) is stored locally.

nathanmartz commented 8 years ago

Yes. This is because it tries to load the entire file into memory. If you want a streaming solution, encode your content using HLS.

zrxq commented 8 years ago

@nathanmartz: Sorry, I failed to mention that the second address is supposed to be HLS.

I just tried to stream this – http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8 – video, also HLS, and the result is exactly the same: eventually I get Message from debugger: Terminated due to memory issue. Could you please reopen the issue?

zrxq commented 8 years ago

Just to clarify, I use [VRVideo loadFromUrl:[NSURL URLWithString:@"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"]]. Android SDK has Options.FORMAT_HLS option, perhaps iOS needs something similar for HLS to work as intended?

zrxq commented 8 years ago

Wasn't able to reproduce the issue in simulator, but on a device (iPhone 6) it reproduces every time.

zrxq commented 8 years ago

Okay, turns out GVRVideoView isn't the culprit, GVRPanoramaView is (I use one for the preview). It seems to leak memory and eventually crashes the app. Loading a large video in GVRVideoView just speeds things up, but is not the root cause. Removing GVRPanoramaView results in the app playing the video without any issues. Sorry for the misinformation.

sanjayc77 commented 6 years ago

GVRView API (that includes GVRVideoView) is now deprecated. Please switch to GVRKit. It is also available as a Cocoapod. Take a look at the updated VideoWidgetDemo sample app.