mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Update restreamer.json.php
-re is mandatory on every live-stream . Because the speed will be dancing between x0.5 and x2 . Should be fixed to real time = x1 I'm still debugging somethings , but this one is necessary .
This commit is contained in:
parent
1be4ab0ef4
commit
e48e30fd67
1 changed files with 3 additions and 3 deletions
|
@ -167,7 +167,7 @@ function startRestream($m3u8, $restreamsDestinations, $logFile, $tries = 1) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (count($restreamsDestinations) > 1) {
|
if (count($restreamsDestinations) > 1) {
|
||||||
$command = "{$ffmpegBinary} -i \"{$m3u8}\" ";
|
$command = "{$ffmpegBinary} -re -i \"{$m3u8}\" ";
|
||||||
foreach ($restreamsDestinations as $value) {
|
foreach ($restreamsDestinations as $value) {
|
||||||
if(!isOpenSSLEnabled() && preg_match("/rtpms:/i", $value)){
|
if(!isOpenSSLEnabled() && preg_match("/rtpms:/i", $value)){
|
||||||
error_log("Restreamer.json.php ERROR #1 FFMPEG openssl is not enabled, ignoring $value ");
|
error_log("Restreamer.json.php ERROR #1 FFMPEG openssl is not enabled, ignoring $value ");
|
||||||
|
@ -180,7 +180,7 @@ function startRestream($m3u8, $restreamsDestinations, $logFile, $tries = 1) {
|
||||||
if(!isOpenSSLEnabled() && preg_match("/rtpms:/i", $restreamsDestinations[0])){
|
if(!isOpenSSLEnabled() && preg_match("/rtpms:/i", $restreamsDestinations[0])){
|
||||||
error_log("Restreamer.json.php ERROR #2 FFMPEG openssl is not enabled, ignoring {$restreamsDestinations[0]} ");
|
error_log("Restreamer.json.php ERROR #2 FFMPEG openssl is not enabled, ignoring {$restreamsDestinations[0]} ");
|
||||||
}else{
|
}else{
|
||||||
$command = "ffmpeg -i \"{$m3u8}\" -max_muxing_queue_size 1024 -acodec copy -bsf:a aac_adtstoasc -vcodec copy -f flv \"{$restreamsDestinations[0]}\"";
|
$command = "ffmpeg -re -i \"{$m3u8}\" -max_muxing_queue_size 1024 -acodec copy -bsf:a aac_adtstoasc -vcodec copy -f flv \"{$restreamsDestinations[0]}\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(empty($command) || !preg_match("/-f flv/i", $command)){
|
if(empty($command) || !preg_match("/-f flv/i", $command)){
|
||||||
|
@ -251,4 +251,4 @@ function killIfIsRunning($m3u8){
|
||||||
|
|
||||||
function replaceSlashesForPregMatch($str){
|
function replaceSlashesForPregMatch($str){
|
||||||
return str_replace('/', '.', $str);
|
return str_replace('/', '.', $str);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue