RICOH THETA API Over USB Cable - (X, Z1, SC2, V, S, SC models)

You are right, I have a more advanced version


The Theta part is the same. I’m using Theta V, I will probably switch to Z1 in a near future.
Theta is connected in usb and all works with gphoto2 (with a modification in the source code to get the shutterspeed working). There is no live streaming, it takes either photos or videos. I change the RaspberryPi 3b+ with a raspberryPi 4, downloading content from the Theta to the Pi is about 10 times faster. I didn’t have tested the UVC driver yet because I want to keep the original mp4 stream without decoding and mainly because this solution is working fine (live streaming is done with a “standard” low-light usb webcam)
Hugues

2 Likes

Awesome! It looks amazing with the new chassis and wheels.

Is this a security lock or do you attach a tether to the robot in case you need to retrieve it?

That looks like a custom 3d printed mount for the THETA? Looks awesome. Nice work.

Hi there.

I would like to make the recording time of the Theta SC2 video longer than 3 minutes.
Can this be configured using the USB API?

I have tried the following, but could not set it to more than 3 minutes.

ptpcam --set-property=0xD823 --val=1500

Sorry if this is the wrong thread.

thanks,

You can’t override the 3 minute limitation of the SC2 video with an API. For the V or Z1, you can use a plug-in.

If you need longer than 3 minutes, you can use the motionJPEG of the SC2 at 1920x960 @ 30fps and save to permanent storage on the device giving the API command (not the camera). No audio track on the motionJPEG.

1 Like

Update to nickel110 fork of libptp2

I noticed that nickel110 added a new commit to his fork of libptp2

I downloaded his new version and tested it on Ubuntu 21.04

it worked fine to wake up the Z1 and V with a --reset-delay=2000. Note that in my test below, I renamed ptpcam to theta to the original ptpcam unmodified for testing.

All tests below succeeded in waking up both cameras from sleep and putting the cameras to sleep.

craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.

craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ 

# test with V below
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA V
'UNKNOWN' is set to: 0
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA V
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA V
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA V
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA V
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ 


System information used in the test

Camera Info

craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --info

THETA Device Info
==================
Model: RICOH THETA V
  manufacturer: Ricoh Company, Ltd.
  serial number: '00105377'
  device version: 3.70.1
  extension ID: 0x00000006
  image formats supported: 0x00000004
  extension version: 0x006e

RICOH THETA USB API Updated for THETA X

1 Like

This is a GitHub issue that was closed. I am including it here in case other people have the problem.

problem

For the TerminateOpenCapture call, where and how do I pass in the TransactionID.

I am using the Windows MTP example.

I am able to start the video recording with
res = command.Execute(MtpOperationCode.InitiateOpenCapture, new uint[2] { 0, 0 }, null);

but not able to execute the TerminateOpenCapture command.


solution (by original author)

Got it to work with the following command

res = command.Execute(MtpOperationCode.TerminateOpenCapture, new uint[1] { 0xFFFFFFFF }, null);

I connect camera Theta V to Raspberry PI 4 via USB cable. Can I stream it ?
When I connect to Windows machine, it can stream. I open VLC and the device capture name dshow
In Raspberry PI 4, it shows /dev/video10 11, 12, 13, 14, 15, 16. I try make stream from these video but does not work.

RPi4 does not support 4K hardware decoding in the chipset. You cannot display from the HDMI connected to the Raspberry Pi 4. You can use the restream from the RPi4 to another computer like a Windows laptop and display the stream on the Windows laptop. See this example:

If you want use the single board computer to display the stream, I personally use a Jetson Nano 4GB. I see it on Amazon now for $149. It’s more expensive, but better suited for graphics and AI processing.

If you’re just seeing if the RPi4 can work, you can try a 2K stream from the THETA V. Post here if it works. We don’t have a documented success yet.

1 Like

I can use gst_viewer to see the stream from Raspberry PI 4. However it is really lagging: maybe about 0.1fps. May you suggest how to change the gst_viewer.c file in libuvc_theta_sample/gst/ folder to lower resolution ?

this modification has a command line option

Thank you for your help. I am now able to use gst_viewer to view the camera with lower resolution FHD with about 5fps.
I added custom resolution like 1024x512 but gst_viewer does not run.
I planned to make it into stream video rtsp but it seem too slow even with low resolution.

I don’t think that the camera can output 1024x512.

You can use the livePreview motionjpeg to get the stream to the Raspberry Pi 4. Or, use the RTSP plugin that runs inside the camera.