
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (105)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (5152)
-
Reading colors encoded in image at a position changes its value after decoded from video using php and ffmpeg
29 novembre 2022, par Jeenus JunanioI created a piece of code to encode unique color on image and converted the image to PNG so that it would be lossless. After This I created a video with the frame using this image using the ffmpeg in php shellexec(). After saving this video I reopened it to extract the frmae image added and tried to read those values from the image. Now the values on the image are a bit changed.


Here is the code that I tried to create the video :


$canvas = imagecreatefromjpeg('translate/first_frame.jpg');
 // create a random color
 $rand = str_pad(dechex(rand(0x000000, 0xFFFFFF)), 6, 0, STR_PAD_LEFT);
 $dec_color= hexdec($rand);

 // add the new color to image

 for ($i=0; $i < 24; $i++) { 
 imagesetpixel($canvas,$i,0,$dec_color);
 }

 // store the image and close the file opened

 // $filename = 'translate/test/output.png'; 
 $filename = 'translate/test/output.bmp'; 

 // imagepng($canvas, $filename);
 imagebmp($canvas, $filename);

 imagedestroy($canvas);

 $frame = $filename; // an image(png,gif,etc)
 $audio = 'translate/output/audio/abcdefghijklmnopqrstuvwxya.mp3';
 $output = 'translate/output/video/'.time().'.mp4'; 

 $cmd = 'ffmpeg -loop 1 -y -i '.$frame.' -i '.$audio.' -c:v libx264 -tune stillimage -c:a copy -shortest '.$output;
 shell_exec($cmd);



This above code is creating the video with the image.


Now I tried to extract the image video and color from image, the colors are a bit changed.


if($request->hasFile('video')){
 $file = $request->file('video');
 $filename = $file->getClientOriginalName();
 $path = public_path('translate/test/');
 }else{
 return 'No file uploaded';
 }
 
 
 if ($file->move($path, $filename)) {
 $video = 'translate/test/'.$filename;
 }else{
 return 'error file upload';
 }

 
 // $output = 'translate/output/image/'.time().'.png';
 $output = 'translate/output/image/'.time().'.bmp';
 // $output = 'translate/output/image/'.time().'.jpg';

 $cmd = 'ffmpeg -i '.$video.' -vframes 1 '.$output;
 shell_exec($cmd);


// $dimg = imagecreatefrompng($output);
 $dimg = imageCreateFromBmp($output);
 // $dimg = imagecreatefromjpeg($output);

 $extracted_color = array();

 for ($x=0; $x < 24 ; $x++) { 
 $extracted_color[]= imagecolorat($dimg, $x, 0);
 }

 echo "<br />Retrived colors:<pre>".print_r($extracted_color,1)."</pre>";

 imagedestroy($dimg);






The color added was 44743072 but the colors retrieved are 4539914,4474121,4408072,4408326 from x=0,y=0 to x=24,y=0.


In both PNG and BMP I am loosing the added pixels. You can clearly see in my code i have commented the code for png to read the image as bmp.


Can someone let me know if I miss anything here.


-
ffmpeg wasm - how to take client-side created mp4 and upload it to the same server hosting the index/js files being used
29 juillet 2022, par John FarrellOk, so Im an IT guy and kind of a noob on the dev side of the fence. But I've been able to create this ffmpeg wasm page that takes a canvas and converts it to webm / and .mp4 — what i WANT to do is take the resulting .mp4 file and upload it to the server where the page/js are being served from. is this possible ? I will include my source code which is fairly simple and straight forward, I just don't know how to manipulate the resulting mp4 file that ffmpeg spits out (i realize it is happening client side) to be able to push it up to the server (maybe with aupload.php type situation ?) the solution can be html/java/php whatever, so long as it takes the mp4 output and gets it onto the server. I'd VERY MUCH appreciate a hand here.


Going to try my best to properly insert the html and js. please bear with me if i've done something wrong, i've never had to -ask- a question on here, usually just look up existing answers.




const { createFFmpeg } = FFmpeg;
const ffmpeg = createFFmpeg({
 log: true
});

const transcode = async (webcamData) => {
 const message = document.getElementById('message');
 const name = 'record.webm';
 await ffmpeg.load();
 message.innerHTML = 'Start transcoding';
 await ffmpeg.write(name, webcamData);
 await ffmpeg.transcode(name, 'output.mp4');
 message.innerHTML = 'Complete transcoding';
 const data = ffmpeg.read('output.mp4');

 const video = document.getElementById('output-video');
 video.src = URL.createObjectURL(new Blob([data.buffer], { type: 'video/mp4' }));
 dl.href = video.src;
 dl.innerHTML = "download mp4"
}

fn().then(async ({url, blob})=>{
 transcode(new Uint8Array(await (blob).arrayBuffer()));
})

function fn() {
var recordedChunks = [];

var time = 0;
var canvas = document.getElementById("canvas");

return new Promise(function (res, rej) {
 var stream = canvas.captureStream(60);

 mediaRecorder = new MediaRecorder(stream, {
 mimeType: "video/webm; codecs=vp9"
 });

 mediaRecorder.start(time);

 mediaRecorder.ondataavailable = function (e) {
 recordedChunks.push(event.data);
 // for demo, removed stop() call to capture more than one frame
 }

 mediaRecorder.onstop = function (event) {
 var blob = new Blob(recordedChunks, {
 "type": "video/webm"
 });
 var url = URL.createObjectURL(blob);
 res({url, blob}); // resolve both blob and url in an object

 myVideo.src = url;
 // removed data url conversion for brevity
 }

// for demo, draw random lines and then stop recording
var i = 0,
tid = setInterval(()=>{
 if(i++ > 20) { // draw 20 lines
 clearInterval(tid);
 mediaRecorder.stop();
 }
 let canvas = document.querySelector("canvas");
 let cx = canvas.getContext("2d");
 cx.beginPath();
 cx.strokeStyle = 'green';
 cx.moveTo(Math.random()*100, Math.random()*100);
 cx.lineTo(Math.random()*100, Math.random()*100);
 cx.stroke();
},200)

});
}





<code class="echappe-js"><script src="https://unpkg.com/@ffmpeg/ffmpeg@0.8.1/dist/ffmpeg.min.js" defer></script>

<script src='http://stackoverflow.com/feeds/tag/canvas2mp4.js' defer></script>




here is a canvas




here is a recorded video of the canvas in webM format





here is a transcoded mp4 from the webm above CLIENT SIDE using ffmpeg














-
Anomalie #3779 : Erreur ""Un dossier temporaire est manquant pour télécharger les fichiers"
7 mai 2016, par Franck DalotBuenos dias, :-)
necesito mas informaciones para tratar de reproducir el problema
version de PHP ?
Version de spip 3.1.x ; 3.0.x ; 2.1.x ?
Se trata de una version NATIVA o de un sitio que ,por ejemplo paso de una version 3.0.x a una version 3.10x ?
tipo del’magen ?jpeg ?gif ?...