Here’s a basic script that will recognize the camera. I have not implemented audio yet per the @Nima suggestion. I will try it today. If you successfully add audio to the script below, post the full working example. Thanks.
using UnityEngine;
using System.Collections;
public class webCamDetect : MonoBehaviour
{
string camName;
public const string RICOH_DRIVER_NAME = "RICOH THETA V 4K";
// change to "RICOH THETA V FullHD" for lower resolution
// (and thus smaller data size)
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Number of web cams connected: " + devices.Length);
for (int i = 0; i < devices.Length; i++)
{
Debug.Log(i + " " + devices[i].name);
if (devices[i].name == RICOH_DRIVER_NAME)
{
camName = devices[i].name;
}
}
Debug.Log("I am using the webcam named " + camName);
if (camName != RICOH_DRIVER_NAME)
{
Debug.Log("ERROR: " + RICOH_DRIVER_NAME +
" not found. Install Ricoh UVC driver 1.0.1 or higher. Make sure your camera is in live streaming mode");
}
Renderer rend = this.GetComponentInChildren<Renderer>();
WebCamTexture mycam = new WebCamTexture();
mycam.deviceName = camName;
rend.material.mainTexture = mycam;
mycam.Play();
}
}
to followup on the discussion between @nima and @Litto
I have the THETA working as a spatial audio microphone inside of Unity
I can play spatial audio on headphones attached to my computer
I can get sound inside of the HTC Vive headset
I have not done precise tests of the orientation of the spatial sound inside the headset
Script for THETA V Live Streaming plus basic audio
using UnityEngine;
using System.Collections;
public class webCamDetect : MonoBehaviour
{
string camName;
public const string RICOH_DRIVER_NAME = "RICOH THETA V 4K";
// change to "RICOH THETA V FullHD" for lower resolution
// (and thus smaller data size)
// Audio
public const int THETA_V_AUDIO_NUMBER = 0;
AudioSource audioSource;
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Number of web cams connected: " + devices.Length);
for (int i = 0; i < devices.Length; i++)
{
Debug.Log(i + " " + devices[i].name);
if (devices[i].name == RICOH_DRIVER_NAME)
{
camName = devices[i].name;
}
}
Debug.Log("I am using the webcam named " + camName);
if (camName != RICOH_DRIVER_NAME)
{
Debug.Log("ERROR: " + RICOH_DRIVER_NAME +
" not found. Install Ricoh UVC driver 1.0.1 or higher. Make sure your camera is in live streaming mode");
}
Renderer rend = this.GetComponentInChildren<Renderer>();
WebCamTexture mycam = new WebCamTexture();
mycam.deviceName = camName;
rend.material.mainTexture = mycam;
mycam.Play();
// audio
// this section working with HTC Vive, but have not
// verified spatial audio. Maybe try STEAM AUDIO?
// https://valvesoftware.github.io/steam-audio/downloads.html
// It's good enough for telepresence demo right now, but
// I would like to tune the spatial audio
//
audioSource = GetComponent<AudioSource>();
string[] audioDevices = Microphone.devices;
for (int i = 0; i < audioDevices.Length; i++)
{
Debug.Log(i + " " + audioDevices[i]);
}
audioSource.clip = Microphone.Start(audioDevices[THETA_V_AUDIO_NUMBER], true, 10, 44100);
audioSource.loop = true;
while (!(Microphone.GetPosition(null) > 0 )) { }
audioSource.Play();
}
}
Problem is. Performance starts lagging (image) and there is still no audio
See Screenshot!) I did everything the way you did.
I also used “RICOH THETA V FullHD” in the script. still lagging…
Maybe you know what is missing… thx a lot!
I am using both the HTC Vive and the Oculus Rift but I got only a 1 channel audio on live streaming. I haven’t been able to access to live spatial audio and I am not sure the THETA V allows us to do it.
When you start your application, does SteamVR automatically configure your audio input as the THETA V? I’m reading this thread on Reddit and it seems like the settings in the screen below may not be saved.
I don’t have the headset plugged in now.
You’re right about the single channel audio for live streaming right now. I just remembered that I wrote this post back in Oct 2017.
I’m going to ask my friend at Ricoh about this. I think the camera can support this feature, but the internal firmware needs to be improved.
OK I managed to have audio. However, the sound has a latency of 20 sec or so.
The lagging part of the video was inside unity, but in the built application it does work smooth, not perfect but ok.
Is there any change I can stream sound and image simultaneously?
We getting somewhere interesting, I feel like.
Using the THETA UVC 4K driver, your CPU will need to do some work. While, your application is probably not hitting the CPU limit, it’ll be good to rule out this possibility.
BTW, I think you’re aware, but the latency is a problem that for telepresence that many people are working on. One solution is to develop a new protocol with better compression, specifically for transmission over networks.
Hello? Are you all still here?
I have a couple of questions. I’ve got 360 camera but it’s not THETA, it’s Insta360. So um… I can’t realize how you remove this black gaps on your sphere. What does this shader do?
(Solved: Unity Can’t Display THETA V Live Stream on Windows 10)
And what do you do in regedit? Is this thing for searching webcam or for… turning my webcam with 2 lenses into 2 webcams with single lenses?
I can’t resolve my problem with black gaps for a week.
Please help. Thanks in advance.
The THETA V outputs 4K equirectangular live streaming video. I’m not familiar with the insta360. You may want to ask someone on the insta360 developer site. If you do decide to purchase a THETA V, it also has the ability to develop plug-ins inside the camera.