0) {
$datap="atad";
$isvideo="true";
$one="1";
$ext=".mp4";
$mtype="video";
$mimetype="video/mp4";
$mswitch=" -r 30 ";
}
} else if (isset($_POST['video'])) {
if (strlen($_POST['video']) > 0) {
$datap="atad";
$isvideo="true";
$one="1";
$ext=".mp4";
$mtype="video";
$mimetype="video/mp4";
$mswitch=" -r 30 ";
}
}
if (trim($period) == '') { $period="10"; }
file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording.y", "y");
$verb="ffmpeg -f avfoundation -i " . $one . ":0 -t " . $period . $mswitch . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext . " < " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording.y ; open http://localhost:8888/mic_recording" . $ext;
if (isset($_GET['verb'])) {
$verb=str_replace('+',' ',urldecode($_GET['verb']));
} else if (isset($_POST['verb'])) {
$verb=str_replace('+',' ',urldecode($_POST['verb']));
}
if (PHP_OS == 'Darwin') {
if (trim($verb) == '') { $verb="ffmpeg -f avfoundation -i " . $one . ":0 -t " . $period . $mswitch . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext . " < " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording.y ; open http://localhost:8888/mic_recording" . $ext; }
if (file_exists(DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'local' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'ffmpeg')) {
if (strpos((' ' . $verb . ' '), ' ffmpeg ') !== false) {
$verb=str_replace('ffmpeg', DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'local' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'ffmpeg', $verb);
}
} else if (file_exists(DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'ffmpeg')) {
if (strpos((' ' . $verb . ' '), ' ffmpeg ') !== false) {
$verb=str_replace('ffmpeg', DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'ffmpeg', $verb);
}
}
if (strpos($verb, ' -') === false) {
if (isset($_GET['passthru']) || isset($_POST['passthru'])) {
if (strpos(('~' . $verb . ' '), '~say ') !== false) {
exec(str_replace('saJUNKy ','say -i --progress ',$verb));
exit;
} else {
passthru("osascript -e 'tell application \"Terminal\" to do script \"" . $verb . "\"'");
}
} else {
$res=passthru("osascript -e 'tell application \"Terminal\" to do script \"" . $verb . "\"'");
echo "
" . str_replace(" ", " ", str_replace("\t", " ", str_replace("\n"," ",$res))) . "
";
}
} else if (isset($_GET['passthru']) || isset($_POST['passthru'])) {
if (strpos(('~' . $verb . ' '), '~say ') !== false) {
passthru("osascript -e 'tell application \"Terminal\" to do script \"" . $verb . "\"'");
exit;
} else {
passthru("osascript -e 'tell application \"Terminal\" to do script \"" . $verb . "\"'");
}
} else {
$res=shell_exec("osascript -e 'tell application \"Terminal\" to do script \"" . $verb . "\"'");
sleep(5);
sleep($period);
$spare='data:' . $mimetype . ';base64,' . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext));
shell_exec("echo 'data:" . $mimetype . ";base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext)) . "' | pbcopy");
echo "" . str_replace(" ", " ", str_replace("\t", " ", str_replace("\n"," ",$verb))) . "
Email " . $mtype . " recording to someone <" . $mtype . " controls> " . $mtype . "> ";
}
} else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') {
$datap="atad";
$isvideo="true";
$one="1";
$ext=".mp4";
$mtype="video";
$mimetype="video/mp4";
$mswitch=" -f gdigrab -framerate 30 -i desktop ";
if (trim($verb) == '') { $verb="ffmpeg -f gdigrab -framerate 30 -i desktop -t " . $period . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext . " < " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording.y 2> " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording.err" . " & explorer.exe http://localhost/mic_recording" . $ext; }
$ffmpegcommand="C:\\PROGRA~1\\IMAGEM~1.0-Q\\";
if (file_exists($ffmpegcommand . "ffmpeg.exe")) {
$ffmpegcommand.="ffmpeg.exe";
if (strpos((' ' . $verb . ' '), ' ffmpeg ') !== false) {
$verb=str_replace('ffmpeg', $ffmpegcommand, $verb);
}
} else {
$ffmpegcommand="";
}
if (strpos($verb, ' -') !== false) {
if (isset($_GET['passthru']) || isset($_POST['passthru'])) {
if (strpos(('~' . $verb . ' '), '~say ') !== false) {
exec(str_replace('saJUNKy ','say -i --progress ',$verb));
exit;
} else {
passthru($verb);
}
} else {
//$res=shell_exec($verb);
unlink(str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bxt');
$fp = fopen(str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bxt', 'x');
fwrite($fp, str_replace(" & ", "\n", str_replace(" ; ", "\n", $verb)) . "\nerase " . str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bat');
fclose($fp);
//$fp = fopen(str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bbt', 'x');
//fwrite($fp, str_replace(" ; ", "\n", $verb) . "\nerase " . str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bat');
//fclose($fp);
sleep(65);
sleep($period);
//shell_exec("echo 'data:" . $mimetype . ";base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext)) . "' | clip");
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext, 'r');
$fgc=fread($fp, filesize($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "mic_recording" . $ext));
fclose($fp);
$verbtwo=("echo 'data:" . $mimetype . ";base64," . base64_encode($fgc) . "' | clip");
$spare='data:' . $mimetype . ';base64,' . base64_encode($fgc);
$fp = fopen(str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bxt', 'x');
fwrite($fp, str_replace(" ; ", "\n", $verbtwo) . "\nerase " . str_replace("/",$wds,$_SERVER['DOCUMENT_ROOT']) . $wds . 'open_extravaganza.bat');
fclose($fp);
echo " var qq='\"\"'; " . str_replace(" ", " ", str_replace("\t", " ", str_replace("\n"," ",$verb))) . "
Email " . $mtype . " recording to someone <" . $mtype . " controls> " . $mtype . "> ";
}
} else if (isset($_GET['passthru']) || isset($_POST['passthru'])) {
if (strpos(('~' . $verb . ' '), '~say ') !== false) {
exec($verb);
exit;
} else {
passthru($verb);
}
} else {
$res=shell_exec($verb);
echo "" . str_replace(" ", " ", str_replace("\t", " ", str_replace("\n"," ",$res))) . "
";
}
} else {
//echo shell_exec($verb . " | pbcopy; pbpaste");
echo "
Record yourself via ffmpeg and MAMP on local system - RJM Programming - December, 2025
var wothree='top=50,left=50,height=600,width=600';
var rectthree=null, wotest=null;
var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
if (('' + navigator.platform).toLowerCase().indexOf('win') != 0) {
isSafari=true;
}
var wolab=(isSafari ? '_blank' : 'blankif');
var eletype='" . $mtype . "';
var newext=(('' + navigator.platform).toLowerCase().indexOf('win') == 0 ? '.mp4' : '" . $ext . "');
var qq='\"\"';
function onl() {
if (('' + navigator.platform).toLowerCase().indexOf('win') == 0) {
document.getElementById('myform').action=document.getElementById('myform').action.replace(':8888','');
document.getElementById('selv').innerHTML='Screenshot ';
document.getElementById('period').value='4';
document.getElementById('period').min='4';
document.getElementById('period').max='4';
}
if (('' + location.hash).replace(/^\#/g,'').indexOf('data') == 0) {
document.getElementById('myaudio').style.display='block';
//var ds=prompt(decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+'),decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+'));
if (decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+').indexOf('data:') == 0) {
if (document.getElementById('mydiv').innerHTML.indexOf(' src=\"\"') != -1) {
document.getElementById('mydiv').innerHTML=document.getElementById('mydiv').innerHTML.replace(' src=\"\"', ' src=\"' + decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+') + '\"');
} else {
document.getElementById('mysource').src=decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+');
}
} else {
if (document.getElementById('mydiv').innerHTML.indexOf(' src=\"\"') != -1) {
document.getElementById('mydiv').innerHTML=document.getElementById('mydiv').innerHTML.replace(' src=\"\"', ' src=\"' + 'data:audio/mp4;base64,' + (('' + location.hash).replace(/^\#/g,'')).substring(4).replace(/\ /g,'+') + '\"');
} else {
document.getElementById('mysource').src='data:audio/mp4;base64,' + (('' + location.hash).replace(/^\#/g,'')).substring(4).replace(/\ /g,'+');
}
}
} else if (('' + location.hash).replace(/^\#/g,'').indexOf('atad') == 0) {
document.getElementById('myaudio').style.display='block';
//var ds=prompt(decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+'),decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+'));
if (decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+').indexOf('atad:') == 0) {
if (document.getElementById('mydiv').innerHTML.indexOf(' src=\"\"') != -1) {
document.getElementById('mydiv').innerHTML=document.getElementById('mydiv').innerHTML.replace(' src=\"\"', ' src=\"' + decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+') + '\"');
} else {
document.getElementById('mysource').src=decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).replace(/\ /g,'+');
}
} else {
if (document.getElementById('mydiv').innerHTML.indexOf(' src=\"\"') != -1) {
document.getElementById('mydiv').innerHTML=document.getElementById('mydiv').innerHTML.replace(/audio/g,'video').replace(' src=\"\"', ' src=\"' + 'data:video/mp4;base64,' + (('' + location.hash).replace(/^\#/g,'')).substring(4).replace(/\ /g,'+') + '\"');
} else {
document.getElementById('mysource').src='data:video/mp4;base64,' + (('' + location.hash).replace(/^\#/g,'')).substring(4).replace(/\ /g,'+');
}
}
}
}
function ons(formo) {
if (('' + navigator.platform).toLowerCase().indexOf('win') == 0) {
document.getElementById('blankif').srcdoc='Screen capture soon for up to ' + document.getElementById('period').value + ' seconds ... but there may be a minute delay in play ... ... in which case, later go looking for ' + linkit('http://localhost/mic_recording' + newext) + ' ...
';
} else {
document.getElementById('blankif').srcdoc='Speak soon for up to ' + document.getElementById('period').value + ' seconds ...
';
}
document.getElementById('blankif').style.visibility='visible';
document.getElementById('blankif').style.backgroundColor='#f0f0f0';
document.getElementById('blankif').frameborder='1';
//if (('' + navigator.platform).toLowerCase().indexOf('win') != 0) {
wotest=window.open(formo.action + '?verb=' + encodeURIComponent(document.getElementById('verb').value) + '&video=' + encodeURIComponent(document.getElementById('video').value) + '&passXthru=y', wolab, wothree);
//}
if (!wotest && isSafari) {
formo.target='_blank';
return true;
} else {
return false;
}
return true;
}
function linkit(innards) {
var retv='' + innards + '
';
return retv;
}
Sorry, no macOS nor Windows system detected.'; }\">
Record yourself via ffmpeg for ...
RJM Programming - December, 2025
<" . $mtype . " id=myaudio style=display:none; controls>
" . $mtype . ">
";
}
?>