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"

How do I make my media use their relative path instead of local in a packaged game?

I am packaging up a project and testing it on a separate laptop. When packaged and playing on my computer the video files play fine in the main menu and in play content, however when packaged and played on the other computer the video files fail to load and display black. The Media is in Content\movies\ and I am using a blueprint which references the full local directory (which is what I would assume is causing the issue), If i change that path to anything other than the full directory the video files don't play at all.

Any idea of how I can get this to work?

Product Version: UE 4.14
Tags:
more ▼

asked Feb 03 '17 at 03:51 PM in Packaging & Deployment

avatar image

JHope1488
26 2 3 6

avatar image 1l2Hawk Feb 16 '17 at 04:58 AM

Good luck ... The staff guys have been "looking into it" since 2014 / engine 4.5. None of the suggestions from the community seem to work either. Appears as though making videos work in an actual packaged build isn't a priority.

avatar image gmpreussner STAFF Feb 16 '17 at 04:27 PM

BigFudge, what is the path stored in the FileMediaSource?

avatar image JHope1488 Feb 16 '17 at 04:51 PM

Hi, The Path is " ./Movies/VidName.mp4 " or when hovered over in the content browser "/Game/Movies "

avatar image gmpreussner STAFF Feb 16 '17 at 04:56 PM

That looks correct. Does the video file get packaged? It should exist in the /Content/Movies directory on your laptop.

Could you please also attach your log file from the laptop?

avatar image JHope1488 Feb 16 '17 at 05:04 PM

Hi,

The videos exist in that directory. I think the issue may lie in the triggering blueprint as it is looking to open the file using the full file path including the user name, which doesn't exist on the 2nd PC. e.g C:\Users\Name\Desktop\UnrealProjects\ProjectName\Content\Movies\VidName.mp4 But if I change that in the blueprint, the files wont load at all.

I'll have to check I am able to disclose the information in the log as it contains client information in the file names.

Cheers

avatar image gmpreussner STAFF Feb 16 '17 at 05:08 PM

Which BP function are you using to open the movie? Are you opening the media source asset, or are you trying to open directly with a file path URL string?

avatar image JHope1488 Feb 16 '17 at 05:16 PM

I was using "open File" with the directory, I'm guessing I should be using the "open source" with the media source set as the relevant video?

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

1 answer: sort voted first

I was using "open File" with the directory, I'm guessing I should be using the "open source" with the media source set as the relevant video?

You can use either. OpenSource probably makes more sense and is more convenient. If you use OpenFile with relative paths, you have to follow the Engine's conventions for relative file paths. This means that the file path will be relative to the directory from which the executable is launched, something like:

 ../../../MyProject/Content/Movies/VidName.mp4

The media source asset uses a special syntax for relative paths, which starts with "./". It translates into "my game's Content directory". Unfortunately, this syntax is not supported anywhere else. I contemplated adding support to OpenFile and OpenUrl, but I may actually deprecate it altogether as it probably wasn't a good idea in the first place.

more ▼

answered Feb 16 '17 at 06:43 PM

(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