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"

4.13 Media Textures on iOS

Hey everyone:

So I have been trying to figure out how to use media textures on 4.13 for an iOS application using a mac for development. I run through the typical steps:

  1. Create a Movies folder in the contents.

  2. Add the .mov file in this new folder.

  3. Open the project and import this same file to the Movies folder.

  4. It comes in as a File Media Source and I change the save location to the project local save location by reloading the file from the project contents movies folder.

  5. I create a Media Player and open. It says no media in left corner and in right says AvfMedia.

  6. I double click my videos file media source, which is below the viewport.

  7. The video begins to play, however both below and now in the URL input of the viewport, it has the desktop save location instead of the './Movies' location of the video file (still in the file media source, the file path is the ./Movies). Changing the URL in the Media Player viewport crashes UE4 for me.

  8. Anyways, I proceed, and from there, right click the media player to create a media texture.

  9. And then right click it to create the material.

  10. I add the video into the scene. At this point the material is working and the video is playing on the mesh it was assigned to. And saving the project still allows everything in working order.

  11. Also, I have added the blueprint in the level that tells the media player to play at a rate of 1 when begin play. I have had success with this blueprint and this same setup on a windows machine, so I dont think this is the issue.

  12. BUT when pressing play in editor, the material goes back and the media player says no media. So i am assuming this is a bug with the media player? Or the URL file location? Or (hopefully) Im just doing something wrong?

  13. Nothing works.

  14. I must reset the URL in the media player. And it all works again, until I press play, or package, or anything...

Any ideas?

Thanks, Brad

Product Version: UE 4.13
Tags:
more ▼

asked Sep 01 '16 at 07:28 PM in Rendering

avatar image

Bamwd5
128 10 13 19

avatar image gmpreussner STAFF Sep 01 '16 at 09:27 PM

Please still send me the log file for the crash. That seems to be a separate issue. Thanks!

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Hey Bamwd5,

So I just ran some tests on my end using a project I had set up for this exactly workflow. In my case I am actually rendering the entire movie in fullscreen using UMG, but the general principal is the same and requires the same file directory set up to work as expected.

Media Source Directory

alt text

Here I have made sure all of my Media files are within the Content/Movies folder and the path for the Media Source asset points to the video within my Unreal Project's Engine/Content/Movies directory.

Media Player - UMG

alt text

Here you can see I have created a Media Player variable and called the Open Source node referencing the specified Media Source asset. I then call it to Play along with the associated Media Sound Wave.

Media Player - Level Blueprint

alt text

Finally within the level blueprint I simply create the Widget Blueprint and call it to render to the viewport. The option controls like the 'Quit Game' node can be triggered via touch inputs or other miscellaneous events. I then Packaged under the Shipping Configuration and deployed the packaged ipa to the device. The result is my video plays upon launching the loaded default level.

Hopefully this helps clarify the process, but let me know if you have further questions or need additional assistance.

Cheers,

Andrew Hurley

more ▼

answered Sep 01 '16 at 08:07 PM

avatar image gmpreussner STAFF Sep 02 '16 at 08:02 PM

Calling Play right after OpenSource is not going to work. You should either enable "PlayOnOpen" in the MediaPlayer asset, or hook into the OnMediaOpened event and call Play from there.

OpenSource, OpenUrl, and OpenPlaylist are asynchronous operations that may take some time to complete, especially if the media is coming from the internet.

(comments are locked)
10|2000 characters needed characters left

4) It comes in as a File Media Source and I change the save location to the project local save location by reloading the file from the project contents movies folder.

This is a bug. The path should already be saved as relative to /Content/Movies. I'll try to get this fixed in the next 4.13 hotfix.

7) The video begins to play, however both below and now in the URL input of the viewport, it has the desktop save location instead of the './Movies' location of the video file (still in the file media source, the file path is the ./Movies).

This is OK. The viewport will always display the full URL, even if the file path stored in the asset is relative. For the 'Url' field in the media library tab I may change it to display the actual string stored in the asset, so that there's no confusion. I'll think about it some more.

Changing the URL in the Media Player viewport crashes UE4 for me.

Could you please send me the log file of the crash?

11) Also, I have added the blueprint in the level that tells the media player to play at a rate of 1 when begin play. I have had success with this blueprint and this same setup on a windows machine, so I dont think this is the issue.

Don't do this. Either enable "PlayOnOpen" on the MediaPlayer asset and call Open from BeginPlay, or hook into the MediaPlayer's OnMediaOpened event and call Play from there. It takes some time to open a media source (especially if it is streamed), so you cannot call Play right away (it will simply return false).

more ▼

answered Sep 01 '16 at 08:13 PM

avatar image AndrewHurley Sep 01 '16 at 08:31 PM

For tracking purposes you can track the bug entered for the Media Source file path bug by following the link below.

UE-35477

Thanks,

Andrew Hurley

avatar image gmpreussner STAFF Sep 01 '16 at 09:26 PM

Fixed in the next hotfix.

(comments are locked)
10|2000 characters needed characters left
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