x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 !! :(

Product Version: UE 4.13
Tags:
more ▼

asked Oct 24 '16 at 01:41 PM in Packaging & Deployment

avatar image

XADIFY
40 9 11 16

avatar image Samantha Sutton ♦♦ STAFF Oct 24 '16 at 06:07 PM

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

Thank you, Samantha

avatar image XADIFY Oct 25 '16 at 11:27 AM

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

alt text

video.jpg (669.4 kB)
avatar image Holybreath Oct 25 '16 at 11:56 AM

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

avatar image XADIFY Oct 25 '16 at 12:04 PM

A very silly one :D ... 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

avatar image Samantha Sutton ♦♦ STAFF Oct 27 '16 at 07:08 PM

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.

Edit Media

Click on ...

Thanks!

avatar image XADIFY Oct 27 '16 at 07:28 PM

Thanks ... I will try it soon .. :)

avatar image XADIFY Oct 28 '16 at 05:38 AM

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 :(

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

avatar image Samantha Sutton ♦♦ STAFF Oct 31 '16 at 04:18 PM
  • 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.

Video Player

videoplayer.png (132.6 kB)
avatar image XADIFY Nov 01 '16 at 01:00 PM

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 drive/'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

avatar image Samantha Sutton ♦♦ STAFF Nov 03 '16 at 03:36 PM

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!

avatar image XADIFY Nov 04 '16 at 10:58 AM

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 :P

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

avatar image Samantha Sutton ♦♦ STAFF Nov 08 '16 at 04:19 PM

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!

avatar image XADIFY Nov 08 '16 at 07:24 PM

https://drive.google.com/open?id=0B-OnHYR-OaTQZnktMHd2RnRjQ3c

Here is the link of a sample project I made which shows same problem ... sorry for late reply :P hope it will get solved soon ! :) thanx ^_^

avatar image Samantha Sutton ♦♦ STAFF Nov 10 '16 at 04:38 PM

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.

Windows Example

avatar image XADIFY Nov 14 '16 at 11:29 AM

I checked it again ... I just had to save the level as 'test' again because of my HDD problem ... here is the screenshotalt text

its probably very minor issue but things aren't working :( Again ... it runs fine on PC ... not on android only

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

XADIFY,

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

more ▼

answered Nov 14 '16 at 10:22 PM

avatar image XADIFY Nov 15 '16 at 02:56 AM

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 :) love u guys :D

avatar image DidierP Jan 27 '17 at 05:28 AM

Hi there,

I see the bug description UE-38598 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.

avatar image XADIFY Feb 02 '17 at 03:49 PM

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

avatar image Kilroyone Apr 15 '17 at 05:29 PM

Any news about solving this bug in 4.15.1 ?

avatar image Chris Babcock STAFF May 31 '17 at 11:15 PM

I don't think this will happen in 4.16 now that we don't use the AssetManager to access the OBB embedded in the APK. The AssetManager had to memory map the file which took process space which is limited on 32-bit. 4.16 bypasses this and opens the APK directly as a file.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question