', $cmdis); $subcmd=explode('-shortest ', trim($precmd[0])); if (sizeof($subcmd) > 1) { $outf=$subcmd[1]; if (file_exists($outf)) { $wassuff=''; while (file_exists($outf . '_was' . $wassuff)) { if ($wassuff == '') { $wassuff='0'; } else { $wassuff='' . (1 + intval('' . $wassuff)); } } rename($outf, $outf . '_was' . $wassuff); } } if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $cmdis=str_replace(' > ', ' 2> ', $cmdis); } $rs=shell_exec($cmdis); if ($outf != '') { if (file_exists($outf)) { $rs.='

'; if (PHP_OS == "Darwin") { $rs.='

Video and Audio Files ...
' . str_replace("\n","
",yourshell_exec("file *.* | egrep -B 0 'ISO Media|Audio|WebM|Matroska|.ts:'")) . '
'; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $rs.='

Video and Audio Files ...
' . str_replace("\n","
",yourshell_exec('"C:\\Program Files (x86)\\GnuWin32\\bin\\file.exe" *.*')) . '
'; } } } } else if (PHP_OS == "Darwin") { $rs='
Video and Audio Files ...
' . str_replace("\n","
",yourshell_exec("file *.* | egrep -B 0 'ISO Media|Audio|WebM|Matroska|.ts:'")) . '
'; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $rs='
Video and Audio Files ...
' . str_replace("\n","
",yourshell_exec('"C:\\Program Files (x86)\\GnuWin32\\bin\\file.exe" *.*')) . '
'; } if (isset($_GET['infilegetsize'])) { exit; } if (isset($_GET['ffmpeg'])) { $fnd=false; if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { if (file_exists('./ffmpeg.txt')) { $pplace=file_get_contents('./ffmpeg.txt'); if (strpos($pplace, 'ffmpeg.exe') !== false) { $fnd=true; } } if (!$fnd) { $huhexe=shell_exec("where ffmpeg.exe"); if ($huhexe == '') { $huhexes=rglob("C:\\ffmpeg.exe"); //shell_exec("where pdfimages.exe"); if (sizeof($huhexes) > 0) { file_put_contents('./ffmpeg.txt', $huhexes[0]); if (strpos($huhexes[0], ' ') !== false) { $huhexes[0]=str_replace('"','',$huhexes[0]); echo ""; } else { $huhexes[0]=str_replace('"','',$huhexes[0]); echo ""; } } } } } exit; } $dn=''; $ffmpegpre=''; $ffmpegsuf=''; $whereffmpeg="?infilegetsize="; if (PHP_OS == "Darwin") { $dn=' /dev/null'; } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { $ffmpegpre="\"C:\\Program Files\\ImageMagick-7.1.0-Q16-HDRI\\"; $ffmpegsuf=".exe\""; if (!file_exists($ffmpegpre . 'ffmpeg' . $ffmpegsuf)) { if (file_exists('./ffmpeg.txt')) { if (!file_exists(file_get_contents('./ffmpeg.txt'))) { unlink('./ffmpeg.txt'); $whereffmpeg="?ffmpeg=where"; } else { $ffmpegpre="\"" . str_replace('ffmpeg.exe','',file_get_contents('./ffmpeg.txt')) . "\""; } } if (file_exists('ffmpeg' . $ffmpegsuf)) { $ffmpegpre=""; } else if (!file_exists('./ffmpeg.txt')) { $huhexe=shell_exec("where ffmpeg.exe"); if (strpos($huhexe, 'ffmpeg.exe') === false) { $whereffmpeg="?ffmpeg=where"; } else { $ffmpegpre=str_replace('ffmpeg.exe','',$huhexe); } } } $pdfimagespre="\"C:\\MAMP\\htdocs\\xpdf-tools-win-4.04\\bin32\\"; $pdfimagessuf=".exe\""; if (!file_exists($pdfimagespre . 'pdfimages' . $pdfimagessuf)) { if (file_exists('./pdfimages.txt')) { if (!file_exists(file_get_contents('./pdfimages.txt'))) { unlink('./pdfimages.txt'); $wherepdfimages="?pdfimages=where"; } else { $pdfimagespre="\"" . str_replace('pdfimages.exe','',file_get_contents('./pdfimages.txt')) . "\""; } } if (file_exists('pdfimages' . $pdfimagessuf)) { $pdfimagespre=""; } else if (!file_exists('./pdfimages.txt')) { $huhexe=shell_exec("where pdfimages.exe"); if (strpos($huhexe, 'pdfimages.exe') === false) { $wherepdfimages="?pdfimages=where"; } else { $pdfimagespre=str_replace('pdfimages.exe','',$huhexe); } } } } function yourshell_exec($incm) { //file_put_contents('xx.xx', $incm); $blurblines=shell_exec($incm); //file_put_contents('xxx.xxx', $blurblines); $outblurb=""; $obs=explode("\n", $blurblines); for ($iobs=0; $iobs' . explode(';',$obs[$iobs])[0] . ';',$obs[$iobs]) . "\n"; } else { $outblurb.=str_replace(explode(':',$obs[$iobs])[0] . ':','' . explode(':',$obs[$iobs])[0] . ';',$obs[$iobs]) . "\n"; } } else if (strpos($obs[$iobs], ';') !== false) { $outblurb.=str_replace(explode(';',$obs[$iobs])[0] . ';','' . explode(';',$obs[$iobs])[0] . ';',$obs[$iobs]) . "\n"; } else if (strpos($obs[$iobs], ':') !== false) { $outblurb.=str_replace(explode(':',$obs[$iobs])[0] . ':','' . explode(':',$obs[$iobs])[0] . ';',$obs[$iobs]) . "\n"; } else { $outblurb.=$obs[$iobs] . "\n"; } } } return $outblurb; } function ourshell_exec($onea, $twoa = NULL, $threea = NULL) { $folder=''; $pattern=''; $size=''; $filesa=[]; if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows' || (strpos(('~@!' . $onea), '~@!forfiles /P "') !== false && strpos(('~@!' . $onea), '/M "') !== false && strpos(('~@!' . $onea), 'find "') !== false)) { if (7 == 7) { $size=explode('"', explode('find "', $onea)[1])[0]; $nofind=shell_exec(explode(" | find ", $onea)[0]); $findings=explode("\n", $nofind); for ($ifindgs=0; $ifindgs /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); //if ($folder == substr((DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR),0,1)) { $didea=shell_exec("find \$HOME/Downloads -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); //file_put_contents("xx.ksh", $didea); if ($didea != '') { return $didea; } $didea=shell_exec("find " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . " -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); //file_put_contents("xxx.ksh", $didea); if ($didea != '') { return $didea; } $xc=getenv('HOME'); if ($xc == '') { $dirsa = glob('/Users/*', GLOB_ONLYDIR); for ($ia=0; $ia&1", $outputa, $retz); $didea=ourshell_exec("forfiles /P \"" . str_replace('//','/',$dirsa[$ia] . "/") . "Downloads\" /S /M \"" . $pattern . "\" /C \“cmd -c echo @path@fsize | find \"" . $size . "\" 2>&1", $outputa, $retz); if ($didea != '') { return $didea; } } } if ($didea != '') { return $didea; } } else { $didea=ourshell_exec("forfiles /P \"" . $xc . str_replace('//','/',DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR) . "Downloads\" /S /M \"" . $pattern . "\" /C \“cmd -c echo @path@fsize | find \"" . $size . "\" 2>&1", $outputa, $retz); if ($didea != '') { return $didea; } } return shell_exec("find " . $folder . " -type f -name \"" . $pattern . "\" 2> /dev/null -exec wc -c {} + | egrep '^ " . $size . " ' | sed '/ " . $size . " /s///g'"); } else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') { //file_put_contents('xs8.xs8', ''); $xc=getenv('HOMEDRIVE') . getenv('HOMEPATH'); // file_put_contents('xs88.xs88', $xc); if ($xc == '') { $xc=getenv('USERPROFILE'); } //file_put_contents('xs888.xs888', $xc); $xc=''; if ($xc == '') { //file_put_contents('xs8888.xs8888', $xc); $dirsa = glob("C:\\Users\\*", GLOB_ONLYDIR); for ($ia=0; $ia&1", $outputa, $retz); if ($didea != '') { return $didea; } } } if ($didea != '') { return $didea; } } else { $didea=ourshell_exec("forfiles /P \"" . $xc . str_replace('//','/',DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR) . "Downloads\" /S /M \"" . $pattern . "\" /C \“cmd -c echo @path@fsize | find \"" . $size . "\" 2>&1", $outputa, $retz); if ($didea != '') { return $didea; } } if ($didea != '') { return $didea; } $didea=ourshell_exec("forfiles /P \"" . $_SERVER['DOCUMENT_ROOT'] . "\" /S /M \"" . $pattern . "\" /C \"cmd -c echo @path@fsize\" | find \"" . $size . "\" 2>&1", $outputa); if ($didea != '') { return $didea; } $didea=ourshell_exec("forfiles /P \"%USERPROFILE%" . str_replace('//','/',DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR) . "Downloads\" /S /M \"" . $pattern . "\" /C \“cmd -c echo @path@fsize | find \"" . $size . "\" 2>&1", $outputa, $retz); if ($didea != '') { return $didea; } //$didea=shell_exec('forfiles /P C:' . substr("\\",0,1) . 'Downloads /S /M * /C “cmd /c if @fsize EQU ' . $size . ' if @file EQU ' . $pattern . " echo @path"); //if ($didea != '') { return $didea; } //$didea=shell_exec('forfiles /P C:' . substr("\\",0,1) . ' /S /M * /C “cmd /c if @fsize EQU ' . $size . ' if @file EQU ' . $pattern . " echo @path 2>nul"); $didea=ourshell_exec("forfiles /P \"C:" . substr("\\",0,1) . "\" /S /M \"" . $pattern . "\" /C \"cmd -c echo @path@fsize\" | find \"" . $size . "\" 2>&1"); if ($didea != '') { return $didea; } } // echo "QQghfjhg"; //echo "forfiles /P \"" . $_SERVER['DOCUMENT_ROOT'] . "\" /S /M \"" . $pattern . "\" /C \“cmd -c echo @path@fsize | find \"" . $size . "\" 2>&1"; // exit; //$iti = new RecursiveDirectoryIterator($folder); //foreach (new RecursiveIteratorIterator($iti) as $file) { //foreach (glob($folder . $pattern) as $file) { // if (strpos($file , $pattern) !== false && filesize($file) == $size) { // return $file; // } //} return ''; } // Does not support flag GLOB_BRACE function rglob($pattern, $flags = 0) { // thanks to https://stackoverflow.com/questions/17160696/php-glob-scan-in-subfolders-for-a-file $files = glob($pattern, $flags); foreach (glob(str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR,DIRECTORY_SEPARATOR,dirname($pattern).DIRECTORY_SEPARATOR).'*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { $files = array_merge( [], [$files, rglob($dir . DIRECTORY_SEPARATOR . basename($pattern), $flags)] ); } return $files; } function ourbasename($inb) { return basename(str_replace(' ','_',$inb)); } function ourrealpath($inb) { return realpath(str_replace(' ','_',$inb)); } if (isset($_GET['filename']) && isset($_GET['filesize']) && !isset($_GET['filepath'])) { //file_put_contents('xj1.xj1',''); if (file_exists(str_replace('+',' ',urldecode($_GET['filename'])))) { if (filesize(str_replace('+',' ',urldecode($_GET['filename']))) == $_GET['filesize']) { $filepath=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['filename'])); //file_put_contents('xj11.xj11',''); } } if ($filepath == '') { $filepath = rsearch(DIRECTORY_SEPARATOR, str_replace('+',' ',urldecode($_GET['filename'])), $_GET['filesize']); //file_put_contents('xj111.xj111',$filepath); } $filepath=str_replace("\n","",$filepath); if (strpos($filepath, ' ') !== false) { $filepath='"' . str_replace('"','',$filepath) . '"'; //file_put_contents('xj1111.xj1111',''); } if (!isset($_GET['inpath'])) { // echo ""; if (isset($_GET['left'])) { //file_put_contents('xj11111.xj11111',str_replace("\\","\\\\",$filepath)); //file_put_contents('xj111111.xj111111', ""); echo ""; } else { echo ""; } exit; } else { $_GET['inpath']=urlencode(str_replace('"','',explode(str_replace('+',' ',urldecode($_GET['filename'])), $filepath)[0])); //$_GET['convertthis']=$_GET['filename']; } } else if (isset($_GET['filename']) && isset($_GET['filesize']) && $_GET['filepath'] == '') { //file_put_contents('xs0.xs0', ''); if (file_exists(str_replace('+',' ',urldecode($_GET['filename'])))) { //file_put_contents('xs.xs', ''); if (filesize(str_replace('+',' ',urldecode($_GET['filename']))) == $_GET['filesize']) { $filepath=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_GET['filename'])); //file_put_contents('xs.xs1', $filepath); } } if ($filepath == '') { //file_put_contents('xs.xs3', ''); $filepath = rsearch(DIRECTORY_SEPARATOR, str_replace('+',' ',urldecode($_GET['filename'])), $_GET['filesize']); //file_put_contents('xs.xs4', $filepath); } $filepath=str_replace("\n","",$filepath); if (strpos($filepath, ' ') !== false) { $filepath='"' . str_replace('"','',$filepath) . '"'; } if (!isset($_GET['inpath'])) { if (isset($_GET['left'])) { echo ""; } else { echo ""; } exit; } else { $_GET['inpath']=urlencode(explode(str_replace('+',' ',urldecode($_GET['filename'])), $filepath)[0]); //$_GET['convertthis']=$_GET['filename']; } } else if (isset($_GET['filename']) && isset($_GET['filesize']) && isset($_GET['filepath'])) { $anyextrac=''; if (substr(str_replace('+',' ',urldecode($_GET['filepath'])), -1, 1) != DIRECTORY_SEPARATOR) { $anyextrac=DIRECTORY_SEPARATOR; } $filepath=str_replace("\n","",$filepath); if (strpos($filepath, ' ') !== false) { $filepath='"' . str_replace('"','',$filepath) . '"'; } if (!isset($_GET['inpath'])) { if (isset($_GET['left'])) { echo ""; } else { echo ""; } exit; } else { $_GET['inpath']=urlencode(str_replace('+',' ',urldecode($_GET['filepath'])) . $anyextac); //$_GET['convertthis']=$_GET['filename']; } } if ($ffmpegpre != '' && strpos($ffmpegpre, ' ') === false) { $ffmpegsuf=str_replace('"','',$ffmpegsuf); $ffmpegpre=str_replace('"','',$ffmpegpre); } $crlf="\r\n"; $cr="\r"; $lf="\n"; echo " Add Voiceover Audio to Video via ffmpeg - RJM Programming - May, 2023

Add Voiceover Audio to Video via ffmpeg

RJM Programming - May, 2023








" . $rs . "

"; ?>