ricohapi / theta-client

A library to control RICOH THETA
MIT License
15 stars 11 forks source link

Support Image Bitrate Settings by BitrateNumber? #70

Closed codetricity closed 6 months ago

codetricity commented 6 months ago

Can I set the Image Bitrate to a number between 1048576 and 20971520 ?

I can see that BitrateNumber accepts an int value. However, the documentation indicates that this is the "Movie bit rate value". Can I use this to set the Image bitrate value? I have not had success setting the Image Bitrate using the BitrateNumber.

https://github.com/ricohapi/theta-client/blob/bc2ba2109056aeaececfc19a2f09634a6c9c8d4f/flutter/lib/theta_client_flutter.dart#L1867

The use case is to reduce the size the THETA X 11K images by manipulating the bitrate more precisely. The file size needs to be reduced to improve image load times. There is a blank screen while the image is loading and I want to reduce the time the person sees the blank screen. Current solution is to reduce the resolution of the 11K image to 7K, which reduces the reason to use the THETA X. I don't know if the bitrate solution would help, but I would like to show more examples. This is for the interior shot of an automobile for used car sales using the THETA X.

For the Image Bitrate, do I just have these values? Or, can I use theta-client to adjust it to a specific number?

  static final auto = Bitrate._internal('AUTO');
  static final fine = Bitrate._internal('FINE');
  static final normal = Bitrate._internal('NORMAL');
  static final economy = Bitrate._internal('ECONOMY');

  static final values = [auto, fine, normal, economy];

With camera in image mode, this is what I'm using to test the bitrate and present examples to automotive software developers.

image

If I bypass theta-client, this will work using an http request (not using theta-client):

final body = {
  'name': 'camera.setOptions',
  'parameters': {
    'options': {'_bitrate': '5242880'}
  }
};

Thus, I can set the bitrate in my application. However, I'm trying to move the requests to theta-client for practice. This is not urgent as my application is working using a standard http request. I'm just wondering what the capabilities of theta-client are.

I am getting the value of the bitrate with theta-client and I get the correct numerical value (not the string NORMAL or FINE), which is what I expect.

final responseOptions = await _thetaClientFlutter
    .getOptions([OptionNameEnum.bitrate]);