Can RICOH THETA Z1 be used in Unity as a webcam?

Hi everyone,
We want to build a small VR conferencing app using Unity. I see that there were a lot of posts about connecting Ricoh Theta V with Unity via USB cable (like a webcam) to live stream 4K, but I couldn’t find any post about connecting the newer Z1 camera to Unity. Did someone successfully managed to connect it to Unity via USB? I like the larger sensor on Z1 and the image quality it produces, that is why I would like to go with it.

Thank you and have a nice day.

Hey ctav1an,

Just curious if you’ve had luck streaming the camera directly in Unity? I keep getting “Could not connect pins - RenderStream()” when playing the scene.

The only way I’ve managed to do it is with a ridiculous hack, just so I can at least develop while finding a real solution:

  • Plug Ricoh Z1 by USB
  • Open stream in MPC-HC media player
  • Capture with OBS
  • Output to Unity wit NDI
  • Receive in Unity with NDI receiver
  • Apply to Unity Skybox.

I mean…it works haha. But definitely not a realistic or usable option.

We ended up buying the RICOH Theta V, and it works fine with Unity. If you manage to solve the problem could you please make a post here. Thanks.

Thank you for the update. Sorry you had to buy a THETA V. I haven’t got around to testing it with the Z1, but still intend to.

it appears that @RicoB has got it to work with a hack, likely the hack described below.

The only way I’ve managed to do it is with a ridiculous hack, just so I can at least develop while finding a real solution:

You can likely edit the register with regedit and create a fake device driver for RICOH THETA Z1 4K. I have not tried this yet. You can find the HKEY by searching for RICOH THETA

This is for the THETA V.

See this article

Search for THETA Z1 and find the key (have not tried yet)

image

The key will be different for Z1.

image

image

From roughly Mar 2018, the hack was no longer needed with THETA V as RICOH incorporated a similar hack into the driver 1.0.1.

What I want to do is to first test this myself with the Z1 and then send a report to some guys I know at RICOH.

If you hack the registry on your Windows machine, you will need to hack the register for every Windows computer you use with the Z1. Thus, it’s not a good solution for commercial deployment if you sell your app. However, it may be useful for prototyping and demos. Also, I don’t know if it works with Z1 as I have not tested it yet.

Hey @craig

Btw, the hack I did was meant as a figure of speech hack…not a real “registry hack”. I just streamed the ricoh camera from MPC-HC to OBS, through NDI, to Unity. It was just for testing purposes. Quality and delay was pretty bad.

So I created a new Key under “Instance” using a CLSID I found for the Z1 searching the registry (It seems the key name is the same as the CLSID for all other cameras, so I did that), then added all the necessary String inside (ie. FriendlyName, DevicePath, CLID,etc. - except FilterData cause I couldn’t find it or understand). Results: same issue, unfortunately.

Here are my findings, though:

  • The new key I created makes it so MPC-HC now sees 2 x Ricoh Z1, but the new one doesn’t work.
  • I found the registry entry that MPC-HC uses to find the camera, by doing a search in the registry and changing the “FriendlyName” until I saw it changed it in MPC-HC as well. I added a “DevicePath” entry for the fun of it, but that didn’t do anything. Here’s the path in case anyone else wants to experiment:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\DeviceClasses{65e8773d-8f56-11d0-a3b9-00a0c9223196}##?#USB#VID_05CA&PID_2715&MI_01#7&b5856d3&0&0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}#GLOBAL\Device Parameters

  • In Unity, if the Z1 is in live mode, I am getting a black texture on the sphere/object I am applying the texture to, and it is saying my current camera is the Z1 in the debug window, but it still has that “Could not connect pins - RenderStream()” error right after.
  • If I unplug the camera, the sphere displays a texture that just shows the Ricoh Theta logo with “Theta V FullHD Status: 0x800705AA” error message. So it just finds the next available camera to use as a texture, which I don’t actually have.
1 Like

@RicoB, thank you for reporting back with these detailed results. I will take two actions in parallel.

  1. I will report this back to some people I know at RICOH
  2. I will also attempt to either replicate the error or get the “fake driver” working

Your information is useful. It sounds similar to the problem we had with the THETA V initially. If you have time, can you post the version of Unity you are using.

1 Like

That’s great news! It’s nice to see a forum being so active and people interested in resolving issues for a relatively “niche” product. Or maybe I hadn’t realized how big the Ricoh 360 camera customer base had grown in the past few years.

Anyway, all my tests have been with Unity 2019.1.0f2. I will try a blank project with the newest version of unity on Monday, though. Was delaying upgrading since we already have a working project using our Nokia OZO, and it’s always a risk upgrading with a product that is no longer technically supported.

1 Like

Alright, so I tried with the newest version of Unity today and it still has the same issue.

One thing I noticed is when I stream the camera live in MPC-HC, a big “LIVE” word starts blinking on the camera’s small screen. When I play the scene in Unity, the camera quickly flashes the “LIVE” words then it disappears, as if it connected to it for a second, then just disconnects due to the “connect pins” issue.

Thanks for this report on your tests. We saw a similar thing with the THETA V. MPC-HC could detect the hardware device driver (THETA V or THETA Z1) on Windows. However, other software such as Unity and OBS (Open Broadcaster Software) required the use of the software device driver. In addition, Unity also needed non-blank fields as described above.

Just so you know, for the THETA V,

Web Cam Device Used On Note
THETA V Mac OS and Windows only with MPC_HC no driver software needed
THETA V FullHD and THETA V 4K Other Windows software like OBS driver software needed on Windows
THETA V FullHD and THETA V 4K with update for Unity Works on most Windows software, including Unity Basically incorporated the community hack for “software driver info” into the official driver

The Windows software for the THETA V I’m referring to is here:

https://topics.theta360.com/en/faq/c_06_v/304_1/

This software may need to be updated for the THETA Z1.

I’m sharing old information right now, I need to test this more with the Z1 before I have an opinion on the current state of Z1 live streaming with Unity.

Note that if you have access to MacOS, it might be worth trying Unity on MacOS as it uses a different driver. The test below with the THETA V was done on a Windows machine with dual-boot MacOS.

Update 10/1 I am looking for the software driver for the Z1. Have you seen any download links for a Z1 live streaming driver? I have a note out to a person at RICOH about this.

On the Z1, I have this device on Windows 10, but it is not appearing in OBS.

image

If it’s not working on OBS, I don’t think it will work on Unity. I’m going to try and get the Z1 to stream with OBS before I test it with Unity.

I tried to stream with MPC-HC and I can’t get the video stream to appear right now.

image

Is the video stream appearing inside of the preview window of MPC-HC? Can you post a screenshot of your settings?

@craig I finally got the Z1 working in Unity and OBS! It’s probably because of you, since you said you might be able to contact people at Ricoh.

They just released a UVC4K software for the Z1. Here’s the link (found it in the FAQ): https://topics.theta360.com/en/faq/c_00_z1/304_1/

Once installed, it created a new “Camera” entry in the registry called “RICOH THETA Z1 FullHD” (Probably does other magic too, not sure). But now, you can specify that name instead of the regular “RICOH THETA Z1” in your code in Unity, it works. In OBS, “RICOH THETA Z1 FullHD” now appears as a camera choice.

Anyway, thanks so much for your help @craig

Here’s my code that I attached to a sphere to test it:

using UnityEngine;

public class getRicohStream : MonoBehaviour
{

static WebCamTexture myCam;
string selectedDeviceName = "RICOH THETA Z1 FullHD";

void Start()
{

    Renderer renderer = GetComponent<Renderer>();

    if (myCam == null)
            myCam = new WebCamTexture(selectedDeviceName, 1920, 960);

        renderer.material.mainTexture = myCam;

    if (!myCam.isPlaying)
    myCam.Play();

}

}

2 Likes

Nice! This is fantastic. I have it working with OBS and am upgrading Unity and Visual Studio in order to change my application from THETA V 4K to THETA Z1 4K. Just an FYI, the 4K driver is higher resolution, but you may experience lag if you’re transmitting the stream over the Internet.

Great! I could only get FullHD version to be recognized in Unity for some reason. It is showing up in the registry, so I’m not sure why. I’ll try reinstalling it, or maybe even restarting my computer :thinking:

By the way, I posted a little guide for anyone interested in getting their camera stream as a Unity skybox instead of a sphere:

1 Like

Thank You for this! That conversation was exactly what I was going through. I got the 4K in Unity as well though following the same steps you did.

2 Likes