|
@@ -981,20 +981,23 @@ class CameraServices
|
|
mkdir('/www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path, 0777, true);
|
|
mkdir('/www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path, 0777, true);
|
|
}
|
|
}
|
|
|
|
|
|
-// $mine_list = DB::table('mine_list')
|
|
|
|
-// ->select('mine_list.degree')
|
|
|
|
-// ->leftJoin('camera_list','camera_list.mine_id','=','mine_list.id')
|
|
|
|
-// ->where('$camera_id',$camera_id)->get();
|
|
|
|
-// $id = explode('|',$mine_list[0]->degree)[0];
|
|
|
|
-// $mine_res = DB::table('mine_list')->where('id',$id)->get();
|
|
|
|
-// if(in_array($mine_res[0]->title,config('mine_code'))){
|
|
|
|
-// dd(123);
|
|
|
|
-// }else{
|
|
|
|
-// dd(456);
|
|
|
|
-// }
|
|
|
|
|
|
+ $mine_list = DB::table('mine_list')
|
|
|
|
+ ->select('mine_list.degree')
|
|
|
|
+ ->leftJoin('camera_list','camera_list.mine_id','=','mine_list.id')
|
|
|
|
+ ->where('camera_list.id',$camera_id)->get();
|
|
|
|
+ if(isset($mine_list)){
|
|
|
|
+ $mine_id = explode('|',$mine_list[0]->degree)[0];
|
|
|
|
+ $mine_res = DB::table('mine_list')->where('id',$mine_id)->get();
|
|
|
|
+ }
|
|
|
|
+ //取流进程
|
|
|
|
+ if(isset($mine_res[0]->title) && in_array($mine_res[0]->title,config('mine'))){
|
|
|
|
+ $exec = 'nohup /usr/bin/ffmpeg -rtsp_transport tcp -i "' . $video_url . '" -b:v 200k -c:v libx264 -c:a copy -s 384*288 -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 -threads 4 /www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path . '/' . CameraEnum::M3U8_FILE_NAME . ' >/dev/null &';
|
|
|
|
+ }else{
|
|
|
|
+ $exec = 'nohup /usr/bin/ffmpeg -i "' . $video_url . '" -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 /www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path . '/' . CameraEnum::M3U8_FILE_NAME . ' >/dev/null &';
|
|
|
|
+ }
|
|
|
|
|
|
//取流进程
|
|
//取流进程
|
|
- $exec = 'nohup /usr/bin/ffmpeg -i "' . $video_url . '" -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 /www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path . '/' . CameraEnum::M3U8_FILE_NAME . ' >/dev/null &';
|
|
|
|
|
|
+// $exec = 'nohup /usr/bin/ffmpeg -i "' . $video_url . '" -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 /www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path . '/' . CameraEnum::M3U8_FILE_NAME . ' >/dev/null &';
|
|
|
|
|
|
// $exec = 'nohup /usr/bin/ffmpeg -rtsp_transport tcp -i "' . $video_url . '" -b:v 200k -c:v libx264 -c:a copy -s 384*288 -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 -threads 4 /www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path . '/' . CameraEnum::M3U8_FILE_NAME . ' >/dev/null &';
|
|
// $exec = 'nohup /usr/bin/ffmpeg -rtsp_transport tcp -i "' . $video_url . '" -b:v 200k -c:v libx264 -c:a copy -s 384*288 -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 -threads 4 /www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path . '/' . CameraEnum::M3U8_FILE_NAME . ' >/dev/null &';
|
|
shell_exec($exec);
|
|
shell_exec($exec);
|