Bug Report Media Player Playback Rate

Hi guys, I’ve seen another post with the exact same problem but the guy never responded so it was completed as solved but there was no solution so thought I would re-post.

Basically i have some .mp4 files saved on my hard drive imported in to my project, I have created a media file from it, with a playback rate of 1.0 which is controlled in the media file. it is then turned into a media texture to be used in a material (I am making some animated buttons in the UMG)… unfortunately every-time I save and close the project and re-open the project the playback rate reverts back to 0.00, all my materials then do not work because of this and I have to manually change the playback rate again, this is fine when I have a few textures, but as I want to set up many textures like this it would become a bigger problem. So this is the error report.

Hello THINKTANK,

This is the default and expected behavior for the Media Player files. This was not originally the case when we first implemented the feature, but users were experiencing widespread crashes due to their Media Player files auto-playing when loading up the project. As you can imagine, the more textures you have referencing a single video on load, the longer the load times will take, and the more dangerous the project becomes when working with these files.

In order to control or set the rate of the Media Player file, you need to add some blueprint functionality, and call the ‘Set Rate’ node. Once you have done this, your videos will play as you expect while in game. If you need to preview the file, you can set the rate within the Media Player Asset. We try to let users know in our documentation not to rely too much on this feature as it is not production ready at this point.

If you have further questions or need additional assistance, please let me know.

Thank you,

Ah ok I see thank you for your response! So my question to you is this, will there be a set rate to multiple files or am I doing this the best way? creating a “set rate” for every one of my buttons will take ages! Same with a rewind as I want them all to be in sync since half are video alphas that work with there diffused counterparts :slight_smile:

Take a look over an answer one of our developers provided when calling multiple media files to play. Getting everything to play in sync is not going to be easy since the files need to be loaded into memory before playing. Also calling a media player to seek and rewind multiple times can cause the media files to break due to overflow.

Let me know if you have further questions.

Cheers,

Thanks Andrew, maybe If I just explain what I am trying to do- I basically have a material, a diffuse and a opacity (alpha) they are both video files. what I want them to do is both be in sync so the alpha works seamlessly with the diffuse. I am using several of these for buttons in the UMG (hopefully the 3D widget at some point when it works a bit better)… and then i’ll have like 6 video files for one button (standard, hovered and clicked)… It all kind of connects in with my other thread I have set up on working with 3d Widgets (Best way to create Information flags? - Blueprint - Epic Developer Community Forums) any help would be very much appreciated!

In all honestly, you would be better off using a SubUV animation for your pulsating circles and not an actual video. This allows you control the custom time dilation of your animations as well as the exact size and shape of your circles as well.

It is going to be more work to get all of your videos to playback with alphas in sync which will achieve the same effect as using a SubUV/Flipbook animation of circles…

Let me know if you have further questions or need additional assistance.

Cheers,

Thanks Andrew, the thing is it’s not just a pulsating circle, there are serveral types I will want to show as animated. Since I’m working with graphics / motion graphics department they are creating all the UI imagery to speed things up, if I take up that role as well things will get too much and will grind to a halt.

In my mind getting two videos to play at the same time should be a relatively simple thing to do? I’m sure there is more behind the scenes but I have noticed a lot of simple tasks in Unreal require a lot of work to play out correctly!

For the task I want to do then, is it at all possible? I will have 6 buttons, 3 states for each button so 36 video (pairs of two that will need syncing) and like I mentioned before, I will want them to float in 3D space (and follow the camera) so will the video / hoover interaction even work with the experimental 3d Widget? currently I can’t even get that to work but I guess that is separate from my main question, How can i get the videos to sync correctly?

When you are dealing with Media Files, getting them to play synchronously is not easy because the engine is running other processes which can cause frame times to vary.

It would take 2 players, one for each movie. It is much better to put alpha in RGB to the side and do 2 texture samples with offset to get the alpha from same frame.

Thanks,

To specify the play rate when starting playback, use the SetRate function instead of the Play function. Play is actually just a shortcut for SetRate(1.0)

Thanks Andrew, ok going down your route so instead of having a separate video for diffuse and another for alpha I should what generate an alpha using the diffuse colour?

This works pretty well, I wonder with more complicated videos how well it’ll work but thanks for now!