Browse Source

fmmpeg推流命令修改

任敬轩 3 năm trước cách đây
mục cha
commit
523246e132
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      Modules/Camera/Services/CameraServices.php

+ 2 - 1
Modules/Camera/Services/CameraServices.php

@@ -980,7 +980,8 @@ class CameraServices
             mkdir('/www/wwwroot/video.nxjiewei.com/public/' . CameraEnum::M3U8_FILE_PATH . '/' . $path, 0777, true);
         }
         //取流进程
-        $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 &';
         shell_exec($exec);
 
         //sleep10秒生成文件