gpt4 book ai didi

php - 如何使用 php 获取 FFMPEG -progress url 数据

转载 作者:行者123 更新时间:2023-12-04 23:31:40 25 4
gpt4 key购买 nike

我正在使用 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';

我在循环 $_POST带有foreach 的progress.php 中的变量,但没有得到任何结果。

文件头是:
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);

最佳答案

使用进度与 URL 的示例,例如:

ffmpeg -progress http://127.0.0.1/progress.php -i ........

关于php - 如何使用 php 获取 FFMPEG -progress url 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44631111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com