Media framework video cuts framerate in half

Hi, so i am looking into media files in editor atm. I got the video file to import fine, but cannot play back the imported video as it nearly freezes the whole program. I tried .mp4, .wmv and .avi and all had the same effect.

Then when the video plays in game as a material the frame rate is dramatically decreased.

Is there an optimal file format, video options even?

Tried on 4.10 and 4.11 preview 2

What platform are you on? Which player plug-in are you using? Can you share the video file being used?

Tried on windows 8, will also try on windows 10 and get back to you.
What do you mean by player plug-in?
Video is under NDA so i cannot unfortunately :frowning:
I’ll try it with a different video and see the results as well.

What is the resolution and frame rate of the video?

Video rendering is not optimal right now as several buffer copies are required. We are working on improving the performance.

On Windows with the WmfMedia plug-in (default) I would recommend .wmv or .avi. With .mp4 we support only MPEG-4 on Windows right now, which doesn’t look that great.

You could try the VlcMedia plug-in for H.264 encoded .mp4 files, which gives much better quality, but it is also still experimental.

resolution - 1920x1080 (thought it was smaller than this at first, might be the problem?)

framerate - 25

I’ll have a look into the plug-ins and get back to you thanks.

P.S. there is a serious amount of noise in the audio when played. I literally cannot understand what is being said.

UPDATE

Tried the same thing on my laptop this time rather than the PC. It works much better, will test the audio later as well. It must be something to do with the codec drivers on the PC.

P.S. is there a way to make the video start at the beginning, at the moment it plays continuously in editor and in game.

You can uncheck “Looping” in your media player settings. There are also a bunch of nodes available to play, pause rewind etc.via blueprints.

Do you have an idea why it is running better on your laptop yet?
I’m also very interestet in improving my framerate with media textures playing. I just got a 980 ti and there is now improvement at all over a 960 so its clearly not a hardware problem.

Thanks, the looping uncheck did the job!
I have had to travel up country for work so I won’t be able to check it out until possibly thursday…the PC has a GTX 660, laptop has a GT 745M

I managed to solve the framerate problem on my end. It comes with a tradeoff though. Until now I always used Full HD wmv files with 50 fps. But as I found out today 720p Videos with 25fps are running just fine. I tried 1080p with 25fps aswell and it didnt do the trick. So thats something you can consider trying yourself. Let me know this helps.

I am currently working on improving performance of the Media framework. Currently, there is a lot of buffer copying going on, and for 4.12 I’m planning to make changes that will eliminate most of these. For now, the only workaround is to use smaller resolution videos.

I am still getting nearly completely all white noise out of the sound file though. Hopefully I can get away without needing to use it but is there any way to sort that out? Any audio codec that is better to use?

For sound I use audio components and sync it to the video in blueprints. I Use 16bit 44.1 khz integer .wav files importet as a sound wave, not via a media player.

Thanks I will give that a try!

We don’t have good audio track support yet. It is more of a proof of concept right now (simply feeding sample data into a queue, so it gets out of sync quickly, etc.)

Poor performance in the Media Framework is a big problem for us. We need UHD resolution for 360 video.

We are currently having same issue on our VR project. Unreal 4.11 preview 8. We have wmv video textures in our scene and up until now have been getting consistent 90fps and no problem with video playback. Since update 4.11 preview 8 however we get an exact half frame rate of 45fps and our cpu draw call jumps from 11ms to 22ms. Our plan now is to downgrade to 4.11 preview 7 but just want to make sure this doesnt continue into 4.11 official release.

Media Framework development back in the pipeline, but won’t see any updates until possible 4.12 preview

Media Framework Roadmap

Not sure, the code has been rotting for a while, and various other systems that it depends on have been modified. Maybe a lock was introduced somewhere in the render related code. A number of other features, such as audio and packaging seem to have new issues as well. I’m going through everything with a fine-tooth comb in the next couple weeks. Not everything will be finished for 4.12 as we’re branching in a few days, but I hope to address at least the performance and packaging issues.

Thanks for the reply. While I think 4.12 is gonna be awesome Im curious why I had 90fps performance with the same project and same video before 4.11 preview 8. I checked the release notes of 8 (I was using 4.11.7) and didnt seem to make any changes to media framework, was there any changes as far as you know. Should I downgrade to an even earlier version?

Thanks

Again thanks for the help. The bind we are in currently is we are doing a VR art show thing today for HTC and our playback has suddenly dropped to 45fps (from 90). If there is anything, even a high level C++ fix that we can implement ourselves, that could possibly patch the issue temporarily we would be very grateful. Excited for 4.12 but unfortunately we need a solution asap if possible.