- Home /
Video Player Performance is poor on Hololens
I am trying to play a video on 3D plane. When tried to view the video on Hololens the video fame rate is inconsistent and the audio is not proper. Using Unity Version 5.6.2f1.
Repro steps: 1. Add Video Player to a 3D plane. 2. Attach VideoClip to the player. 3. Build the project and run in Hololens.
Is there any solution or fix for this issue?
Code:
IEnumerator playVideo() { videoPlayer = gameObject.AddComponent(); audioSource = gameObject.AddComponent();
videoPlayer.playOnAwake = false;
audioSource.playOnAwake = false;
audioSource.Pause();
videoPlayer.clip = VideoClipToPlay;
videoPlayer.source = VideoSource.VideoClip;
videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
videoPlayer.EnableAudioTrack(0, true);
videoPlayer.SetTargetAudioSource(0, audioSource);
videoPlayer.Prepare();
//Wait until video is prepared
WaitForSeconds waitTime = new WaitForSeconds(1);
while (!videoPlayer.isPrepared)
{
Debug.Log("Preparing Video");
yield return waitTime;
break;
}
Debug.Log("Done Preparing Video");
image.texture = videoPlayer.texture;
//Play Video
videoPlayer.Play();
//Play Sound
audioSource.Play();
Debug.Log("Playing Video");
while (videoPlayer.isPlaying)
{
Debug.LogWarning("Video Time: " + Mathf.FloorToInt((float)videoPlayer.time));
yield return null;
}
Debug.Log("Done Playing Video");
}
I am also facing similar issues. The video seems to play fine but the audio is stuttering. Did you find a solution to this?
Answer by cQuence · Oct 02, 2017 at 09:35 AM
I'm using almost the same algorithm and I dont have problems with video. So only thing that comes to mind is that you didn't set Quality settings to lowest for UWP. If that doesn't work try overwritting Quality settings on Video asset to even lower quality. Or try to use different video to see if problem is in video format or size. I hope this helps.
Regards, Erik
Your answer