From 3d05aedd9ab3c96f4460328c636b3b270961ed37 Mon Sep 17 00:00:00 2001 From: Christopher Latza Date: Tue, 16 Jun 2020 00:50:59 +0200 Subject: [PATCH] use dump to record --- start.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/start.php b/start.php index 505622c..9389e91 100644 --- a/start.php +++ b/start.php @@ -13,7 +13,7 @@ while(TRUE) if(($lastOnlineTime + 60) < time()) { $fileName = "output-".md5(time().rand(11111,99999)).".gif"; - $videoFileName = md5(time().rand(11111,99999)).".avi"; + $videoFileName = md5(time().rand(11111,99999)).".flv"; echo "Checking stream and creating image...\n"; //system("ffmpeg -i ".$StreamURL." -vframes 1 -q:v 2 -vf scale=535:346 ".$fileName); @@ -54,13 +54,8 @@ while(TRUE) $result = file_get_contents($DiscordWebhook, false, stream_context_create($startOptions)); echo "done.\n"; - system('screen -dm ffmpeg -i '.$StreamURL.' "fps=24,scale=-1:720" tmp/rtmp/'.$videoFileName); - sleep(1); - $lastOnlineTime = time(); - system("rtmpdump -r ".$StreamURL." -m 15 -o /dev/null"); - - system("killall -9 ffmpeg"); + system("rtmpdump -r ".$StreamURL." -m 15 -o tmp/rtmp/'.$videoFileName"); if(($lastOnlineTime + 10) < time()) {