Movie playing upside down and backwards

When I play some movie files through with the new media framework they render upside down and backwards: Compare

to [the original movie file.][2]

It seems to be related to either the file type or the codec, we’ve only found the issue with AVIs so far.

Thanks, I’ll take a look.

Added UE-37505

So, something seems very broken in WmfMedia with playback of RGB32 encoded videos. As you already figured out, the video renders upside-down. It is also way too bright. I’m not sure why this happens, especially since we don’t even require conversion (it goes from RGB32 to RGB32).

Until I know more, I checked in a temporary workaround in CL# 3167029 for 4.15. In the meantime, I suggest that you use a different video format, i.e. H.264 encoded .mp4 files. If you’re compiling your own Engine, you can also apply my changes in your local build:

  1. Open /Engine/Plugins/Media/WmfMedia/Source/WmfMedia/Private/Player/WmfMediaTracks.cpp
  2. Find the line: const bool OutputRgba =
  3. Add the following check to the end of the list: (SubType != MFVideoFormat_RGB32)

This will basically tell WMF to convert your RGB32 to YUY2, which we then convert back to RGB32 in the Engine. Very inefficient, but it works.

Yeah, we had already settled on using a different format, I just figured I should report this bug. We tried with a few different AVIs and they all had the same problem, so it might not be a problem with the codec but the file format. The one I uploaded uses digifex (it was created through Maya) but some of the other AVIs we tried used G723 ADPCM (created using this program https://screentogif.codeplex.com/).

We also ran into a problem with MP4s with a width that isn’t a multiple of 8. Seems to be similar to this question Media player error on Mac - the file plays stretched - Cinematics & Media - Unreal Engine Forums, though we’re on Windows. Should I make another question for that?

It looks like that question was removed. Yeah, please add a new one, so we can track it, thanks!

I think that for 4.15 I need to modify the handling of buffer sizes vs. display sizes of videos. There are similar problems in other players, i.e. MfMedia expects multiples of 16.

The one I uploaded uses digifex […] we tried used G723 ADPCM

Those are audio codecs though. I think the problem is that the videos are encoded as RGB. I have an MP4V encoded AVI that plays fine, but the few RGB encoded ones I have (including yours) are all upside-down and too bright.

The brightness issue also occurs when using WMF’s RGB conversion for H.264, H.264ES, M4S2, WMV2, and WMV3, and possibly others, so I think that there’s something wrong with WMF’s RGB pipeline in general. I have added special cases for all those and do the conversion in the Engine now.

Looks like it included the comma I added at the end of the URL.

Posted a new question at https://answers.unrealengine.com/questions/510185/media-player-incorrectly-renders-videos-with-width.html which also has the correct link to the question I referenced.