church_vod/www/start_the_recording.lua

32 lines
1.4 KiB
Lua
Raw Normal View History

local arg_output = ngx.var.arg_output
if not arg_output then
2024-02-07 19:43:58 +00:00
ngx.say("Missing query 'output'")
return
end
2024-02-07 21:37:46 +00:00
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 &"))
2024-02-07 19:43:58 +00:00
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;">
--]]