Start and stop plugin from the API

Hi !

I want to control the Theta V streaming from a python script.
So far here is what I can do :

  • show which plugin is “active” (camera._lisPlugins)
  • activate RTMP plugin (camera._setPlugin)
  • start the active plugin (camera._pluginControl, option=boot)
  • stop the active plugin (camera._pluginControl, option=finish)
    So far, so good !

Then I restart the active plugin (camera._pluginControl, option=boot) and start to actually stream (with the web page of the plugin). After a moment, I stop the streaming.
After that point, I have a 404 error whenever I try to execute a command (commands/execute)

The only solution is to stop the plugin by pressing the MODE button.

Any idea ?

My code is here : https://gitlab.com/denisbg/theta-v/blob/master/theta_plugin.py

Thnaks in advance for your help !

Just to confirm, when you use the API to stop the plug-in, you can no longer access the web API?

However, when you stop the plug-in from the “mode” button, you can access the web API?

If so, can you start and stop other plug-ins with the API?

Here is the workflow :

  • API (POST osc/commands/execute…) : start plugin OK (led turns white)
  • API : stop plugin OK (led turns blue)

But :

  • API : start plugin OK (led turn white)
  • WEB or Shutter button : start streaming (led blinking red)
  • WEB or shutter button : stop streaming (led stops blinking red)
  • API : stop plugin Not OK, error 404

At this point, I can get information (GET osc/info) or state (POST osc/state).
But I can’t execute any command (POST osc/commands/execute). I always have a 404 error.
So I can’t start/stop other plugins.

If I stop the plugin with the MODE button, I can access POST osc/commands/execute

As a test, can you try and stop a simpler plug-in with the API? For example, Time Shift Shooting?

I have not tried the API yet.

I was just thinking that while the plug-in is running, I don’t think you can access the webAPI from an external computer, like a laptop running the Python script.

I came here to make a thread about this same issue. I’m also using the live streaming plugin, and activating/deactivating it via the api. I can activate the plugin fine, and I can deactivate the plugin fine, only as long as I never actually streamed.

To make it clear, this is what works:

  1. activate streaming plugin with api
  2. deactivate streaming plugin with api

This is what does not work:

  1. activate streaming plugin with api
  2. stream (either with api, or by pressing shutter button, I’ve tried both)
  3. deactivate streaming plugin with api (FAILS!)

It might be the plugin code itself, but I’m not confident in that. I can still get the battery level over the api while the streaming plugin is activated, so the plugin hasn’t shut down the camera’s “primary” http server.

1 Like

thanks for reporting on this. It’s especially useful that you indicated that you can get the battery level over the API. I’m in the process of writing a report of feedback from the community that I will send to RICOH. I’ll incorporate this. Of course, the best thing is if we can solve this ourselves. :slight_smile:

Are you using a RICOH THETA V for the Wireless Live Streaming?

That’s right. I’m the projection artist involved in a dance show that is heavy on tech. I’m using the Theta V to live stream dancers in a difference location into the theater. The most important thing to me is being able to activate the plugin + activate streaming remotely over the network. Shutting down the plugin remotely is nice because it conserves battery (drain rate of 20%/hr vs 50%/hr), but it’s not critical.

I can try to do some experiments over the next few weeks with the plugin issue, but I can’t guarantee I’ll have time. I found a few interesting quirks about the livestreaming plugin that I want to fix. For example, the capture resolution of the camera is hardcoded to 2K no matter what you select in the web UI. The only thing that the web UI resolution seems to affect is if the plugin will upscale the fixed resolution image before sending it over the network.

I’m also interested in cutting down on the heat produced by the camera during streaming. In my application, I’m able to stitch together the dual paraboloid images in realtime on the GPU, so I don’t need static stitching enabled in the plugin app. I am hoping that will make the camera last longer before overheating. I have attached heatsinks to the body, which seem to help a little as well.

Long post, I’m just very excited about using the camera for this project! Also, Craig, I’ve read many of your posts about the Theta V and they’ve been extremely helpful to the development I’m doing, so thank you!

1 Like