QX1 上非常需要M(手动)曝光模式。我正在寻找我的问题的答案,但没有找到确切的答案。我可以通过 API 在 QX1 上选择全手动曝光模式吗?
3 回答
不,您不能使用 QX1 相机上的当前固件设置手动模式。
您应该使用getAvailableExposureMode或getSupportedExposureMode API 方法来检索支持的模式(并可选择将它们显示给用户),然后在setExposureMode中使用其中一种模式。
但是QX1 相机不支持手动模式,因此 getSupported/Available 方法不会返回它,这就是 API 将错误返回给setExposureMode调用的原因。
该 API 旨在支持具有多种不同功能的多款 SONY 相机。对于每个属性,您都有以下 API 方法:
- getSupportedProperty -> 返回相机支持的属性值。
- getProperty -> 返回属性的实际值
- setProperty -> 允许为属性设置新值
- getAvailableProperty -> 返回当前值和支持的值。
这样,如果应用程序编码良好,它将支持所有相机。
因此,这不是 API 问题,而是固件问题。QX1 的当前固件不支持手动模式。
还没有官方固件更新:(
https://esupport.sony.com/US/p/model-home.pl?mdl=ILCEQX1&LOC=3#/downloadTab
你有没有试过在这里找到:https ://github.com/erik-smit/sony-camera-api/blob/master/actEnableMethods.sh
此处对此 hack 的其他参考:http ://chdk.setepontos.com/index.php?topic=10736.10 我无法让它工作,但如果它可以以任何方式帮助您的研究
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);
}
}
看来你可以。根据此处的表格,您可以在 QX1 上设置曝光模式。您可以将setExposureMode
API 方法与以下 JSON 类似:
{
"method": "setExposureMode",
"params": ["Manual"],
"id": 1,
"version": "1.0"
}
资源:
从https://developer.sony.com/develop/cameras/get-started/下载的 API 参考