|
@@ -311,6 +311,44 @@ class HaiKangController extends BaseController
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function getHkRtsp($camera_id){
|
|
|
|
+ $result['status'] = true;
|
|
|
|
+ $result['msg'] = ApiEnum::RETURN_SUCCESS;
|
|
|
|
+
|
|
|
|
+ $query = CameraList::where('id',$camera_id)->first();
|
|
|
|
+
|
|
|
|
+ if (!$query) {
|
|
|
|
+ $result['status'] = false;
|
|
|
|
+ $result['msg'] = ApiEnum::NO_CAMERA_URL;
|
|
|
|
+ return $result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($query->code_stream == 2){
|
|
|
|
+ $code_stream = 0;
|
|
|
|
+ }else{
|
|
|
|
+ $code_stream = 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $url = $this->artemis.'/api/video/v1/cameras/previewURLs';
|
|
|
|
+ $params['cameraIndexCode'] = $query->index_code;
|
|
|
|
+ $params['streamType'] = $code_stream; //0主码流 1子码流 2第三码流
|
|
|
|
+ $params['protocol'] = 'rtsp';
|
|
|
|
+ $params['transmode'] = 1; //0:UDP 1:TCP
|
|
|
|
+ $params['expand'] = 'streamform=rtp';
|
|
|
|
+
|
|
|
|
+ $this->sign = $this->get_sign($url);
|
|
|
|
+
|
|
|
|
+ $rtsp = $this->curlPost($this->pre_url . $url, json_encode($params));
|
|
|
|
+
|
|
|
|
+ $rtsp = json_decode($rtsp, true);
|
|
|
|
+
|
|
|
|
+ $data = [
|
|
|
|
+ 'url' => $rtsp['data']['url'],
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
//海康easy_drawin获取rtsp并推流
|
|
//海康easy_drawin获取rtsp并推流
|
|
public function getRtspByCameraId(){
|
|
public function getRtspByCameraId(){
|
|
$result['status'] = true;
|
|
$result['status'] = true;
|