Файл: scripts/convert_videos.php
Строк: 63
<?php
define('_VALID', 1);
define('_ENTER', true);
define('_CLI', true);
// Argvs
$video_name = $_SERVER['argv'][1];
$vid = (int) $_SERVER['argv'][2];
$video_path = $_SERVER['argv'][3];
// Required
$basedir = dirname(dirname(__FILE__));
require $basedir. '/include/config.php';
require $basedir. '/include/function_video.php';
require $basedir. '/include/function_conversion.php';
$vi = array();
$video_info = array();
$nl = "=========================================================n";
echo "n".$nl."Video Details:n".$nl;
echo "n".$nl."-----------------:n".$nl;
echo "Parameters:n";
echo "Video Name: $video_namen";
echo "Vidoe ID: $vidn";
echo "Video Path: $video_pathnn";
// Error Checks
if (!preg_match("/^[0-9]{1,5}.[a-z0-9]{2,4}$/i", $video_name)) {
echo "Video Name: $video_name is invalid. Err #1. Exiting ..."; exit();
} else {
$ffp_data = get_ffprobe_data($video_path);
$video_info = ffpInfo($ffp_data);
}
// Get Encoder
$encodings = getEncodings();
foreach($encodings as $encoding) {
convert($encoding, $vid, $video_name, $video_info);
}
postThumbs($vid,$video_path);
postConversion($vid,$video_path);
// Display :: Encoder Core End
echo "n<-- End of Script -->nn";
exit();
?>