Example #1
0
 public function updateFormatOptions(&$save_path, $overwrite)
 {
     parent::updateFormatOptions($save_path, $overwrite);
     //          if the save path doesn't have %d in it then we are ouputing an animated gif,
     //          otherwise it is assumed that the output is multiple images.
     //          If we are going to output an animated gif we must prevent ffmpeg from doing it.
     //          This is because ffmpeg creates really shitty animated gifs, which is suprising.
     if (preg_match('/(\\%([0-9]*)?index|timecode)/', $save_path, $matches) === 0) {
         //              if the frame rate has not been set, find out what it is and then set it
         if (empty($this->_format['video_frame_rate']) === true) {
             $frame_rate = $this->_media_object->getFrameRate();
             $this->setVideoFrameRate(floor($frame_rate));
         }
         //              as we are outputting frames we want the png format for each frame for best possible output
         $this->_restricted_video_codecs = array('png');
         $this->setVideoCodec('png')->setFormat('image2');
         $this->_restricted_video_codecs = array('gif');
         //              update the pathway to include indexed output so that it outputs multiple frames.
         $original_save_path = $save_path;
         $ext = pathinfo($save_path, PATHINFO_EXTENSION);
         $filename = 'phpvideotoolkit_anigif_' . String::generateRandomAlphaString(5) . '_' . basename(substr_replace($save_path, '%12index.png', -(strlen($ext) + 1)));
         $save_path = $this->_config->temp_directory . DIRECTORY_SEPARATOR . $filename;
         //              register the post process to combine the images into an animated gif
         $this->_media_object->registerOutputPostProcess(array($this, 'postProcessCreateAnimatedGif'), array($original_save_path, $overwrite, $this->_format['video_frame_rate'], $this->_format['gif_loop_count'], $this->_format['gif_frame_delay']));
     }
     return $this;
 }
Example #2
0
 public function __construct($input_output_type = Format::OUTPUT, Config $config = null)
 {
     parent::__construct($input_output_type, $config);
     if ($input_output_type === 'output') {
         $this->disableAudio()->setVideoCodec('bmp')->setFormat('image2');
     }
     $this->_restricted_audio_codecs = array();
     $this->_restricted_video_codecs = array('bmp');
 }
        }
    }
    public static function TryGetValue($_ij6uatbzc868vt03)
    {
        if (!LBD_StringHelper::HasValue($_ij6uatbzc868vt03)) {
            return;
        }
        $_osmd8wpg3wv73jgf9mdlz2wjsf = LBD_CollectionHelper::StringArraySearch($_ij6uatbzc868vt03, ImageFormat::$Names);
        if (false !== $_osmd8wpg3wv73jgf9mdlz2wjsf) {
            return $_osmd8wpg3wv73jgf9mdlz2wjsf;
        } else {
            return;
        }
    }
}
ImageFormat::$Names = array(ImageFormat::Jpeg => array("Jpeg", "Jpg"), ImageFormat::Gif => array("Gif"), ImageFormat::Png => array("Png"));
final class LBD_HtmlColor extends LBD_Enum
{
    private function __construct()
    {
    }
    public static $Names;
    const AliceBlue = "#F0F8FF";
    const AntiqueWhite = "#FAEBD7";
    const Aqua = "#00FFFF";
    const Aquamarine = "#7FFFD4";
    const Azure = "#F0FFFF";
    const Beige = "#F5F5DC";
    const Bisque = "#FFE4C4";
    const Black = "#000000";
    const BlanchedAlmond = "#FFEBCD";
        $this->mp4 = '.mp4';
        $this->ogv = '.ogv';
        $this->webm = '.webm';
        $this->path = 'img/randVID/vid-';
    }
    public function createMP4()
    {
        return $this->path . $this->num . $this->mp4;
    }
    public function createOGV()
    {
        return $this->path . $this->num . $this->ogv;
    }
    public function createWEBM()
    {
        return $this->path . $this->num . $this->webm;
    }
}
//SCAN IMG DIR AND RANDOMIZE NUMBER
$imgDir = glob('img/randBG/*.jpg');
//ONLY RETURNS FILES ENDING IN .JPG
$num = mt_rand(0, count($imgDir) - 1);
//MT_RAND IS INCLUSIVE; -1 SO WE DON'T GENERATE A PATH THAT DOESN'T EXIST
//INSTANTIATE BG OBJECT
$img = new ImageFormat($num);
$bgImg = $img->createImg();
//INSTANTIATE VID OBJECT
$vid = new VideoFormat($num);
$bgMP4 = $vid->createMP4();
$bgOGV = $vid->createOGV();
$bgWEBM = $vid->createWEBM();