Connecting RICOH THETA Z1 with Unity

Thank you for your assistance!

I will delve into it further and explore potential solutions.
Should I make any progress, I’ll be sure to post it.

Keeping my fingers crossed for a positive outcome!

1 Like

have you tested the source filters of OBS?

Greetings,

No, I haven’t tested the OBS filters.

However, I discovered that the issue was with Unity. After some testing, I realized that I was using the wrong type of material, Lit, instead of Unlit. Additionally, I encountered a peculiar situation where I had to choose “Universal Render Pipeline/Unlit” rather than the standard Unlit option to render the inside of the sphere correctly, despite flipping the normals.

Here are some screenshots comparing the Before (Lit Material) with the After (Unlit Material):

I also want to share another observation. Initially, when I projected the 360º image onto the sphere, I noticed some distorted lines, especially around the plinth. I experimented with changing the shape of the sphere, making it more oval or even flattening some sides, but these adjustments didn’t yield the desired results. What proved to be more effective in reducing distortion was adjusting the size of the sphere. Ultimately, I settled on a diameter of 1f. While I haven’t yet determined a direct correlation between sphere size and lens type, through trial and error, I found that this size minimized distortion the most.

In the images I used to showcase the difference between Lit and Unlit materials, one can also observe the disparity in distortion. In the first image with the Lit material, the distortion in the lines is much clearer, whereas in the second image with the Unlit material, the distortion was significantly reduced.

2 Likes

You did this by connecting z1 to obs via usb as webcam and then from obs which format (rtno, webrtc, etc?) and encoding and resolution was used to stream to quest 2? In quest you were running a unity app?

Wow! Thanks for sharing these tips. I’m sure these will help other people. As I mentioned, I’m not that experienced with Unity and didn’t know about the unlit versus lit material.

Additionally, I encountered a peculiar situation where I had to choose “Universal Render Pipeline/Unlit” rather than the standard Unlit option to render the inside of the sphere correctly, despite flipping the normals.

Are you using the skybox as suggested by RicoB?

We were originally using a sphere with flip normals. However, most people started using the skybox technique to avoid the vertices.

The picture in your example looks fantastic.

1 Like

This is really cool! Thanks for posting. I don’t use Unity with THETA much but I did a VR demo at DeveloperWeek several years ago and I remember us having I believe the exact same issue. Thanks for the information!

1 Like

How I achieved live feed visualization from Theta Z1 in Unity using two different methods:

First Method - USB:

  1. Installed the UVC Driver.
  2. Connected the camera to the PC via USB.
  3. Set up the camera source in OBS as Video Capture Device.
  4. To pass the live feed to Unity, I utilized the virtual camera feature in OBS, as described in my initial post.
  5. Finally, the image is projected onto a sphere with inverted normals (I used an Unlit texture for the appropriate coloration and brightness).

Second Method - RTSP Connection (implemented this afternoon):

  1. Installed the Theta RTSP Streaming plug-in on the Z1.
  2. Connected the Z1 via CL (currently tested on 2.4GHz).
  3. Identified the camera’s IP.
  4. In OBS, selected Media Source as the source and input the following URL: rtsp://user:pass@camIP:8554/live?resolution=1920x960.
    (We can use diferent resolutions as stated in: THETA RTSP Streaming)
  5. To stream to Unity, I’m still using the Virtual cam.

In terms of virtual reality, I’m using the HTC Vive Pro 2 kit in conjunction with Steam VR.

Currently, due to a considerable delay (I haven’t tested to determine the exact value yet), I’m attempting to use the 5GHz connection, but I’m not succeeding because the camera is not able to connect to the router. Does anyone has any ideas regarding this aspect?

2 Likes

No, I’ve been using a sphere, but I’m going to give it a try with the skybox.

1 Like

You can set 5GHz in the API or the mobile app. The Z1 will not automatically switch from 2.4GHz to 5GHz. This is a one-time setup.

with api

theta-api-specs/theta-web-api-v2.1/options/_wlan_frequency.md at main · ricohapi/theta-api-specs · GitHub

With mobile app

https://support.theta360.com/en/manual/z1/content/settings/settings_02.html

wow, good memories from the past. June 2018.

Did you show the moth in the demo?

I remember that I was interested in Mothra from the Godzilla movies and I was trying to get an asset similar to Mothra for the demo.

2 Likes

I see, I wonder how much better would it look like in HDR mode and h.265 encoding. 1920x960 seems a bit low for a HMD device.

Are you familiar with VLC-Unity? I’m aiming to directly to stream into headsets, without need of a PC and OBS Studio, using SRT stream directly of the plugin I developed. So in theory could stream to Unity on Meta Quest 2/3 but I assume other Unity compatible devices should work. Grabbing HDR preview of the Z1 in camera makes a huge difference in image quality and adjusting brightness, etc. in camera. Of course plugin also works to stream to OBS as capture device wirelessly.

So Unity is running on a high end PC and HTC Vive Pro 2 is used as display connecting with wires?

In the old demo from June 2018, we had the HTC Vive connected to a Windows PC with wires. Back then (5 or 6 years ago), we needed a gaming laptop with discrete mid-range GPU card (higher end for laptops) for demos. In 2024, think that a normal laptop can handle things

I have not tried VLC-Unity yet. It’s a library, so we would need some sample code to get the stream into Unity.

Note that RicoB had the comment below regarding the inverted sphere.

if you decide to use it [inverted sphere] in room-scale VR - the sphere won’t move with you and it’ll just be weird (unless you make the sphere huge).

I’m not sure if that consideration is relevant to your application.

I’ve heard of it, but I haven’t worked with it yet

I still have little experience of working with cameras, but I imagine HDR will help a lot.

As @craig said,

Personally, I’m using a laptop with 32 Gb of ram, a Ryzen 9 7945HX and an RTX 4060, and I’ve had no problems.
In terms of the HTC Vive, (I hope I’m not talking rubbish), but from what I know, I always need an auxiliary computer to run the application. However, PC - Headseat communication is wireless.

1 Like

In relation to the 2.4Ghz to 5Ghz:

I followed the mobile app guide, but I still can’t connect to the 5Ghz band.

I’m not sure if I’ve missed a step or if it’s something else.

In relation to the projection on the sphere:

For my application, as I only use the rotation of the user’s head (I don’t use the position), using a sphere doesn’t prove to be a problem.

The camera is exhibiting unexpected behavior. The expected behavior is to be able to connect at 5GHz with just the one setting change. Are you sure your router or mobile phone is set to 5GHz only or 5GHz preferred?

I’m not sure what the source of the problem is. You can try

reset wifi

RICOH THETA Z1 Wi-Fi Reset - #5 by craig

  • press WiFi and mode for 11 seconds
  • camera will reboot
  • after reboot, set to 5GHz again and try it with your mobile phone in AP mode as a test

reset all settings

Same as above, except use this API to reset all settings

theta-api-specs/theta-web-api-v2.1/commands/camera.reset.md at main · ricohapi/theta-api-specs · GitHub

other options

  • call official RICOH customer support Contact | RICOH THETA
  • The Z1 runs Android inside of it. Search for Android cannot connect at 5GHz on Google Search and try to isolate the problem.

Hello,
I hope this message finds you well.

I wanted to provide an update regarding the 5Ghz implementation. Due to other pressing aspects demanding my attention, I had to postpone the implementation. However, I am now working on it.

Despite following all the steps mentioned by @craig, I haven’t been successful in getting it to work yet. My next course of action will be to attempt the setup with a different router. However, this might take some time.

Mean while, I’m also working in a more direct way to connect the Z1 to Unity, maybe I will focus in the VLC-Unity or some other unity plugin.

2 Likes

if you use your mobile phone to connect to the Z1 in Access Point (camera is hotspot) mode, does it connect at 5GHz?

Hi, I’m trying to apply the second method which involve the RTSP connection but I can’t seem to get it to work. My guess is that my URL is wrong. Do you see anything wrong with my URL?rtsp://THETAYN34119099.OSC:HuaxiaWang@192.168.1.5:8554/live?resolution=1920x960.
For user, I put the SSID of my Ricoh Theta Z1. For Password, I put the password I gave my Ricoh Theta Z1. Lastly, for camIP, I put the IP address of my Ricoh Theta Z1 which I found by using my IPhone’s settings app which allows you to see the IP address of a wi-fi network. I also never connected the Z1 via CL (Client Mode I think?) which I’m guessing is also where I could be going wrong as I don’t know how to connect to CL or what CL is? If you could explain if there’s anything you see wrong in my URL and how to connect the Z1 via CL as well as what CL stands for, it would be greatly appreciated.

Are you using the RTSP plugin, the HDR Wireless Live Streaming Plugin, or are you using a Linux computer to produce the RTSP stream.

To ingest on VLC and ffplay

VLC

ffplay

ffplay -fflags nobuffer -i rtsp://<ip_address>:8554/live?resolution=1920x960