Unity APP
Xvisio SDK Documentation Home Page

Mix of Virtual and Real Fusion (Rtsp streaming)


1. Demo for Mixing of Virtual and actual reality

Scene:RGB_RTSP.unity
In the practical application of AR glass, sometimes user need to mix the 3D scene seen in the glasses with the scene in the rgb camera, and then display it tO LED. The virtual and real fusion SDK of AR glasses can be used to achieve this goal. An rtsp streaming connection will be generated, which users can share it with third-party users, so as to achieve the purpose of sharing virtual and real images.

2. Development Tutorial

Take Gesture Demo as an example.
Step 1:
Start "Gesture":
image

Step 2:
Drag "ThrowScene" in "XvXR/Prefabs" into the scene. Now the mixing of virtual and actual reality function has been merged into the local scene.
image

Step 3:
Check "RgbHead" in "ThrowScene":
image

Step 4:
Mount code "RgbControl" in "RgbControl上" to enable rtsp streaming function.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RgbControl : MonoBehaviour
{
    public WifiDisplayPluginWrapper wifi;

    // Start is called before the first frame update
    void Start()
    {
        Invoke("startwifi",1);
    }

    private void startwifi()
    {
        wifi.OnPcDisplayClick();
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

Step 5:
An rtsp connection address (format is shown as below) will be generated after running APP.
rtsp://IP:8554/stream/0
User need to fill in the IP address of your mobile phone. At the same time, use VLC to click "Media>Open Network Streaming>Network". Fill in the above rtsp address to the network protocol URL, and click the play button to play the rtsp streaming video of virtual and real integration. Note that the computer using VLC needs to be in the same LAN with the mobile phone.
image
image


Unity APP
Xvisio SDK Documentation Home Page