Capture Video using theta iOS SDK

Hi, Wanted to check on how we can capture video using Ricoh Theta iOS SDK? Current in their sample code I see only 360 images can be captured.

Any suggestion on this will be really helpful.

Thanks,
Prateek

If you’re referring to video to file, you can use the webAPI with an HTTP POST command.

Overview

Set capture mode to video
Capture_mode

To start taking a video, use this:
Camera.start_capture

To stop taking a video, use this:
Camera.stop_capture

You should check the status of the camera to make sure it is ready for the next command. For example, after you stop the video capture, the camera may be busy stitching the video inside the camera. You can use an API call to check the status before giving a command such as listFiles to then download the video file to your mobile phone.

Hi @craig
I tried below json for the camera.startCapture API:

{
    "name": "camera.startCapture"
}

but everytime the camera does something else. Mostly it switches to camera mode and takes a 360 photo.
Can you help me what should be the correct body for shooting a 360 video?
Appreciate your help.
Thanks

You must set the mode to video prior to issuing the command. Do not specify mode in the body of the HTTP request for start capture. Leave it blank. Do not put the _mode parameter in the body.

This example in Dart, but you can likely read the syntax and transfer the logic to Swift.

Request

Future<http.Response> startVideo() async {
  var url = 'http://192.168.1.1/osc/commands/execute';

  var data = {
    'name': 'camera.startCapture',
  };

  //encode Map to JSON
  var body = jsonEncode(data);

  var response = await http.post(url,
      headers: {'Content-Type': 'application/json;charset=utf-8'}, body: body);
  print('The HTTP response code is: ${response.statusCode}');
  print('The HTTP response from camera.startCapture is: ');
  prettyPrint('${response.body}');
  return response;
}


Response from startCapture

The HTTP response code is: 200
The HTTP response from camera.startCapture is:
{
  "name": "camera.startCapture",
  "state": "done"
}

Response from stopCapture

PS C:\Users\craig\Documents\Development\ricoh\webapi> .\build\theta.exe stopCapture
{
  "name": "camera.stopCapture",
  "results": {
    "fileUrls": [
      "http://192.168.1.1/files/150100524436344d42013765da9bc400/100RICOH/R0011263.MP4"
    ]
  },
  "state": "done"
}

I updated the example.

https://github.com/theta360developers/webapi/blob/master/lib/commands/start_video.dart

List Equipment

This was tested with Z1 firmware 2.001.

Please list the firmware version and camera model you are using so that we can try and replicate.