
Recherche avancée
Autres articles (111)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (7884)
-
Measuring success for your SEO content
20 mars 2020, par Jake Thornton — Uncategorized -
Seam carving
Today I was reading trough the ImageMagick ChangeLog and noticed an interesting entry. “Add support for liquid rescaling”. I rushed to check the MagickWand API docs and there it was : MagickLiquidRescaleImage ! After about ten minutes of hacking the Imagick support was done. Needless to say ; I was excited
For those who don’t know what seam carving is check the demo here. More detailed information about the algorithm can be found here : “Seam Carving for Content-Aware Image Resizing” by Shai Avidan and Ariel Shamir
To use this functionality you need to install at least ImageMagick 6.3.8-2 and liblqr. Remember to pass –with-lqr to ImageMagick configuration line. You can get liblqr here : http://liblqr.wikidot.com/. The Imagick side of the functionality should appear in the CVS today if everything goes as planned.
Here is a really simple example just to illustrate the results of the operation. The parameters might be far from optimal (didn’t do much testing yet). The original dimensions of image are 500×375 and the resulting size is 500×200.
Update : the functionality is pending until license issues are solved.
-
< ?php
-
-
/* Create new object */
-
$im = new Imagick( ’test.jpg’ ) ;
-
-
/* Scale down */
-
$im->liquidRescaleImage( 500, 200, 3, 25 ) ;
-
-
/* Display */
-
header( ’Content-Type : image/jpg’ ) ;
-
echo $im ;
-
-
?>
The original image by flickr/jennconspiracy
And the result :
Update. On kenrick’s request here is an image which is scaled down to 300×300
-
-
what is the good function php to deal with ffmpeg and progress bar [duplicate]
17 mai 2014, par Abed SolimanThis question already has an answer here :
I ask about ffmpeg and progressbar
I used exec function with ffmpeg and output the result to txt file
and using some of code I found here to
<center>
<?php
define('RAPIDLEECH', 'yes');
define('CONFIG_DIR', 'configs/');
require_once('configs/config.php');
define ( 'TEMPLATE_DIR', 'templates/'.$options['template_used'].'/' );
// Include other useful functions
require_once('classes/other.php');
error_reporting(0);
login_check();
include(TEMPLATE_DIR.'header.php');
echo ('<br /><br /><br /><b>AudioXtractor</b>, un complemento <br /> que te permite extraer el audio de tus videos.<br /><br /><br />');
putenv('GDFONTPATH=' . realpath('.')); ?>
<br />
<form method="post"><center>
<table>
<td>Movie:
<select>
<?php
$exts=array(".ac3", ".avi", ".f4v", ".flv", ".mkv", ".mov", ".mp4", ".mpg", ".mpeg", ".rmvb", ".srt", ".swf", ".wav", ".wmv");
$ext="";
function vidlist($dir)
{
$results = array();
$handler = opendir($dir);
while ($file = readdir($handler))
{
if (strrchr($file,'.')!="")
{
$ext=strtolower(strrchr($file,'.'));
}
if ($file != '.' && $file != '..' && in_array($ext,$GLOBALS["exts"]))
{
$results[] = $file;
}
}
closedir($handler);
sort($results);
return $results;
}
function Output($command) {
$output = array($command);
exec($command.' 2>&1', $output);
return ($output);
}
$files = vidlist("./files/");
foreach($files as $file)
{
echo '<option value="'.$file.'">'.$file.'</option>';
}
?>
</select></td></table>
<br /> >
New MP3's name:
<input type="text" value="nuevoaudio" />
<br /> >
<br />
<br />
<center><input type="submit" style="font-size:16px; font-weight:bold; cursor:pointer;" value="Extract" />
</center></center></form>
<?php
if ($_POST['video']!="")
$video = 'files/';
$video=array();
$video[0] = $_POST['video'];
if ($_POST['nvdo']!="")
$nvdo = 'files/';
$nvdo=array();
$nvdo[0] = $_POST['nvdo'];
foreach ($video as $vdo)
foreach ($nvdo as $nvd)
if (isset($_POST["analize"])) {
exec("ffmpeg -i files/$vdo -ab 192k files/$nvd.mp3 -y 2> files/$nvd.txt");
$ext=strtolower(strrchr($vdo,'.'));
/////////////////////////////////////////////////////my code //////////////////////////////////////////
$content = @file_get_contents("files/$nvd.txt");
//get duration of source
preg_match("/Duration: (.*?), start:/", $content, $matches);
$rawDuration = $matches[1];
//rawDuration is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawDuration));
$duration = floatval($ar[0]);
if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;
//get the time in the file that is already encoded
preg_match_all("/time=(.*?) bitrate/", $content, $matches);
$rawTime = array_pop($matches);
//this is needed if there is more than one match
if (is_array($rawTime)){$rawTime = array_pop($rawTime);}
//rawTime is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawTime));
$time = floatval($ar[0]);
if (!empty($ar[1])) $time += intval($ar[1]) * 60;
if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;
//calculate the progress
$progress = round(($time/$duration) * 100);
echo '<br /><br />¡Su video fue convertido correctamente! <br /><br />Link al archivo:';
echo ' <a href="http://stackoverflow.com/feeds/tag/files/'.$nvd.'.mp3">'.$nvd.'.mp3</a><br />' . "<br />";
echo "Duration: " . $duration . "<br />";
echo "Current Time: " . $time . "<br />";
echo "Progress: " . $progress . "%" . "<br />";
//////////////////////////////////////my coed //////////////////////////////////////////////
}
?>
<br /><br /><a href="http://stackoverflow.com/feeds/tag/index.php">Volver al RapidLeech</a>
<br /><br /><br />Formatos Aceptados: <br /><b>.ac3, .avi, .f4v, .flv, .mkv, .mov, .mp3,<br /> .mp4, .mpg, .mpeg, .rmvb, .srt, .swf, .wav, .wmv</b>
<br /><br />
</center>
<?php
?>so i ask some one he told me the exec stop php script and never give me
You can't get the progress directly if you are using exec, because the php script is stopped until ffmpeg closes. (Because exec returns the whole execution output)
You should use popen, for being able to get the output from the process in real time (without reading any file) for parse and show the progressbar
Here is a example for get the output:
When you get the progress info from ffmpeg, you can use your code for parse it and show your progressbarthis is my popen script
<?php
$handle = popen ("ffmpeg.exe -i files/fz.mp4 -ab 192k files/vdf.mp3 2>&1 ", 'r');
$handles = (string)$handle;
$line = "";
while (false !== ($char = fgetc($handle)))
{
if ($char == "\r")
{
// You could now parse the $line for status information.
echo "$line\n";
$line = "";
} else {
$line .= $char;
}
ob_flush();
flush();
}
pclose ($handle);
//get duration of source
preg_match("/Duration: (.*?), start:/", $handles, $matches);
$rawDuration = $matches[1];
//rawDuration is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawDuration));
$duration = floatval($ar[0]);
if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;
//get the time in the file that is already encoded
preg_match_all("/time=(.*?) bitrate/", $handles, $matches);
$rawTime = array_pop($matches);
//this is needed if there is more than one match
if (is_array($rawTime)){$rawTime = array_pop($rawTime);}
//rawTime is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawTime));
$time = floatval($ar[0]);
if (!empty($ar[1])) $time += intval($ar[1]) * 60;
if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;
//calculate the progress
$progress = round(($time/$duration) * 100);
echo '<br /><br />¡Su video fue convertido correctamente! <br /><br />Link al archivo:';
echo "Duration: " . $duration . "<br />";
echo "Current Time: " . $time . "<br />";
echo "Progress: " . $progress . "%" . "<br />";
//////////////////////////////////////my coed //////////////////////////////////////////////
?>so i dont under stand what is good for ffmpeg progressbAR
is exec or popen
so please give me hints for ffmpeg real time progressbar
what is good for progressbar
is html5 progress bar
or javascript progress bar