<?php

/**
 * YoutubeGallery Joomla! 3.0 Native Component
 * @version 3.5.9
 * @author DesignCompass corp< <*****@*****.**>
 * @link http://www.joomlaboat.com
 * @GNU General Public License
 **/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$videofile = $_GET['videofile'];
$videofile = '../../../' . urldecode($videofile);
//$videofile= urldecode($videofile);
if (!file_exists($videofile)) {
    echo 'File "' . $videofile . '" not found.';
    die;
}
require_once 'flv4php/FLV.php';
$flv = new FLV($videofile);
echo $flv->getFlvThumb();
Example #2
0
 protected static function ffmpeg($args)
 {
     $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
     $pipes = array();
     $cmd = self::$ffmpeg_root . "ffmpeg " . $args;
     self::log_command($cmd);
     $process = proc_open($cmd, $descriptorspec, $pipes);
     $output = "";
     if (!is_resource($process)) {
         return false;
     }
     #close child's input immediately
     fclose($pipes[0]);
     stream_set_blocking($pipes[1], false);
     stream_set_blocking($pipes[2], false);
     $todo = array($pipes[1], $pipes[2]);
     while (true) {
         $read = array();
         if (!feof($pipes[1])) {
             $read[] = $pipes[1];
         }
         if (!feof($pipes[2])) {
             $read[] = $pipes[2];
         }
         if (!$read) {
             break;
         }
         $ready = stream_select($read, $write = NULL, $ex = NULL, 2);
         if ($ready === false) {
             break;
             #should never happen - something died
         }
         foreach ($read as $r) {
             $s = fread($r, 1024);
             $output .= $s;
         }
     }
     fclose($pipes[1]);
     fclose($pipes[2]);
     self::$termination_code = proc_close($process);
     self::log_command($output);
     return $output;
 }