author : Robert Katter
This is a copy of Robert Katter's script from the theta360.guide community forum. Original post
Use Python to view a motionjpeg stream in equirectangular format from RICOH THETA cameras. This example uses OpenCV.
- connect camera in client mode
- change information below to the IP address and serial number of your camera
- if using pipenv, run:
git clone git@github.com:codetricity/ricoh_theta_mjpeg_opencv.git
cd ricoh_theta_mjpeg_opencv
pipenv install
pipenv shell
python main.py
Refer to code and change lines below
url = http://[Camera IP Address]/osc/commands/execute
username = "CameraSerialNumber"
password = "DigitsOnlyofCameraSerialNumber"
# example information
# url = 'http://192.168.2.101/osc/commands/execute'
# username = "THETAYL00105377"
# password = "00105377"
You can specify a different version of Python.
If you want to use Python 3.11, you can do this
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11
Tested on Linux Ubuntu 22.04 and Windows 11 WSL.