JavaScript and RICOH THETA API

@erikrod1 and I are working on building a repo with many JavaScript examples to control RICOH THETA cameras through the WebAPI.

I personally am just learning JavaScript. This repo focuses on API commands for controlling THETAs.

If you want to try it, it’s here: GitHub - theta360developers/theta-javascript: Building JavaScript examples to control RICOH THETA cameras through the WebAPI

Coolness! You can test it without a THETA

There is a cloud API called fake-theta that allows you to test API commands without a THETA. We forked it and added some good THETA X test images.

I am using Node.js, so I can run JavaScript programs from the command line. I’m running version 18.15.0. I am on a MacBook Air, running Node.js from the Terminal. I connect directly to my THETA X by Wi-Fi.

Contributions or comments are welcome. Please try using it yourself.

Notes

  • If you do a Pull Request with a .js file, it must be runnable as-is.

  • Your JavaScript must use ES Modules. As of ES6 (ES2015), JavaScript supports a native module format called ES Modules, or ECMAScript Modules. This approach uses the export and import keywords, instead of the older CommonJS syntax of module.exports and require.

  • @erikrod1 and I will be adding more protocols, commands, and options from the THETA API to the repo, so if you don’t see what you’re looking for - well, first of all, feel free to add it yourself! - please ask or come back again soon and see what’s been added!

1 Like

suggest you add sub-directories for commands specific to the X, Z1, and SC2.

See this issue assigned to you.

For example, for the THETA, there are two file formats for video that I was not aware of before.

“type”: “mp4”,”width”: 5760,”height”: 2880, “_codec”: “H.264/MPEG-4 AVC”, “_frameRate”: 5}
{“type”: “mp4”,”width”: 5760,”height”: 2880, “_codec”: “H.264/MPEG-4 AVC”, “_frameRate”: 2}

These files look like they may contain IMU data in CAMM format. Can you check?

Also, can you compare the file size to the 8K 2fps and 8K 5fps videos?

the preview format is also different.

I’m put some of the commands from the repo you’re building into React Native Expo apps.

React Native Expo Super Beginner Intro with RICOH THETA API - No Camera Needed - Pt. 1

React Native Expo Beginner Tutorial with RICOH THETA Images - Pt. 2

Just adding X-specific, Z1-specific, and SC2-specific directors. So far, I’ve only put in _cameraControlSource in the X directory. This turns off the LCD while you’re controlling it with your mobile app. If you’re programming with an X, you should probably be using this option, which is set using camera.setOptions.

In the bitrate settings, the 2.00.0 firmware of the X has a lower bitrate setting. It would be good to test the save of the video file at different bitrates. This might be something that Erik could do.