| | |
| | | import java.util.Map; |
| | | |
| | | import static cn.gistack.sm.hk.constant.HkConstant.ARTEMIS_PATH; |
| | | import static cn.gistack.sm.hk.util.GetCameraUtils.GetCameraPreviewURL; |
| | | |
| | | public class GetCameraUtils { |
| | | |
| | |
| | | return common(type,url, body); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | public static void main(String[] args) { |
| | | // |
| | | //// String result = GetCameraResourcePage(1, 10, HkConstant.cameras); |
| | | //// |
| | | //// JSONObject jsonObject1 = JSONObject.parseObject(result); |
| | | //// JSONObject res1 = (JSONObject) jsonObject1.get("data"); |
| | | //// JSONArray arr1 = JSON.parseArray(res1.getString("list")); |
| | | //// JSONObject data1 = (JSONObject) arr1.get(1); |
| | | //// String code1 = data1.get("cameraIndexCode").toString(); |
| | | // String previewURL = GetCameraPreviewURL(1, HkConstant.previewURLs, |
| | | // "0c4f30948dde4998a676ec6983119cb5", |
| | | // "rtsp", |
| | | // "transcode=1&videotype=h264"); |
| | | // System.out.println("previewURL = " + previewURL); |
| | | |
| | | // String result = GetCameraResourcePage(1, 10, HkConstant.cameras); |
| | | // |
| | | // // 云台控制 |
| | | //// String right = controlling(HkConstant.controllingURLs, |
| | | //// "ff1f050afd1c47829dec1ec14575c9e3", |
| | | //// 0, |
| | | //// "ZOOM_OUT", |
| | | //// null, |
| | | //// null |
| | | //// ); |
| | | //// System.out.println("right = " + right); |
| | | // JSONObject jsonObject1 = JSONObject.parseObject(result); |
| | | // JSONObject res1 = (JSONObject) jsonObject1.get("data"); |
| | | // JSONArray arr1 = JSON.parseArray(res1.getString("list")); |
| | | // JSONObject data1 = (JSONObject) arr1.get(1); |
| | | // String code1 = data1.get("cameraIndexCode").toString(); |
| | | |
| | | // 云台控制 |
| | | // String right = controlling(HkConstant.controllingURLs, |
| | | // "ff1f050afd1c47829dec1ec14575c9e3", |
| | | // 0, |
| | | // "ZOOM_OUT", |
| | | // null, |
| | | // null |
| | | // ); |
| | | // System.out.println("right = " + right); |
| | | |
| | | // // 放大 |
| | | // String big = selZoomURLs(HkConstant.selZoomURLs, |
| | | // "ff1f050afd1c47829dec1ec14575c9e3", |
| | | // 55, |
| | | // 58, |
| | | // 22, |
| | | // 23 |
| | | // ); |
| | | // System.out.println("big = " + big); |
| | | |
| | | // 抓图 |
| | | // String manualCapture = manualCaptureUrls(HkConstant.manualCaptureUrls, |
| | | // "ff1f050afd1c47829dec1ec14575c9e3"); |
| | | // System.out.println("manualCapture = " + manualCapture); |
| | | |
| | | //根据设备编号获取子节点编号 |
| | | // String result2 = QueryCameraPreviewURL(HkConstant.camerasID, code1, "camera", "parentIndexCode"); |
| | | // |
| | | //// // 放大 |
| | | //// String big = selZoomURLs(HkConstant.selZoomURLs, |
| | | //// "ff1f050afd1c47829dec1ec14575c9e3", |
| | | //// 55, |
| | | //// 58, |
| | | //// 22, |
| | | //// 23 |
| | | //// ); |
| | | //// System.out.println("big = " + big); |
| | | // |
| | | // // 抓图 |
| | | //// String manualCapture = manualCaptureUrls(HkConstant.manualCaptureUrls, |
| | | //// "ff1f050afd1c47829dec1ec14575c9e3"); |
| | | //// System.out.println("manualCapture = " + manualCapture); |
| | | // |
| | | // //根据设备编号获取子节点编号 |
| | | //// String result2 = QueryCameraPreviewURL(HkConstant.camerasID, code1, "camera", "parentIndexCode"); |
| | | //// |
| | | //// JSONObject jsonObject2 = JSONObject.parseObject(result2); |
| | | //// JSONObject res2 = (JSONObject) jsonObject2.get("data"); |
| | | //// JSONArray arr2 = JSON.parseArray(res2.getString("list")); |
| | | //// JSONObject data2 = (JSONObject) arr2.get(0); |
| | | //// String code2 = data2.get("indexCode").toString(); |
| | | // //ff1f050afd1c47829dec1ec14575c9e3 |
| | | // //e2cb261e14144f53a300769839d54753 |
| | | // //根据子节点编号获取设备播放地址 |
| | | //// String result3 = GetCameraPreviewURL(HkConstant.previewURLs, |
| | | //// "0113d3498d2e41caaf9e5355d1575da3", ProtocolConstant.WS); |
| | | //// JSONObject jsonObject = JSONObject.parseObject(result3); |
| | | //// Map map = (Map) jsonObject.get("data"); |
| | | // //根据子节点编号获取音频对讲地址 |
| | | //// String result4 = GetTalkURLs(HkConstant.talkURLs, code1); |
| | | // |
| | | //// System.out.println("result结果示例: " + result); |
| | | //// System.out.println("result1 = " + result1); |
| | | //// System.out.println("result2 = " + result2); |
| | | //// System.out.println("result3 = " + result3); |
| | | //// System.out.println("url = " + map.get("url")); |
| | | //// System.out.println("result4 = " + result4); |
| | | // |
| | | // // 查询回放url |
| | | // JSONObject jsonObject2 = JSONObject.parseObject(result2); |
| | | // JSONObject res2 = (JSONObject) jsonObject2.get("data"); |
| | | // JSONArray arr2 = JSON.parseArray(res2.getString("list")); |
| | | // JSONObject data2 = (JSONObject) arr2.get(0); |
| | | // String code2 = data2.get("indexCode").toString(); |
| | | //ff1f050afd1c47829dec1ec14575c9e3 |
| | | //e2cb261e14144f53a300769839d54753 |
| | | //根据子节点编号获取设备播放地址 |
| | | // String result3 = GetCameraPreviewURL(HkConstant.previewURLs, |
| | | // "0113d3498d2e41caaf9e5355d1575da3", ProtocolConstant.WS); |
| | | // JSONObject jsonObject = JSONObject.parseObject(result3); |
| | | // Map map = (Map) jsonObject.get("data"); |
| | | //根据子节点编号获取音频对讲地址 |
| | | // String result4 = GetTalkURLs(HkConstant.talkURLs, code1); |
| | | |
| | | // System.out.println("result结果示例: " + result); |
| | | // System.out.println("result1 = " + result1); |
| | | // System.out.println("result2 = " + result2); |
| | | // System.out.println("result3 = " + result3); |
| | | // System.out.println("url = " + map.get("url")); |
| | | // System.out.println("result4 = " + result4); |
| | | |
| | | // 查询回放url |
| | | // HkVO hk = new HkVO(); |
| | | // hk.setCameraIndexCode("0c4f30948dde4998a676ec6983119cb5"); |
| | | // hk.setBeginTime("2023-05-08T11:52:16.000+08:00"); |
| | |
| | | // String common = common(HkConstant.playbackURLs, body); |
| | | // |
| | | // System.out.println("common = " + common); |
| | | // } |
| | | } |
| | | } |