Is 5.6.0b1 VideoPlayer expected to work on HoloLens, or is that a future release?
The VideoPlayer component is working correctly during editor playback for all 3 Holographic modes (Simulate in Editor, Remote to Device, and None.) After building and deploying in Visual Studio, the quad that should have video playing is just white.
(I can see by the size of sharedassets0.resource that the video is included in the VS project.)
Repro: New empty 5.6.0b1 project with HoloLens settings. Add a plane with VideoPlayer component playing short mp4 video recorded on the HoloLens, and set to autoplay and loop. As described above, video works in 3 editor Holographic modes, fails deployed.
(The new video pipeline looks great! Can’t wait to start testing it on HoloLens.)
Hello Octoplow…
I do it a different way, maybe, and my way does work for all platforms including the HoloLens.
But, I am not extremely happy with the play as it seems to run somewhat jerky as if it is a slow frame rate.
In my new and upcoming “Holo AEC” project, I use a video as a separate scene between project scenes.
Then, I use it on a floating block above the main scene buildings that can be “Air Tapped” to launch the next video scene.
I have not seen any documentation on a NEW “Unity Video Player Component”
If you could point me to documentation on this, I would appreciate that.
Here is the code that I attach to the Entity in the Scene. BTW, In the editor or other builds the user can click anywhere on the screen to launch the next scene but in the HoloLens the user needs to properly click the entity.
Attach this script and the Movie Material to the Entity.
Hope this helps, let me know.
And, if you can get it playing smoother, let me know too please.
Any trubs let me know too…
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.Collections;
public class Script File Name, Change this : MonoBehaviour
{ void Start()
{
MovieTexture movTex = (MovieTexture)GetComponent().material.mainTexture;
movTex.loop = true;
movTex.Play();
}
void OnGUI()
{
GUI.color = Color.clear;
if (GUI.Button(new Rect(0f, 0f, Screen.width, Screen.height), “”))
{
SceneManager.LoadScene(“Movie Name Change this”);
VideoPlayer is the new high performance video playback in 5.6b1. It’s really great everywhere but deployed to HoloLens.
VideoPlayer replaced the MovieTexture you’re using - that has bad performance and super slow import/conversion to OGV. Until 5.6b1, high quality video always needed a plugin from the AssetStore.
Hey… This is great news pfreese… Thanks… Your latest 5.5 is wonderful… Thanks for your efforts… I very much look forward to the full blown version of 5.6…
Update: unfortunately it looks like the new VideoPlayer functionality won’t be working correctly in the next beta release on apps deployed to the HoloLens. We’re still investigating the causes and hope to have a fix soon. Small consolation is that VideoPlayer does work properly when running through Holographic Remoting.
Yep, Remoting is our workaround for now. Thanks for the update.
We’re really happy with the new video pipeline so far. And in case you haven’t tried it yet, actors recorded on a black background can look really great on HoloLens.
Hi, today I’ve upgraded my unity to 5.6.0f3 and my video on Hololens device is both white and silent, while preview in Unity displays video and plays sound properly. Can someone confirm that the fix to this bug hasn’t been released in 5.6.0f3 or guide me how to make a plane/cube that uses new VideoPlayer? Currently I’m able to use movie texture with good results, but I would love to increase performance by replacing old method by video player. Right now I got Video Player configured like this: Video Clip, Render Mode set to Material Override, Renderer set to my 3d object, Audio Output set to Audio Source connected placed on my 3d object. My 3d object has solid white material attached to it.
By the way, I noticed that when I implement a video feature in Unity on GUI RAW Canvas colors are matched properly, while my colors on 3D objects are affected by shaders and I end up improving that by using directional light casted on the video player. Is there any other way to achieve good color reproduction on 3d objects?
The Video Player seems to be broken in beta version 5.6.0f2. I am able to build and deploy successfully to the Hololens, but the application just hangs/black screens.
I’m trying to play a 4k video. I am able to get the same project to work on desktop and other HMDs. Can anyone confirm this issue on hololens?
Do you have a min repro project I can test? I can’t see any issues on my side. Also 4K video would be very hard for the hololens to render considering it is a mobile platform. You may want to consider reducing the resolution some to get better performance.
so the code piece I use looks like this,
I can preview it running properly on Unity ‘Game’ mode, but when I deploy it to Hololens, there is no video nor sound.
The only object on my scene is HoloLensCamera prefab from HoloToolkit.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
public class TapTutorial : MonoBehaviour {
private VideoPlayer videoPlayer;
private AudioSource audioSource;
public VideoClip videoClip;
void Start () {
GameObject camera = GameObject.Find("HoloLensCamera");
videoPlayer = camera.AddComponent<VideoPlayer>();
audioSource = camera.AddComponent<AudioSource>();
//Disable Play on Awake for both Video and Audio
videoPlayer.playOnAwake = false;
audioSource.playOnAwake = false;
videoPlayer.clip = videoClip;
// Video settings
videoPlayer.renderMode = VideoRenderMode.CameraNearPlane;
videoPlayer.aspectRatio = VideoAspectRatio.FitVertically;
videoPlayer.targetCameraAlpha = 1.0F;
videoPlayer.isLooping = false;
// Audio settings
videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
videoPlayer.EnableAudioTrack(0, true);
videoPlayer.SetTargetAudioSource(0, audioSource);
videoPlayer.loopPointReached += EndReached;
audioSource.Play();
videoPlayer.Play();
}
void EndReached(UnityEngine.Video.VideoPlayer vp)
{
Debug.Log("End reached!");
StartCoroutine(fadeOutVideo());
}
IEnumerator fadeOutVideo()
{
while (videoPlayer.targetCameraAlpha > 0.0f)
{
videoPlayer.targetCameraAlpha -= 0.01f;
yield return null;
}
}
IEnumerator fadeInVideo()
{
while (videoPlayer.targetCameraAlpha <= 0.0f)
{
videoPlayer.targetCameraAlpha += 0.01f;
yield return null;
}
}
// Update is called once per frame
void Update () {
//Debug.Log("Frame " + videoPlayer.frame);
}
}