Media Player issue on ios

Hi everybody, I’m stuck on a media player issue on ios on both UE 4.13.2 and 4.14.3.

I have to play several videos on my app, one by one. On android devices everything works fine. On ios, app crash after 3 video. It looks like a memory problem. The crash occurs on an iPhone 6 plus with 1Gb of RAM (but on other android devices with same ram it does not happens).

I was worried about deleting all reference of a video, and I have also tried to force garbage collection, in order to clear memory. I’ve tried to separate each video in different sublevels using streaming levels, but same issue occurs. I have also tried different video and audio codecs, but nothing change. If I use very low quality video (like 480x270) app crashes after 5 video instead of 3. I play one video, then delete all reference about its media player, then change level and play another video, and so on (app does not crash at the same video, the order in which I play video not matter).

I’ve read crash logs and memory reports but I can’t figure out what else I can do.

Is this a memory leak from Unreal? Or I’m missing something?

I’m hoping in some explanation, .


LOGS

Crash log from device

Device console during crash (from xcode)

MemReport few seconds before crash


A related post (I think):

Hey Ale_32,

Could you provide the method you are using to playback the video files. I attempted to reproduce this issue but wasn’t able.

It would be useful to also have a detailed list of steps that reproduces the issue in a template or blank project with minimal assets. Since that is what we test in.

Ed, I’ll try to be as clear as possible.

I have 9 videos to play (size 1920x960 2:1 latlong) and 5 spheres (representing a viewer). Each viewer has its own media player, so I have 5 media players.

The simplest scene would be:

  • a persistent level with a sphere and a media texture attached to it
  • 4 sublevels each one with its own sphere and a media texture attached to it

At start, the player is in persistent level with all sublevels unloaded. When first video ends, I teleport player into another ‘room’ and so I load the corresponding level (I use stream level volumes). Also here, when video ends the player will go back to ‘home’ in persistent level, and so other rooms are unloaded.

When a video ends, I stop and close the media player and set a still frame on the sphere.

If I went from room 1 to room 2 the app crash after three times a video was played (also if I never load other rooms with their own media players, so I believe they are never loaded in memory).

I know video are heavy, but app crash also if I never load it. It seems they are loaded in memory anyway, also if the video level never be streamed.
If I reduce video resolution, and i jump only from a room to another (not matter which of those) app still crash after 5 or 6 times a video was played.

I’m sorry if it sounds confusing.
I’m here to explain more if you need clarification.

for your time

No, it’s unchecked!

Have you checked the precache file on the media file source?

Hi Ale_32,

I was able to reproduce this crash, thank you for the information I think loading and unloading the videos using sub levels was key for the crash. I have logged a JIRA here: Unreal Engine Issues and Bug Tracker (UE-41486)

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers,

, for the support.

I put the videos into sub levels in order to optimize memory, but in my case crash occurs also without stream levels.

how to solve