Example #1
0
function encodeMedia($dirname, $basename)
{
    $srcFile = getFtpMediasRoot() . $dirname . '/' . $basename;
    $dstFileDirname = getHttpMediasRoot() . $dirname . '/flv/';
    $dstFileBasename = preg_replace('/\\.(wmv|mpg|mp4)$/i', '.flv', $basename);
    $dstFile = $dstFileDirname . $dstFileBasename;
    $commandLine = sprintf('ffmpeg -i "%s" -ar 44100 -ab 128k -b 1024k -s 740*416 -y -f flv "%s"', $srcFile, $dstFile);
    exec($commandLine, $output);
    if (file_exists($dstFile)) {
        return array(str_replace(getHttpMediasRoot(), '', $dstFileDirname), $dstFileBasename);
    } else {
        return false;
    }
}
Example #2
0
echo basename($mediaAccess->basename, '.flv');
?>
<br /></strong>
            </h2>
			<p>Technical information</strong> :  <strong><?php 
echo round($mediaAccess->getFFMEPGObject()->getDuration());
?>
 s</strong> duration / <strong>
            <?php 
$video_source = getFtpMediasRoot() . $mediaAccess->srcname;
$movie = new ffmpeg_movie($video_source);
echo $movie->getFrameWidth();
?>
 x 
			<?php 
$video_source = getFtpMediasRoot() . $mediaAccess->srcname;
$movie = new ffmpeg_movie($video_source);
echo $movie->getFrameHeight();
?>
             px</strong> source size / <strong>
			<?php 
echo strtolower(substr($mediaAccess->srcname, -3));
?>
</strong> file format</p>
        	<div class="lineclear"><p class="hide">&nbsp;</p></div>
        <p>&nbsp;</p>
        </div>
        <div id="footer"><p> </p></div>
</div>
</body>
</html>
 public function getFileSize()
 {
     $this->fileSize = filesize(getFtpMediasRoot() . $this->srcname);
     $units = array('octets', 'ko', 'Mo', 'Go', 'To');
     $unit = 0;
     while ($this->fileSize > 1024) {
         $this->fileSize /= 1024;
         $unit++;
     }
     return (string) round($this->fileSize, 2) . $units[$unit];
 }
Example #4
0
<?php

if (!isset($_GET['path']) || strlen($_GET['path']) === 0) {
    return '#';
}
require_once 'falcon.php';
$path = getFtpMediasRoot() . urldecode($_GET['path']);
header('Content-type: ' . mime_content_type($path));
header('Content-Disposition: attachment; filename="' . basename($path) . '"');
readfile($path);
Example #5
0
            $db->insertMediaAccessEntry($_POST['ids_avions'], $_POST['description'], $media_id, $_POST['user_key'], $_POST['id_categorie'], $_POST['rank']);
            $db->commit();
            $confirm = "Accès ajouté.";
            $httpQuery->delete('indexForm', 'active');
        } catch (Exception $e) {
            $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
        }
    }
}
// Ajouter un accès à un document
if ($httpQuery->has('indexForm', 'active')) {
    $user_key = keygen();
    $id_avion = false;
    $submitName = 'activate_access';
    $submitValue = 'Activer';
    $description = '';
    $categorie_id = '';
    $rank = 0;
    $id_avion_image = 0;
    $comment = '';
    $ids_avion_arr = $db->getAllProducts();
}
// Tous les documents présent sur l'espace ftp
$allMedias = readdir_recursive(getFtpMediasRoot() . '/', array('wmv', 'mpg', 'mp4', 'WMV', 'MPG', 'MP4'));
// Tous les documents activés dans la base
// Tableau sous la forme [id_media] => full_path;
$allDbMedias = $db->getAllMediasPath();
// Tous les avions enregistrés dans la base
$allProducts = $db->getAllProducts();
// Toutes les catégories de médias enregistrées dans la base
$allMediasCategories = $db->getAllMediaCategories();
Example #6
0
">
       	<!-- Activer -->
        <a href="<?php 
            echo '?' . $queryActivate . '#' . $index;
            ?>
" class="activer" title="activate"></a>
        <img src="/img/icone_<?php 
            echo strtolower(substr($media, -3));
            ?>
.jpg" width="24" height="24" alt="" />
        <p><?php 
            echo basename($media, '.pdf');
            ?>
 (
        <strong><?php 
            $video_source = getFtpMediasRoot(1) . $media;
            $movie = new ffmpeg_movie($video_source);
            echo round($movie->getDuration());
            ?>
s</strong> /
        <strong><?php 
            echo $movie->getFrameWidth();
            ?>
 x <?php 
            echo $movie->getFrameHeight();
            ?>
 px / <?php 
            echo filesize_readable($video_source);
            ?>
</strong>
        )</p>