church_vod/www/start_the_recording.lua

32 lines
1.4 KiB
Lua

local arg_output = ngx.var.arg_output
if not arg_output then
ngx.say("Missing query 'output'")
return
end
if not (arg_output:gsub("[A-Za-z0-9_.-]","")=="") then
ngx.say("Invalid query 'output': '"..arg_output.."'")
return
end
assert(io.popen("/usr/bin/ffmpeg -y -i 'rtmp://192.168.93.58:1935/live/ljosbrot live=1' -vcodec copy -acodec copy /srv/filo_web/kennslur/".. arg_output ..".mp4 </dev/null >/dev/null 2>/dev/null &"))
ngx.say([[
<br>
<input type="button" value="Stodva upptoku" onclick="window.location='stop_recording.php';return false;">
]])
--[[
<?php
error_reporting(E_ALL);
if(!isset($_REQUEST['output'])) { die('Missing output'); }
//$output = exec("/usr/bin/ffmpeg -y -i rtmp://157.157.65.93:443/filadelfia/stream1 -vcodec copy -acodec copy fftest15.mp4 </dev/null >/dev/null 2>/var/log/ffmpeg.log &");
//$output = exec("/usr/bin/ffmpeg -y -i rtmp://157.157.65.93:443/filadelfia/stream1 -vcodec copy -acodec copy /content/kennslur/".$_REQUEST['output'].".mp4 </dev/null >/dev/null 2>/dev/null &1");
$output = exec("/usr/bin/ffmpeg -y -i 'rtmp://82.221.112.178:1935/live/ljosbrot live=1' -vcodec copy -acodec copy /content/kennslur/".$_REQUEST['output'].".mp4 </dev/null >/dev/null 2>/dev/null &1");
print_r($output);
echo PHP_EOL.'OK START';
?>
<br>
<input type="button" value="Stodva upptoku" onclick="window.location='stop_recording.php';return false;">
--]]