QX1, Manual Shoot mode (M) via API

2019-03-17 01:31发布

问题:

Very need M (Manual) Exposure mode on QX1. I was searching for an answer to the my question, but don't found the exact answer. Can I choose the full manual Exposure mode on QX1 via API?

回答1:

No, you can't set Manual mode with the current firmware on a QX1 camera.

You are supposed to use the getAvailableExposureMode or getSupportedExposureMode API methods to retrieve the supported modes (and optionally display them to the user), then use one of only those modes in setExposureMode.

But Manual mode is not supported by the QX1 camera, so it's not returned by the getSupported/Available methods and that's why the API returns the error to the setExposureMode call.

The API is intended to support several SONY cameras with several different features. For each property you have the following API methods:

  • getSupportedProperty -> Returns the property values supported by the camera.
  • getProperty -> Returns the actual value for the property
  • setProperty -> Allows to set a new value for the property
  • getAvailableProperty -> Returns current value and supported values.

That way, if the app is well coded it will support all the cameras.

So, it's not an API problem but a firmware one. The current firmware for the QX1 does not support Manual mode.

There's not an official firmware update yet :(

https://esupport.sony.com/US/p/model-home.pl?mdl=ILCEQX1&LOC=3#/downloadTab



回答2:

have you tried this found here : https://github.com/erik-smit/sony-camera-api/blob/master/actEnableMethods.sh

other references to this hack here: http://chdk.setepontos.com/index.php?topic=10736.10 i could not get it to work but if it can help in your research in any way

public String getDG() throws IOException {
    String service = "accessControl";
    try {
        JSONObject paramsMethods =
                new JSONObject().put("developerName","");
        paramsMethods.put("sg","");
        paramsMethods.put("methods","");
       paramsMethods.put("developerID","");

        JSONObject requestJson =
                new JSONObject().put("method", "actEnableMethods") //
                        .put("params", new JSONArray().put(paramsMethods)) //
                        .put("id", id()).put("version", "1.0");

        String url = findActionListUrl(service) + "/" + service;

        log("Request:  " + requestJson.toString());
        String responseJson = SimpleHttpClient.httpPost(url, requestJson.toString());
        log("Response: " + responseJson);
        JSONArray resultsObj = new JSONObject(responseJson).getJSONArray("result");

        String dg = null;
        JSONObject dgobj = resultsObj.getJSONObject(0);
        dg = dgobj.getString("dg");


        return dg;

    } catch (JSONException e) {
        throw new IOException(e);
    }

}

public String getSG(String dg){
    MessageDigest md;
    String keydg = "90adc8515a40558968fe8318b5b023fdd48d3828a2dda8905f3b93a3cd8e58dc" + dg;
    try {
        md = MessageDigest.getInstance("SHA-256");
        md.update(keydg.getBytes());
        String SG = new String(Base64.encode(md.digest(), 0));

        return SG;
    }catch(Exception e){

    }
    return null;
}

public JSONObject actEnableMethods() throws IOException {
    String DG = getDG();
    String SG = getSG(DG);
    String service = "accessControl";
    try {
    JSONObject paramsMethods =
    new JSONObject().put("developerName","Sony Corporation");
    paramsMethods.put("sg",SG);
    paramsMethods.put("methods","camera/setFlashMode:camera/getFlashMode:camera/getSupportedFlashMode:camera/getAvailableFlashMode:camera/setExposureCompensation:camera/getExposureCompensation:camera/getSupportedExposureCompensation:camera/getAvailableExposureCompensation:camera/setSteadyMode:camera/getSteadyMode:camera/getSupportedSteadyMode:camera/getAvailableSteadyMode:camera/setViewAngle:camera/getViewAngle:camera/getSupportedViewAngle:camera/getAvailableViewAngle:camera/setMovieQuality:camera/getMovieQuality:camera/getSupportedMovieQuality:camera/getAvailableMovieQuality:camera/setFocusMode:camera/getFocusMode:camera/getSupportedFocusMode:camera/getAvailableFocusMode:camera/setStillSize:camera/getStillSize:camera/getSupportedStillSize:camera/getAvailableStillSize:camera/setBeepMode:camera/getBeepMode:camera/getSupportedBeepMode:camera/getAvailableBeepMode:camera/setCameraFunction:camera/getCameraFunction:camera/getSupportedCameraFunction:camera/getAvailableCameraFunction:camera/setLiveviewSize:camera/getLiveviewSize:camera/getSupportedLiveviewSize:camera/getAvailableLiveviewSize:camera/setTouchAFPosition:camera/getTouchAFPosition:camera/cancelTouchAFPosition:camera/setFNumber:camera/getFNumber:camera/getSupportedFNumber:camera/getAvailableFNumber:camera/setShutterSpeed:camera/getShutterSpeed:camera/getSupportedShutterSpeed:camera/getAvailableShutterSpeed:camera/setIsoSpeedRate:camera/getIsoSpeedRate:camera/getSupportedIsoSpeedRate:camera/getAvailableIsoSpeedRate:camera/setExposureMode:camera/getExposureMode:camera/getSupportedExposureMode:camera/getAvailableExposureMode:camera/setWhiteBalance:camera/getWhiteBalance:camera/getSupportedWhiteBalance:camera/getAvailableWhiteBalance:camera/setProgramShift:camera/getSupportedProgramShift:camera/getStorageInformation:camera/startLiveviewWithSize:camera/startIntervalStillRec:camera/stopIntervalStillRec:camera/actFormatStorage:system/setCurrentTime");
    paramsMethods.put("developerID","7DED695E-75AC-4ea9-8A85-E5F8CA0AF2F3");

        JSONObject requestJson =
                new JSONObject().put("method", "actEnableMethods") //
                        .put("params", new JSONArray().put(paramsMethods)) //
                        .put("id", id()).put("version", "1.0");
        String url = findActionListUrl(service) + "/" + service;

        log("Request:  " + requestJson.toString());
        String responseJson = SimpleHttpClient.httpPost(url, requestJson.toString());
        log("Response: " + responseJson);
        return new JSONObject(responseJson);
    } catch (JSONException e) {
        throw new IOException(e);
    }
}


回答3:

It seems you can. Per the table here, you can set the Exposure Mode on the QX1. You can use the setExposureMode API method with something like the following JSON:

{
    "method": "setExposureMode",
    "params": ["Manual"],
    "id": 1,
    "version": "1.0"
}

Source:

API Reference downloaded from https://developer.sony.com/develop/cameras/get-started/