
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (35)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (4164)
-
Transcode HLS Segments individually using FFMPEG
27 mai 2013, par rayhI am recording a continuous, live stream to a high-bitrate HLS stream. I then want to asynchronously transcode this to different formats/bitrates. I have this working, mostly, except audio artefacts are appearing between each segment (gaps and pops).
Here is an example ffmpeg command line :
ffmpeg -threads 1 -nostdin -loglevel verbose \
-nostdin -y -i input.ts -c:a libfdk_aac \
-ac 2 -b:a 64k -y -metadata -vn output.tsInspecting an example sound file shows that there is a gap at the end of the audio :
And the start of the file looks suspiciously attenuated (although this may not be an issue) :
My suspicion is that these artefacts are happening because transcoding are occurring without the context of the stream as a whole.
Any ideas on how to convince FFMPEG to produce audio that will fit back into a HLS stream ?
** UPDATE 1 **
Here are the start/end of the original segment. As you can see, the start still appears the same, but the end is cleanly ended at 30s. I expect some degree of padding with lossy encoding, but I there is some way that HLS manages to do gapless playback (is this related to iTunes method with custom metadata ?)
** UPDATED 2 **
So, I converted both the original (128k aac in MPEG2 TS) and the transcoded (64k aac in aac/adts container) to WAV and put the two side-by-side. This is the result :
I'm not sure if this is representative of how a client will play it back, but it seems a bit odd that decoding the transcoded one introduces a gap at the start and makes the segment longer. Given they are both lossy encoding, I would have expected padding to be equally present in both (if at all).
** UPDATE 3 **
According to http://en.wikipedia.org/wiki/Gapless_playback - Only a handful of encoders support gapless - for MP3, I've switched to lame in ffmpeg, and the problem, so far, appears to have gone.
For AAC (see http://en.wikipedia.org/wiki/FAAC), I have tried libfaac (as opposed to libfdk_aac) and it also seems to produce gapless audio. However, the quality of the latter isn't that great and I'd rather use libfdk_aac is possible.
-
Anomalie #3894 : Jointures (erronées ?) avec les boucles documents et leurs critères
27 janvier 2017, par marcimat ☺☮☯♫Les cas objet / id_objet¶
En appelant
page=test&objet=rubrique&id_objet=1
:-
(DOCUMENTS){objet?}{id_objet?}
-(DOCUMENTS){id_objet?}{objet?}
-(DOCUMENTS){objet?}{id_objet?}{vu=non}
-(DOCUMENTS){id_objet?}{objet?}{vu=non}
-(DOCUMENTS){vu=non}{id_objet?}{objet?}
Jointures correctes : 1 seule jointure L1 sur spip_documents_liens-
(DOCUMENTS){id_article?}{objet?}{id_objet?}
Jointure incorrecte : il y a 2 jointures différentes pour objet & id_objetSELECT documents.fichier FROM spip_documents AS `documents` INNER JOIN spip_documents_liens AS L3 ON ( L3.id_document = documents.id_document ) INNER JOIN spip_documents_liens AS L2 ON ( L2.id_document = documents.id_document ) WHERE (documents.statut = ’publie’) AND (documents.mode IN (’image’,’document’)) AND (documents.taille > 0 OR documents.distant=’oui’) AND (L2.objet = ’rubrique’) AND (L3.id_objet = 1) GROUP BY documents.id_document
-
(DOCUMENTS){id_article?}{objet?}{id_objet?}{vu=non}
Même comportement erroné, avec vu sur L1 et 2 jointures pour objet & id_objet :SELECT documents.fichier FROM spip_documents AS `documents` INNER JOIN spip_documents_liens AS L3 ON ( L3.id_document = documents.id_document ) INNER JOIN spip_documents_liens AS L2 ON ( L2.id_document = documents.id_document ) INNER JOIN spip_documents_liens AS L1 ON ( L1.id_document = documents.id_document ) WHERE (documents.statut = ’publie’) AND (documents.mode IN (’image’,’document’)) AND (documents.taille > 0 OR documents.distant=’oui’) AND (L2.objet = ’rubrique’) AND (L3.id_objet = 1) AND (L1.vu = ’non’) GROUP BY documents.id_document
Il me semble que les jointures objet / id_objet ne fonctionnent que s’ils sont les premiers critères optionnels créant possiblement une jointure de la boucle.
Cependant(DOCUMENTS){vu?}{objet?}{id_objet?}
fonctionne aussi avec vu optionnel (1 seule jointure). -
using ffmpeg as multiple downloads
26 avril 2013, par user2321982well guys, I'm having problems with my application.
well I'll explain more, I'm using the plugin uploader uploads multiple videos and I'm using the ffmpeg extension to my php version.<code class="echappe-js"><script type="text/javascript"><br />
// Convert divs to queue widgets when the DOM is ready<br />
$(function() {<br />
$("#uploader").pluploadQueue({<br />
// General settings<br />
runtimes : &#39;gears,flash,silverlight,browserplus,html5&#39;,<br />
url : &#39;upload.php?id=&lt;?= $login_usuario; ?>&amp;name=&lt;?= $name_user; ?>&#39;,<br />
flash_swf_url : &#39;plugins/plupload/plupload.flash.swf&#39;,<br />
containers: &#39;plupload&#39;,<br />
multipart: true,<br />
urlstream_upload: true,<br />
multipart_params:{directory:&#39;uploads&#39;},<br />
multi_selection: true,<br />
<br />
max_file_size : &#39;500mb&#39;,<br />
chunk_size : &#39;1mb&#39;,<br />
unique_names : true,<br />
<br />
// Specify what files to browse for<br />
filters : [<br />
{title : "Video Files", extensions : "avi,mpg,wmv,flv,3gp,mpeg,mpeg4,mpg4,mp4"}<br />
],<br />
// Silverlight settings<br />
silverlight_xap_url : &#39;plugins/plupload/plupload.silverlight.xap&#39;<br />
});<br />
<br />
uploader.ini();<br />
<br />
// Client side form validation<br />
$(&#39;form&#39;).submit(function(e) {<br />
var uploader = $(&#39;#uploader&#39;).plupload(&#39;getUploader&#39;);<br />
<br />
// Files in queue upload them first<br />
if (uploader.files.length > 0) {<br />
// When all files are uploaded submit form<br />
uploader.bind(&#39;StateChanged&#39;, function() {<br />
if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {<br />
$(&#39;form&#39;)[0].submit();<br />
}<br />
});<br />
<br />
uploader.start();<br />
} else<br />
alert(&#39;You must at least upload one file.&#39;);<br />
<br />
return false;<br />
});<br />
});<br />
</script>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.
well he calls javascript in a php file, in case it will upload the videos.
what I want is to get the length, resolution, file size and take a screenshot of the video randomly, so far so good, the problem is that it only works with only one upload at a time.
When sending more than one he does the procedure with ffmpeg, besides the most is not taking a screenshot of the video.
below is my code<?php
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
if (!extension_loaded ('ffmpeg') ) exit ( 'ffmpeg não foi carregado!' );
// 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");
include("includes/seguranca.php");
include("includes/classes/class.mysql.php");
include("includes/funcoes/sql_inject.php");
$id_user = anti_injection($_GET['id']);
session_start();
// Settings
//$targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
$targetDir = 'uploads/';
//$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){
$movie_file = realpath("/uploads/".$fileName);
// instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
$movie = new ffmpeg_movie($movie_file);
// pegamos a duranção do video em segundos
$duration = round ( $movie->getDuration() , 0 );
// recebemos o número de frames do vídeo
$totalFrames = $movie->getFrameCount();
// recebemos a altura do vídeo em pixels
$height = $movie->getFrameHeight ();
// recebemos a largura do vídeo em pixels
$width = $movie->getFrameWidth ();
$thumbnailOf = $movie->getFrameRate() * 5;
$thumbnailOf = round ( $movie->getFrameCount() / 2 );
// precisamos criar uma imagem GD para o ffmpeg-php trabalhar nela
$image = imagecreatetruecolor ($width,$height ) ;
// criamos a instancia do frame com a classe ffmpeg_frame
$frame = new ffmpeg_frame ($image);
// escolhemos o frame que queremos salvar como jpeg
$thumbnailOf = rand (1,$movie->getFrameCount());
// recebe o frame
$frame = $movie->getFrame ( $thumbnailOf );
// converte para uma imagem GD
$image = $frame->toGDImage ();
$size = filesize("uploads/".$fileName);
$valuea = rand(0,100);
$valueb = rand(0,100);
$valuec = rand(0,10);
$nome = @md5(date('now') * $valuea - $valueb / $valuec);
$dir = realpath("uploads/snapshots/$nome.jpg");
//salva no HD.
imagejpeg($image, $dir, 100);
$resolu = $width."x".$height;
mysql_query("INSERT INTO video
(poster_id,duration,video,titulo,resolucao,tamanho)
VALUES
('$id_user','$duration','$fileName','$exploded_photoName[0]','$resolu','$size')") or die(mysql_error());
}
// Return JSON-RPC response
die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}');
?>I did another method not so effective to do what I want but it only works if I open the page individually.
I removed the code from ffmpeg extension and put an include to that page.
<?
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
if (!extension_loaded ('ffmpeg') ) exit ( 'ffmpeg não foi carregado!' );
include("includes/seguranca.php");
include("includes/classes/class.mysql.php");
include("includes/funcoes/sql_inject.php");
$id_user = @anti_injection($_GET['id']);
class process{
public $videos;
public $target;
public $id_vid;
public function screen(){
$videos = $this->videos;
$target = $this->target;
$movie_file = realpath($videos);
// instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
$movie = new ffmpeg_movie($movie_file);
$totalFrames = $movie->getFrameCount();
$thumbnailOf = $movie->getFrameRate() * 5;
$thumbnailOf = round ( $movie->getFrameCount() / 2 );
// criamos a instancia do frame com a classe ffmpeg_frame
$frame = new ffmpeg_frame ( $image );
// escolhemos o frame que queremos salvar como jpeg
$thumbnailOf = rand (1,$movie->getFrameCount());
// recebe o frame
$frame = $movie->getFrame ( $thumbnailOf );
// converte para uma imagem GD
$image = $frame->toGDImage ();
$valuea = rand(0,100);
$valueb = rand(0,100);
$valuec = rand(0,10);
$nome = @md5(date('now') * $valuea - $valueb / $valuec);
$dir = $target."snapshots/".$nome.".jpeg";
//salva no HD.
imagejpeg($image,$dir, 100);
$q = new Query;
$q ->update('video')
->set(
array(
'screen'=>$nome.".jpeg"
)
)
->where_equal_to(
array(
'id_video'=>$this->id_vid
)
)
->limit(1)
->run();
}
public function duration(){
$videos = $this->videos;
$movie_file = realpath($videos);
// instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
$movie = new ffmpeg_movie($movie_file);
// pegamos a duranção do video em segundos
$duration = round ( $movie->getDuration() , 0 );
$q = new Query;
$q ->update('video')
->set(
array(
'duration'=>$duration
)
)
->where_equal_to(
array(
'id_video'=>$this->id_vid
)
)
->limit(1)
->run();
}
public function resolution(){
$videos = $this->videos;
$movie_file = realpath($videos);
// instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
$movie = new ffmpeg_movie($movie_file);
// recebemos a altura do vídeo em pixels
$height = $movie->getFrameHeight ();
// recebemos a largura do vídeo em pixels
$width = $movie->getFrameWidth ();
$resolucao = $width."x".$height;
$q = new Query;
$q ->update('video')
->set(
array(
'resolucao'=>$resolucao
)
)
->where_equal_to(
array(
'id_video'=>$this->id_vid
)
)
->limit(1)
->run();
}
final public function checar($a){
$q = new Query;
$q ->update('video')
->set(
array(
'process'=>$a
)
)
->where_equal_to(
array(
'id_video'=>$this->id_vid
)
)
->limit(1)
->run();
}
}
$q=new Query;
$q->select(
array(
'id_video',
'video',
'dir',
'screen',
'poster_id',
'resolucao',
'duration'
)
)
->from('video')
->run();
if($q){
$users=$q->get_selected();
foreach($users as $user){
$c = new process;
$c->videos = $user['video'];
$c->target = $user['dir'];
$c->id_vid = $user['id_video'];
if(($user['screen'] == 'NULL') or ($user['duration'] == 'NULL') or ($user['resolucao'] == 'NULL')){
$c->checar(0);
if($user['screen'] == 'NULL'){
$c->screen();
}
if($user['duration'] == 'NULL'){
$c->duration();
}
if($user['resolucao'] == 'NULL'){
$c->resolution();
}
}else{
$c->checar(1);
}
}
}
else{
echo 'Sorry, no users found.';
}
?>