How are you supposed to play a video file on 5.6? Electra/Bink/Something else?

How are you supposed to play a local video file on all platforms in 5.6?

The recommendation we found from documentation was to use Electra, which seemed to work on the surface with a H264 4k/60 MP4 file, however:

  • A console platform can’t play 4k/60 H264, so we had to add another video for that. There’s a post on the forums here somewhere for a workaround to get it playing 4k, if we implement that it just crashes instead
  • A non steam windows platform doesn’t seem to be able to play 4k/60 H264 or 1080/60 H265, so we had to make another video for that platform
  • Steam deck/linux/proton can’t seem to play H264 or H265 video so we had to make a VP9
  • Some graphics cards (not old ones, often high end Nvidia 3070/4080 etc) can’t seem to play the 4k/H264 video so we needed to use the VP9 video for those. It’s unclear why this happens and we’re kind of winging it currently to guess when we might need to do this.

So now we’re up to 4 different video files to get a single video to play on all platforms using the latest greatest plays on all platforms plugin, which still sometimes seems to fail on some GPUs. When I refer to fail here I mean it loads the video, starts to play it and gets stuck on the first frame for 20-30 seconds then jumps later in the video, gets stuck for another 20-30 seconds and then the video ends and everything is back to normal. There’s nothing useful in the logs, it loads the video fine, think it’s playing the video, nothing else useful.

I thought I would try Bink instead. It crashes out of the box in 5.6 with a 100% GPU crash in editor and at runtime. I implemented a work around found here: https://github.com/EpicGames/UnrealEngine/commit/b3d54880f6456c971acced9fb342b3548f6d97b0 which gets it playing, it works in editor and packaged steam builds, but now a console platform can’t load the bink video and thinks it’s an invalid bink (might be related to zen streaming?). Are we going the right direction with Bink? Is this the recommended best practice/solution with 5.6?

It feels like it cannot possibly be this difficult to play a single 4k/60 video from disk on all platforms in UE 5.6, are we doing something wrong?

[Attachment Removed]

We pretty much went through the same five stages of grief you went through.

In the end we settled on bink, since that was the only option that (almost) painlessly supported what we wanted:

  • Support for all consoles, PC, and Steamdeck with a single source media file and no additional licensing shenanigans.
  • Support for FDefaultGameMoviePlayer (Electra doesn’t support the streamer interface AFAIK, and we wanted to play a movie already during early engine init)
  • Support for stuff like multiple audio tracks for a single video, subtitles, and so on.

Even with that, there are some funky issues we ran into. You already fixed the UAV issue, other engine mods/fixes I can find right now around bink that we applied are:

  • Removing the runtime dependency on the movies folder from BinkMediaPlayerSDK.Build.cs - this would package the movies into a pak file during cook, which bink just doesn’t seem to deal with - it wants a raw bink file to access. Make sure the raw movie files are still shipped as lose files with your build/console package.
  • Fixing volume so it is applied properly to movies. Initially our startup movie made peoples eardrums explode because it would just play at full steam - we basically just modded a playback volume into FBinkMovieStreamer, and pass one into the Init so it plays the movie at that volume.
  • Fixing the path code in BinkMediaPlayer.cpp. Particularly on Nintendo consoles, Unreal’s path resolution is kinda funky in that it would yield different paths depending on if you have an SD card in your console or not. Drove us up the wall that movies played just fine on programmer’s devkits, but not on tester’s kits. Until we figured out that all testers had an SD card in their kit, and that would prohibit bink from finding the movie file. (This was in an older UE version, maybe this works properly now in UE 5.6).

So, my recommendation is to go with good old bink, even if you have to figure out and apply the odd little fix. At least the guts are solid and work universally.

Ciao, Daniel!

[Attachment Removed]

Hello Sam, Hello Daniel,

unfortunately, if the goal is to have only a single video file that plays everywhere then, yes, it would appear you are best off using Bink.

Both H.264 and H.265 are subject to licensing fees and we can only use what the operating system offers for everyone to use and cannot provide decoder implementations on our own.

This is the reason why the Streamdeck will not play such videos and replace them with those lovely color bars.

OS built-in support for these codecs varies. On some consoles 1080p60 is possible, but not on all of them, just like the ability to decode 4K at speed. Encoding parameters may also play into this.

Generally speaking it may still be a good idea to have videos tailored to the target platform. Decoding a 4K video on a device that does not even output 4K, or similarly having a 60 fps video for a game that is locked to 30 fps would seem to be counterproductive, even if will technically work.

Regards,

Jens Petersam

[Attachment Removed]

Thank you Daniel! This helps a bunch to know we’re on the right path now and it’s all relatively solvable from someone else who has gone through this

[Attachment Removed]