
Recherche avancée
Médias (21)
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (35)
-
Participer à sa documentation
10 avril 2011La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
Pour ce faire, vous pouvez vous inscrire sur (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (7282)
-
Methods : Adding Smart Quotes to stripHTML's punctuation removal
14 janvier 2014, par jamierytlewskiMethods : Adding Smart Quotes to stripHTML's punctuation removal
Addresses an issue with the word count where smart quotes were not
removed, but the word count counted the words as the punctuation was not
removed.Closes gh-811
-
Error scaling a video using libav filters [duplicate]
8 décembre 2016, par S BThis question already has an answer here :
I need to batch-process a bunch of videos to scale their height to 240 keeping the aspect ratio same. The command that gets the job almost done is :
$ avconv -threads 4 -ss 0.0 -i input.avi \
-map 0:0,0:0 -map 0:1,0:1 -vf "scale=-1:240" -y -f mpegts \
-async -1 -vcodec libx264 -vcodec libx264 -flags2 +fast \
-flags +loop -g 30 -bufsize 1024k \
-b 200k -bt 220k -qmax 48 -qmin 2 -r 20 -acodec libmp3lame \
-ab 44k -ar 44100 -ac 2 output.tsThe interesting part, as you can see, is
-vf "scale=-1:240"
This works on videos where the scaled output width turns out to be an even number. Otherwise, I get the following error message :
[libx264 @ 0x7fc4f8821e00] width not divisible by 2 (341x240)
How do I overcome this ?
Edit :
As per this link, I tried using-vf "scale=trunc(oh/a/2)*2:240"
which outputs a movie but the resulting video quality is really poor.Edit #2 :
This is not a duplicate as it’s wrongly marked. This question was posted much earlier than the other one. -
using ffmpeg plugin with plugin uploaded
17 avril 2013, par Bruno Ribeirogood he uploads the video registers in the database but does not take the print screen of the video and did not register on the database.
<?
class upload{
public $vide;
public $dir_video;
public $dir_screen;
//public $id_user;
//private function video(){
//return isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
//}
private function id_user(){
return anti_injection($_GET['id']);
}
private function get_duration(){
$getID3 = new getID3;
$file = $getID3->analyze($this->video);
return $file['playtime_string'];
}
private function rand_duration(){
@list($h, $m, $s) = explode(":", $this->get_duration());
$hms = ($h * 3600) + ($m * 60) + $s;
$rhms = rand(0, $hms);
return date('H:i', mktime(0,0,$rhms,0,0,0));
}
private function rand_name(){
$a = base64_encode($this->video);
return @md5(date('Y-m-d H:i:s') * $a);
}
private function get_resolution(){
$getID3 = new getID3;
$file = $getID3->analyze($this->video);
return $file['video']['resolution_x']."x".$file['video']['resolution_y'];
}
private function get_size(){
$getID3 = new getID3;
$file = $getID3->analyze($this->video);
return $file['filesize'];
}
private function get_printscreen(){
$cmd = "ffmpeg -i ".$this->video." -f mjpeg -an -ss ".$this->rand_duration()." -an -vframes 1 -y ".$this->dir_screen.$this->rand_name().".jpg";
return exec($cmd, $output);
//echo "executed command: [".$cmd."] with result: ".print_r($output, true)."<br />\n";
}
private function get_extension($a){
$arquivo = pathinfo($a);
return $arquivo['extension'];
}
private function verify_extension(){
if($this->get_extension() == "flv"){
return "0";
} else {
return "1";
}
}
public function _build(){
// HTTP headers for no cache etc
/*header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
*/
session_start();
// Settings
//$targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
$targetDir = $this->dir_video;
//$cleanupTargetDir = false; // Remove old files
//$maxFileAge = 60 * 60; // Temp file age in seconds
// 5 minutes execution time
@set_time_limit(5 * 60);
// Uncomment this one to fake upload time
// usleep(5000);
// Get parameters
$chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0;
$chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0;
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
// Clean the fileName for security reasons
$fileName = preg_replace('/[^\w\._]+/', '', $fileName);
// Make sure the fileName is unique but only if chunking is disabled
if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
$ext = strrpos($fileName, '.');
$fileName_a = substr($fileName, 0, $ext);
$fileName_b = substr($fileName, $ext);
$count = 1;
while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . '_' . $count . $fileName_b))
$count++;
$fileName = $fileName_a . '_' . $count . $fileName_b;
}
// Create target dir
if (!file_exists($targetDir))
@mkdir($targetDir);
// Look for the content type header
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
$contentType = $_SERVER["HTTP_CONTENT_TYPE"];
if (isset($_SERVER["CONTENT_TYPE"]))
$contentType = $_SERVER["CONTENT_TYPE"];
// Handle non multipart uploads older WebKit versions didn't support multipart in HTML5
if (strpos($contentType, "multipart") !== false) {
if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
// Open temp file
$out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab");
if ($out) {
// Read binary input stream and append it to temp file
$in = fopen($_FILES['file']['tmp_name'], "rb");
if ($in) {
while ($buff = fread($in, 4096))
fwrite($out, $buff);
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
fclose($in);
fclose($out);
@unlink($_FILES['file']['tmp_name']);
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
} else {
// Open temp file
$out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab");
if ($out) {
// Read binary input stream and append it to temp file
$in = fopen("php://input", "rb");
if ($in) {
while ($buff = fread($in, 4096))
fwrite($out, $buff);
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
fclose($in);
fclose($out);
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
}
$photoName = $_FILES['file']['name'];
$exploded_photoName = explode('.', $photoName);
$user_id = $_SESSION['SESS_MEMBER_ID'];
if(!isset($_SESSION[$photoName])) {
$_SESSION[$photoName] = '1';
}
if($chunk==1){
$this->get_printscreen();
mysql_query("INSERT INTO video
(poster_id,video,titulo,extension,screen,duration,resolucao,tamanho)
VALUES
('".$this->id_user()."','$fileName','$exploded_photoName[0]','".$this->get_extension($fileName)."','".$this->rand_name().".jpg','".$this->get_duration()."','".$this->get_resolution()."','".$this->get_size()."')")
or die(mysql_error());
}
// Return JSON-RPC response
die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}');
//$this->get_printscreen();
//return print $this->video();
//return print $this->rand_name();
}
}
?>I'm using the class to become more organized and clean, but I can not get the information from the video and get the printscreen using the plugin class and uploaded.