Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

How to Livestream HoloLens Video in Unity Application may be iOS like Holostream?

Hi Guys,
One functionality of my Unity iOS app is that I want to Livestream HoloLens Video in my app.

I'm registering HoloLens device to my app (using ip address and credentials ) to make this rest API work:

/api/holographic/stream/live_high.mp4 (GET)
Initiates a chunked download of a fragmented mp4
Parameters

  • holo : capture holograms: true or false
  • pv : capture PV camera: true or false
  • mic : capture microphone: true or false
  • loopback : capture app audio: true or false

http://username:[email protected]:10080/api/holographic/stream/live_high.mp4
?holo=true&pv=true&mic=false&loopback=true

This is working on my PC browser but How do I make work it in Unity editor and my application?

I'm using Unity 5.6 and its https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html
class to play video feed from HoloLens when it is connected to my System over WIFI or USB but it is not enable to play it.
here is the code:
// Examples of VideoPlayer function

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
// Will attach a VideoPlayer to the main camera.
GameObject camera = GameObject.Find("Main Camera");

    // VideoPlayer automatically targets the camera backplane when it is added
    // to a camera object, no need to change videoPlayer.targetCamera.
    var videoPlayer = camera.AddComponent<UnityEngine.Video.VideoPlayer>();

    // By default, VideoPlayers added to a camera will use the far plane.
    // Let's target the near plane instead.
    videoPlayer.renderMode = UnityEngine.Video.VideoRenderMode.CameraNearPlane;

    // This will cause our scene to be visible through the video being played.
    videoPlayer.targetCameraAlpha = 0.5F;

    // Set the video to play. URL supports local absolute or relative paths.
    // Here, using absolute.
    videoPlayer.url = "http://username:[email protected]:10080/api/holographic/stream/live_high.mp4

?holo=true&pv=true&mic=false&loopback=true";

//or
//videoPlayer.url = "http://username:[email protected]:10080/api/holographic/stream/live_high.mp4";

    // Skip the first 100 frames.
    videoPlayer.frame = 100;

    // Restart from beginning when done.
    videoPlayer.isLooping = true;

    // Each time we reach the end, we slow down the playback by a factor of 10.
    videoPlayer.loopPointReached += EndReached;

    // Start playback. This means the VideoPlayer may have to prepare (reserve
    // resources, pre-load a few frames, etc.). To better control the delays
    // associated with this preparation one can use videoPlayer.Prepare() along with
    // its prepareCompleted event.
    videoPlayer.Play();
}

void EndReached(UnityEngine.Video.VideoPlayer vp)
{
    vp.playbackSpeed = vp.playbackSpeed / 10.0F;
}

}

It is working with locally stored video and video from this link http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4 but not from http://username:[email protected]:10080/api/holographic/stream/live_high.mp4 though it is working fine in browser.

Can anyone help me achieving this? Any alternative way? please note that from unity 5.6 Movie Texture is deprecated.

Best Answer

  • ReeleyReeley ✭✭✭
    Accepted Answer

    i just stumbled upon this

    maybe you can not do that right now

Answers

  • ReeleyReeley ✭✭✭
    Accepted Answer

    i just stumbled upon this

    maybe you can not do that right now

  • @Reeley said:
    i just stumbled upon this

    maybe you can not do that right now

    Yeah this seems the case I also saw it later, but it is 6 months old I thought it might have been updated. Anyways any alternative way you would like to suggest?

Sign In or Register to comment.