Video not playing in packaged APK

Hi there,

I’m using 4.13 and can’t figure out a way to play video in android device. I have coded all the stuff and video plays perfectly in editor. But I see jus black on the device when exported.

I’m very much confused searching about it cuz most of the questions or references are on old engine versions and are no longer relevant. Here are things I’ve done:

  1. got a mp4 video with H.264 video codec, created a ‘Movies’ folder in Content folder of the project and dropped the video in it.(No media player or media source file was created automatically when opened editor)
  2. As video wasn’t showing in editor, I drag and dropped the video file in empty movies folder shown in editor. That created a media source file, Double checked the location was relative
  3. created a playlist as well as a media player. Created a media texture, Made a material out of it. Material Domain was changed to UI for proper running of video.
  4. Applied the material to an image in UI widget used to show the video.

Works in editor not in Packaged game. Have no idea what codec are supported as there are lots of redundant answers online.

Plz help … its my First game !! :frowning:

XADIFY,

I have successfully been able to add a video on a packaged APK. Could you please upload screenshots of how you set up your project, or zip your sample project and provide it to me to review.

[UE4 Documentation - Media Player][1]

Thank you,

Play a Video File in Unreal Engine | Unreal Engine 5.1 Documentation

Here is what I did. Works in editor not on android

I posted a reply before but its not here now. Don’t know why, anyways ! hope the image contains all the info

Silly question: is it running a proper level? may be you’re in default black map :stuck_out_tongue:

A very silly one :smiley: … my map gets loaded and I even spawn couple of dudes around … but after spawning enemies tutorial is played but it shows only black images. I can wander and play my game as normal. No issues for that

Thanks … I will try it soon … :slight_smile:

Move the .mp4 file to Content/Movies/Movie.mp4 and then open up your NewMediaPlayer and right-click on the video and select “edit”. Once you’ve done that, a new window should pop up. All you should need to do now is click on the (…) or add ./Movies/Movie.mp4 after it’s been added to your Content/Movies folder.

Thanks!

Hi
I’ve tried what you have suggested. But it seems you are on 4.14 preview or something. because the steps aren’t working on my end and UI looks slightly different in your images. I did exactly what you said:

  1. The .mp4 file is in Movies folder
  2. Opened the player and right-clicked and clicked ‘edit’ to the video.
  3. It jus opened the generic asset editor - File media source(the very 1st image in the above image grid I sent). It was already set to ./Movies/vid.mp4 but still edited that again in case its was a bug or something.

Please check the image I sent again. Procedure you sent is not working :frowning:

I tried ‘Open URL’ to play the video and entered ./Movies/Myvid.mp4 as URL … It failed to open. Even tried packaging. Not working

  • I created the project in 4.13.2.
  • Move your .mp4 to a folder you make yourself which is called ‘Movies’ and place it in the ‘Content’ folder
  • Once you’ve done that, open up your NewMediaPlayer and right-click on the video and select ‘edit’
  • A new window will pop up, click on the ellipses and add the video that’s located in your Movies folder

Please double check your NewMediaTexture_Mat and make sure that the video is showing up on the material and is referenced from the right place. Check your texture too, and make sure it’s referenced from the right location too. In the viewport, you should be able to see the video playing.

Hi there !

the vid is still isn’t playing
I tried what you said in the above reply, I triple checked these :

  1. location of media file when I click on edit after right clicking the video in media player.(vid is in Movies folder which is in Content folder of project)
  2. the dependencies of media texture and made sure the same texture is used by the material.

Though I found a very odd thing. When I tried to print the URL after the media is opened (by binding the function as in your previous screenshot), it messed up my other bindings.(only on device, runs good in editor).
I have custom events in a HUD which I bind to initialize stuff of my NPCs after I finish some UI interactions. If I bind the ‘On media open’ event to a custom event, my other bindings are ignored ! it messes my AIs (ignore it if I haven’t explained it properly :P)

So, when I print the URL, it shows correctly on PC, saying :
file D:/my /‘SomeFolders’/MyProject/Content/Movies/Vid.mp4

but when I print it on device it says something like this :
file /…/…/…/MyProject/Content/./Movies/Vid.mp4
(the above address is exactly what is shown, Dots NOT for representing long address) I guess the problem is because of that one dot before ‘/Movies’

I’m currently using 4.13.0. I’ll try this again after I update to 4.13.2.
Would have made a video to show and explain clearly but it takes too much time to recode the mess the binding does.(delete every reference and reconnect it and stuff). If those dots appear due to absence of that location, I might have no option but to upgrade the engine at first place

Once you’ve upgraded your engine, please let me know whether or not this is working for you. I have tested this thoroughly and haven’t ran into any issues but I am on 4.13.2.

Thanks!

I’ve upgraded the engine and did same thing on a blank project. The address error still persists. It takes ‘___/Content/./Movies/vid.mp4’ even when I exclusively select the file by right clicking the media from the player. Runs great on PC but when ran tests on Asus Z00LD(ZE550KL) and an Oneplus One A001, the media address got messed.

Do I have to check my SDK updates from Nvidia Gameworks or something ?

And I noticed that the screenshots u sent had like yellow edit button but in my 4.13.2 there was a regular one. Is it because of GitHub version or something ? Or u might have jus edited the pic highlighting that text :stuck_out_tongue:

I’ll send u the blank project soon as my internet is bit slow.

Please upload a sample project that’s set up exactly like you have it in your project so that I can test it on my end. I just ran another test and my mp4 videos are working perfectly fine in 4.13.2.

The edit button is yellow because I highlighted it for you.

Thanks!

https://…com/open?id=0B-OnHYR-OaTQZnktMHd2RnRjQ3c

Here is the link of a sample project I made which shows same problem … sorry for late reply :stuck_out_tongue: hope it will get solved soon ! :slight_smile: thanx :slight_smile:

It works just fine for me. Please make sure that you’re going into the Project Settings > Maps & Modes and updating the proper map to open as default.

I tested this on Windows and Android.

I checked it again … I just had to save the level as ‘test’ again because of my HDD problem … here is the screenshot

its probably very minor issue but things aren’t working :frowning:
Again … it runs fine on PC … not on android only

XADIFY,

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here [UE-38598][1]. 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.

Thanks!

Unreal Engine Issues and Bug Tracker (UE-38598)

is there any way to hack through it for now ? like changing the URL or something ? otherwise i’ll just go for static image tutorials or will try image sprites for my game … Thanx for listening to me for so long :slight_smile: love u guys :smiley:

Hi there,

I see the bug description [UE-38598][1] being pretty vague so I’d like to share my experience if it can shine more lights on the issue.

I’m trying to play a video on an Samsung S6 SM-G920P, using 4.14.
It all works fine (with the MediaPlayer14.java from 4.15 branch to fix the media texture not being flushed properly) up to a certain packaging size.
For exemple I have a 90MB, I can play it on device no problem. I add into the same package 2 other videos of 350MB and 190MB and suddenly the 90MB video doesn’t play anymore.

the log gives the error “LogAndroidMedia:Warning: Failed to set data source for asset […]” which happens on :
JavaMediaPlayer->SetDataSource(PlatformFile.GetAssetManager(), FileRootPath, FileOffset, FileSize)

When the same non-working build is put on an S7, with better hardware (more RAM I would suspect is helping), it works and load any of videos packaged ! well, at least most of the time - it still fails every now and then.

This makes me think the asset manager is struggling when the package on android become too big to gather the blob data for a video within that blob properly.

  • oh yes I am all data packed into one apk, not using obb file -

I don’t know for sure if it’s related with XADIFY problems since many things can make the movie texture go black (like bad encoding) but if his package is big, I would put a penny on facing the same issue.

Hope it helps tracking the problem
Cheers.

Unreal Engine Issues and Bug Tracker (UE-38598)

The video file was like 6 seconds long and file size would be approx 30mb. Technically it should play but cant figure out why not playing.