Aynone successfully used a movie texture with Oculus?

Did anyone successfully play a movie in VR with the DK2 using the unreal movie texture stuff?

I tried it and the performance drops significantly, down to being unusable in VR.

I can confirm what media texture is playing movie in VR mode.

What format did you use? mp4? wmv? avi?

I can also confirm that movie playback created huge performance drop for myself also.

There was suppose to be some peformance improvements in 4.8 but I dont think they made it to 4.8 and are hopefully due in 4.9.

In the meantime you can modify MediaTextureResouce.CPP to help performance for dx11 cards.

Replace the “if (CurrentFrame.IsValid())” block within UpdateDefferedResource() with

if (CurrentFrame.IsValid())
		// draw the latest video frame
		if (CurrentFrameTime != LastFrameTime)
			FRHITexture2D* Texture2D = TextureRHI->GetTexture2D();
			if (GMaxRHIFeatureLevel < ERHIFeatureLevel::SM5)
				uint32 Stride = 0;
				uint8* TextureBuffer = (uint8*)RHILockTexture2D(Texture2D, 0, RLM_WriteOnly, Stride, false);
				FMemory::Memcpy(TextureBuffer, CurrentFrame->GetData(), CurrentFrame->Num());
				RHIUnlockTexture2D(Texture2D, 0, false);
				Cleared = false;
				const FUpdateTextureRegion2D Region = FUpdateTextureRegion2D(0, 0, 0, 0, Texture2D->GetSizeX(), Texture2D->GetSizeY());
				RHIUpdateTexture2D(Texture2DRHI, 0, Region, (Texture2D->GetSizeX() * 4), CurrentFrame->GetData());
				Cleared = true; 
			LastFrameTime = CurrentFrameTime;

Hi Opamp77,

thank you. Today I could test the patch. Unfortunately it doesn’t solve the performance problem :frowning:
do you know if it could be a problem of the video file used? I play a .wmv file, maybe a mp4 could perform better? Though I couldn’t find any mp4 that the engine accepts… :frowning:

Our solution for the time being is to make a Flipbook of the video. Fortunately, it’s not that long :slight_smile:

We are playing back MP4 on the Vive. UE4 is pretty picky about the video file. I found Handbrake conversion to MP4 seems to work well.

They’re implementing VLC codecs into a future version of the engine. Theres a roadmap somewhere on the forums for it.

I have a demo using WMV movie files in VR, and performance wasn’t a problem.

Hi! I’m quite new in the forum. I usually worked in Unity, and I’m starting to face UE for VR. Bit lost so far, truth to be told.

I’m trying to generate a very simple level (just to test) with two movie textures, playing different movies, for samsung gear VR…

Did someone tried to do something similar? Is it possible?