I would like to display a THETA V live stream onto a Unity sphere.
I am trying WebCamTexture. It works on Mac OS X on the same hardware as Windows 10 (dual-boot). However, I can’t get it to work on Windows 10.
This is the error.
Could not connect pins - RenderStream()
UnityEngine.WebCamTexture:Play()
webCamDetect:Start() (at Assets/webCamDetect.cs:23)
This is the sample code:
using UnityEngine;
using System.Collections;
public class webCamDetect : MonoBehaviour
{
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);
}
string camName = devices[0].name;
Debug.Log("The webcam name is " + camName);
Renderer rend = this.GetComponentInChildren<Renderer>();
WebCamTexture mycam = new WebCamTexture();
mycam.deviceName = camName;
rend.material.mainTexture = mycam;
mycam.Play();
}
}
I have tried both RICOH THETA V and RICOH THETA V 4K. I have the driver RICOH THETA UVC 4K installed.
This information on Stackoverflow might be relevant.
The error message mentioning “RenderStream” supposedly corresponds to problem that Unity3D is unable to build a video streaming pipeline using DirectShow API. The message itself is not showing the root cause and in the order of probability (most probable first) it can be:
your code attempts to use one camera in 2+ places simultaneously, whereas the camera is exclusive use resource
WebCamTexture implementation and webcam driver have certain incompatibility which results in inability to construct new streaming sessions
problem in webcam driver that somehow fails to close video capture session so that next attempt to use WebCamTexture fails; restart of the application (closed hosting process) cleans the problem up
We have a project with ABB robots and we stuck to the same issue with Windows 10, Unreal3D and Theta V (just received camera last week).
Is there any update on Theta V expected soon to solve this issue, since previous cameras did not have this problem? This could be Unreal3D issue, but it is hard to conclude that…
Did you upgrade Windows 10 to 1709, Fall Creator’s Update? I personally have not tried it. The main issue is that the THETA V uses UVC 1.5 for webcam standard, not UVC 1.1 that the THETA S supported. I think there’s some other issue with UAC (audio) 2.0 that got upgraded in the Windows Fall Creator’s Update. NOTE: I don’t know if it works on Windows 10 1709. I want to test it and was planning to soon.
Can you test Unreal3D with a Mac? Does the IDE run on a Mac?
I tried for several hours to get the THETA V to display on Windows 10 and could not get it to display. On Windows, Unity detect 5 webcams for the one THETA V. It does not detect the RICOH THETA V webcam that is working on Mac OS X (same hardware, dual-boot with Mac and Windows). The one bit of info below is that the working webcam is RICOH THETA V, not THETA UVC 4K or variants of UVC. I may try a clean install of Windows 10 to see what happens when I don’t have the drivers installed. I attempted to uninstall the drivers with special Windows utilities, but was unsuccessful.
There has been no reported success with the THETA V and Windows 10. It works with Mac OS X. I want to try a clean install of Windows 10 to see if there are any driver conflicts from my previous install of the THETA S software. That is going to take some time, but getting questions from people like you is motivating me more. Thanks for bringing this up.
I had the two good sentences on console (about theta V) but my sphere is black.
The unity code works for my webcam but not for theta V. It seems my Mac does not have access to it.
Is there something I forget to do on mac to access theta streaming/files?
Can you see the equirectangular view of the THETA V stream in QuickTime? (as a test). If not, try and switch the USB adapter you are using (try borrow one from a friend). Before you do that, try the normal test of rebooting your Mac with the THETA V plugged in.
If you can see the THETA V in QuickTime, then close QuickTime and then make sure Unity can detect your THETA V. Something like this:
using UnityEngine;
using System.Collections;
public class testScriptBasic : MonoBehaviour {
void Start () {
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Number of web cams connected: " + devices.Length);
Renderer rend = this.GetComponentInChildren<Renderer>();
WebCamTexture mycam = new WebCamTexture();
string camName = devices[1].name;
Debug.Log("The webcam name is " + camName);
mycam.deviceName = camName;
rend.material.mainTexture = mycam;
mycam.Play();
}
}
The script above assumes you have an integrated webcam and the THETA V is the second webcam on your system. Adjust the device array devices[1] to devices[2] or devices[0] until you find the THETA V.
Unity should find the webcame “RICOH THETA V”
If you get this far, you should be able to display the THETA V on the exterior of a sphere. The tutorial shows a simple test to get the interior view.
I followed the tutorial, I put a screenshot of my result on unity.
At the end I have the two sentences on the console about theta but my sphere remains black.
I tested the streaming with QuickTime and OBS (with different MACs) and it did not work too.
If you are able to get the THETA V into Live Streaming Mode, but can’t display it in the Mac QuickTime, it is either the USB adapter or the camera.
If you debug the camera with Mac QuickTime, you should be able to also use Ricoh official customer support as the live streaming to Mac is a supported feature.
It’s possible that the older version may not work. Thanks for the report back. It will help other people debug their configuration.
I’m using Unity 2017.1.1f1.
I am testing macOS on a Hackintosh machine with this config:
NVIDIA GeForce GTX 750 Ti,
i7 4790K 4 physical cores @ 4 GHz,
16 GB system memory.
Note that on Mac OS X, I was not able to create an ico sphere on Blender with flip normals to project the video to the inside of the sphere. I made the ico sphere on Windows 10. There are other techniques to project the video onto the inside of the sphere, the one I showed with the ico sphere flip normal is easy.
USB Adapter
Before you upgrade your OS, wanted to let you know that I’ve seen problems with the USB adapter on some Mac computers connected to the THETA V in live streaming mode. I’ve seen this with the newer Thunderbolt 3 ports. My friend had two adapters. Live streaming in Unity worked with one, but did not work with the other adapter.
Is it just that the Unity software for Windows 10 doesn’t support Theta V? I will try just run Mac OS on a pc, and download the Unity software for OS. I’ll tell you guys what happens.
I was able to use the Theta V live feed (via usb) in Unity(5.6.4) on Windows 10 (version 1703) without much an issue using the materials provided in the Mac OSX thread, with only stylistic differences within the code. Are people still having issues with this?
The only problem I’m having now is with the feed from the Theta V being mirrored. I don’t know much about blender, but I’m using the sphere Craig provided in the first post. I’ve tried several methods(mostly in Unity) to flip the feed with no success, if anybody has any ideas on how to fix that please let me know.