File: /home/httpd/html/freecams1.com/public_html/admin/regenwebvtt.php
<?
include_once('db.php');
require_once('getid3/getid3.php');
$id = (int) $_GET['id'];
$imagick_command = "-modulate 110,102,100 -sharpen 1x1 -enhance";
if (is_odd($thumbwidth)) {
$thumbwidth++;
}
if (is_odd($thumbheight)) {
$thumbheight++;
}
$result = dbQuery("SELECT * FROM content WHERE approved = 2 AND photos = 0 AND hotlinked NOT LIKE '%adultcentro%'", false);
foreach ($result as $row) {
$i = $row['filename'];
$first = $row['filename'][0];
$second = $row['filename'][1];
$third = $row['filename'][2];
$forth = $row['filename'][3];
$fifth = $row['filename'][4];
$subdir = $first . '/' . $second . '/' . $third . '/' . $forth . '/' . $fifth . '/';
$target_movie = $video_path . "/" . $subdir . $i;
$i = $row[filename];
$first = $row[filename][0];
$second = $row[filename][1];
$third = $row[filename][2];
$forth = $row[filename][3];
$fifth = $row[filename][4];
$subdir = $first.'/'.$second.'/'.$third.'/'.$forth.'/'.$fifth.'/';
$target_movie = $video_path."/".$subdir.$i;
if($row['hotlinked'] && !file_exists($target_movie)) {
shell_exec("$wget_path " . escapeshellarg(str_replace('\r', '', $row[hotlinked])) . " -U=\"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\" -O \""."$video_path/$subdir" . $row['filename']."\"");
}
$rrow[id] = uniqid();
$dirname = str_replace('.flv','',$row[orig_filename]);
$target_image = "$thumb_path/$subdir$dirname/";
shell_exec("$ffmpeg_path -i \"$target_movie\" -vcodec mjpeg -vf fps=1/5 -s 200x150 \"$target_image/vtt_%03d.jpg\"");
if($ceph_enabled) {
unset($vttThumbs);
$prepareThumbnails = scandir($target_image);
//remove . and ..
unset($prepareThumbnails[0]);
unset($prepareThumbnails[1]);
foreach($prepareThumbnails as $p) {
$vttThumbs[] = $target_image.$p;
}
foreach($vttThumbs as $v) {
if(cephUploadObject($v,str_replace("$basepath/media/","",$v))) {
echo "[".date('Y-m-d H:i:s')."] transfered $v to cloud storage.\n";
if($ceph_delete_local) {
@unlink($v);
}
}
}
}
if($deleteHotlinkedVideos && $row['hotlinked']) {
unlink("$video_path/$subdir".$row['filename']);
}
$counter++;
}
echo "\n----------------------\nComplete";
?>