| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * Created by PhpStorm.
- * User: qiuzijian
- * Date: 2021-05-18
- * Time: 15:09
- */
- namespace App\Http\Controllers;
- use Illuminate\Support\Facades\Config;
- use Illuminate\Support\Facades\Input;
- use Illuminate\Support\Facades\Log;
- use Illuminate\Support\Facades\Redis;
- use Modules\Camera\Http\Controllers\Api\HaiKangController;
- use Modules\Camera\Jobs\CameraDownload;
- use Modules\Mine\Entities\MineListExt;
- use Modules\Mine\Services\MineServices;
- class TestsController {
- public function test()
- {
- $hk_result = MineServices::getHaiKangArea(5, 'local');
- dd($hk_result);
- Input::replace(
- [
- 'url' => 'https://10.71.252.64:4433',
- 'key' => '25720460',
- 'secret' => 'qqP7NLcIDwO9MgtYmp8L',
- 'cameraIndexCode' => 'a73931afd8bd4d1aba883699d65793d2',
- 'protocol' => 'rtmp',
- ]
- );
- $haikang = new HaiKangController();
- $result_hk = $haikang->getCamerasUrl();
- $arr = explode('/', $result_hk['data']['url']);
- $path = end($arr);
- // echo $result_hk['data']['url'];
- mkdir('/home/video_system/public/files/video/m3u8/' . $path, 0777, true);
- $exec = 'nohup /usr/bin/ffmpeg -i ' . $result_hk['data']['url'] . ' -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f hls -hls_flags delete_segments -segment_list_size 10 -hls_list_size 2 /home/video_system/public/files/video/m3u8/' . $path . '/out.m3u8 >/dev/null &';
- echo $exec;
- echo '<br/>';
- $result = shell_exec($exec);
- echo '<br/>';
- dd(111);
- }
- }
|