我使用FFMPEG进行直播,我使用以下参数:
$start_command = DOCROOT.'bin/ffmpeg -y -nostdin -hide_banner -loglevel warning -err_detect ignore_err -user_agent "'.$user_agent.'" -nofix_dts -start_at_zero -copyts -vsync 0 -correct_ts_overflow 0 -avoid_negative_ts disabled -probesize '.$stream_probesize.' -analyzeduration '.$stream_analyze_duration.' -progress http://127.0.0.1:'.getbroadcastport($get_stream['stream_server_id']).'/_lib/lib.progress.php?stream_id='.$stream_id.' -i '.$stream_source.' -vcodec copy -scodec copy -acodec copy -individual_header_trailer 0 -f segment -segment_format mpegts -segment_time 10 -segment_list_size 6 -segment_format_options mpegts_flags=+initial_discontinuity:mpegts_copyts=1 -segment_list_type m3u8 -segment_list_flags +live+delete -segment_list '.DOCROOT.'streams/'.$stream_id.'_.m3u8 '.DOCROOT.'streams/'.$stream_id.'_%d.ts';我使用foreach在progress.php中循环$_POST变量,但是没有得到任何结果。
文件头为:
127.0.0.1:5255close*/*Lavf/57.62.100chunked我该怎么做才能从进度URL中获取ffmpeg信息?
我的进度php是这样的:
$req = '';
foreach($_POST as $key => $value){
$req .= $key.$value;
}
file_put_contents(DOCROOT.'streams/'.$_GET['stream_id'].'_progress.log', $req);
发布于 2017-11-28 22:18:51
下面是一个使用带有URL的进度的示例:
ffmpeg -progress http://127.0.0.1/progress.php -i ........https://stackoverflow.com/questions/44631111
复制相似问题