Media player is not playing audio after re-opening my project

Hi,
I am using Media player to create Media Textures, Materials and Sound waves from video file.

Materials applied on a plane works as desired,
Sound is playing, everything works.

However, when I save my project and open it again later, sound is not working at all and I have to re-import it again.

Could anyone help me what could be the issue please?
Thanks,
Michal

Hello MichalT,

Sorry to hear you are experiencing this issue, but keep in mind the Media Player feature is still in early development and is not quite production ready, so you may experience some undesired results.

The documentation’s page for Media Framework can be found at the link provided. It gives you some helpful information on the current status of this feature as well as ways to implement it into your game.

Media Framework Documentation

Sometimes the easiest fix for sound cutting out would be to restart the editor. If this does not work I do have a few more suggestions that you can try in order to avoid this issue.

Cheers,

Hi,
Thanks for the link to documentation.

Yes it is still happening even after I restart the editor.

Could you please give me more sugeestions ?
Thanks a lot

Michal

The only other suggestions would be to make sure you have ‘Realtime’ enabled in your active Viewport, as well as the volume slider is all the way up within the settings drop-down menu.

You could also try changing your ‘Media Player Asset’s’ “Streaming Mode” to ‘From Memory’ instead of ‘From URL.’

Also be sure your ‘Media Sound Wave’ is linked to the correct ‘Media Player’ video.

Aside from re-importing your video and creating everything from the start again, these are the best suggestions I can provide at this time. As I mentioned, this feature is still not production ready, so you might experience undesirable results.

Thank you,

Hi, my editor crashes after I select ‘From Memory’.

I saw that this audio from video is exported as MEDIA sound wave.
I will try to import it manually like sound wave only…this could solve my problem for now

Hey MichalT,

Unfortunately, this is a known issue selecting ‘From Memory’ after having it already streamed ‘From URL.’

One workaround would be to manually delete this Media Asset and create it again from the start. Although this is not the best solution, it should resolve your issue.

Cheers,

Hi Andrew,

the workaround isn’t working for me; creating a new media asset and setting it to “from memory” before loading a specific asset in still crashes Unreal.

Hello Kazhiim,

As I mentioned in the posts prior to this one. The Media Asset Player is still in development and is not quite production ready. This being said, there are bugs and known issues with the feature that are on the road map to be fixed.

The only suggestion I can give you would be to delete the ‘Media Asset’ and the ‘Movies’ folder within your ‘UnrealProjects’ directory folder. Then re-create them both from scratch to see if this resolves your problem.

Media Framework Documentation

Have a read over the documentation as well to see if you might be overlooking anything in particular.

Thank you,

Hi group,

The bug is that void AddSink( const IMediaSinkRef& Sink ) is never called on the media track when loading the sound asset from disk. It is call, however, when you create a media sound wave from right clicking on the media player.

If someone can direct me toward a custom fix I could implement so I can have something before the bug get fixed.

There’s a workaround I see : extract the sound track from the video file and save it as a wav file. Load it in the game and synchronized it with the video using a blueprint. My context does not allow it, but others can maybe do it.

Hi MichalT,

I found the bug. The class UMediaSoundWave should override the PostLoad method from UObject. In PostLoad, the class should call InitializeTrack().

That explains the behavior : when creating a MediaSoundWave asset from right-clicking on the media player in the editor, InitializeTrack is called, but it is never called when loading the asset from disk, for instance when you reload your project.

The solution : In MediaSoundWave.h, add this in the UObject overrides section:
virtual void PostLoad() override;

In mediaSoundWave.cpp, add this:
void UMediaSoundWave::PostLoad()
{
Super::PostLoad();
InitializeTrack();
}

Build and run.

Now, that fix works in the editor, when you reopen the project. But there’s still something missing for the packaging. The MediaSoundWave does not work yet in packaged game.

Hi MichalT,

I have found a fix for that. See this thread: