Recherche avancée

Médias (91)

Autres articles (31)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (2321)

  • FFMPEG progress bar in php

    16 mars 2017, par Mick Jack

    I am using ffmpeg to convert a video file large files take a long time to get encode. i will like to show a progress bar with a percentage/time remaining

    i saw and tried this example but for some reason the progress bar is not showing.

    Html form

    <form action="upload.php" method="post" enctype="multipart/form-data">
    <label for="file"><span></span></label>
    <input type="file" />
    <br />
    Please enter video title:
    <br />
    <input />
    <br />
    <input type="submit" value="Submit" />
    </form>

    <div title="test">
           <h5>Encoding percentage</h5>
           <code class="echappe-js">&lt;script src=&quot;https://code.jquery.com/jquery-2.1.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script&gt;<br />
                   $(document).ready(function(){<br />
                   setInterval(function(){<br />
                   $(&quot;#screen&quot;).load('progress.php')<br />
                   }, 10000);<br />
                   });<br />
                   &lt;/script&gt;

    upload.php ffmpeg script

    shell_exec("C:\\ffmpeg\\bin\\ffmpeg.exe -y -i ".$target_file." -c:v libx264 -s:v 854x480 -c:a copy \"{$newFileName}\" > logfile.txt 2>&amp;1"); // script to encode video

    Progress.php

    $content = @file_get_contents('blocks.txt');

               if($content){
               //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 "Duration: " . $duration . "<br />";
               echo "Current Time: " . $time . "<br />";
               echo "Progress: " . $progress . "%";

    }

    ?>
  • Lt (mod) gte () in ffmpeg. Cut 1 second and loop 1 second video

    16 août 2020, par JW dvl

    Sorry my language is limited.&#xA;I need help with ffmpeg.&#xA;Let's say I have a 1-minute video. Every 10 seconds, the video cuts 1 second at seconds 6 and repeats 1 second at seconds 10.&#xA;This means there will be 1,2,3,4,5,7,8,9,10,10.&#xA;I searched Lt (mod) gte () in ffmpeg but couldn't do it yet.&#xA;Please help me. Thanks so much 

    &#xA;

  • How to get the correct result file data if I use Web Worker on ffmpeg.js ?

    23 avril 2019, par SuperBerry

    I have tried to use FFMPEG.js (https://github.com/Kagami/ffmpeg.js) to convert mp3 files on the browser/client side, and I followed the usage of the page of Web Worker. However, the worker works well on the converting and it seems the file has been converted, but I cannot get the correct result file data back.

    Here my code is :

    <code class="echappe-js">&lt;script&gt;<br />
    <br />
    var stdout = &quot;&quot;;<br />
    var outputhtml=&quot;&quot;;<br />
    var stderr = &quot;&quot;;<br />
    var outputfile;<br />
    <br />
    var sampleVideoData;<br />
    <br />
    function retrieveSampleVideo() {<br />
     var oReq = new XMLHttpRequest();<br />
     oReq.open(&quot;GET&quot;, &quot;short.mp3&quot;, true);<br />
     oReq.responseType = &quot;arraybuffer&quot;;<br />
    <br />
     oReq.onload = function (oEvent) {<br />
       var arrayBuffer = oReq.response;<br />
       if (arrayBuffer) {<br />
         sampleVideoData = new Uint8Array(arrayBuffer);<br />
       }<br />
     };<br />
    <br />
     oReq.send(null);<br />
    }<br />
    <br />
    function getDownloadLink(fileData, fileName) {<br />
     var a = document.createElement('a');<br />
     a.download = fileName;<br />
     var blob = new Blob([fileData]);<br />
     var src = window.URL.createObjectURL(blob);<br />
     a.href = src;<br />
     a.textContent = 'Click here to download ' + fileName + &quot;!&quot;;<br />
     document.body.appendChild(a);<br />
    }<br />
    <br />
    var worker = new Worker(&quot;ffmpeg-worker-mp4.js&quot;);<br />
    <br />
    retrieveSampleVideo();<br />
    <br />
    var memfs =[];  <br />
    <br />
    //[, {name: &quot;input.mp3&quot;, data: output}];<br />
    <br />
    worker.onmessage = function(e) {<br />
     var msg = e.data;<br />
    <br />
     switch (msg.type) {<br />
     case &quot;ready&quot;:<br />
       console.log(&quot;ready: &quot; + msg.data);<br />
       alert(sampleVideoData.length);<br />
       memfs.push({name: &quot;input.mp3&quot;, data: sampleVideoData});<br />
       memfs.push({name: &quot;output.mp3&quot;, data: outputfile});<br />
    <br />
       worker.postMessage({type: &quot;run&quot;, MEMFS: memfs, arguments: [&quot;-i&quot;, &quot;input.mp3&quot;, &quot;-y&quot;, &quot;output.mp3&quot;]});<br />
    <br />
    <br />
       break;<br />
     case &quot;stdout&quot;:<br />
       console.log(&quot;stdout: &quot; + msg.data);<br />
       stdout += msg.data + &quot;\n&quot;;<br />
       outputhtml+=msg.data + &quot;&lt;br&gt;&quot;;<br />
    <br />
       break;<br />
     case &quot;stderr&quot;:<br />
       console.log(&quot;stderr: &quot; + msg.data);<br />
       stderr += msg.data + &quot;\n&quot;;<br />
       outputhtml+=msg.data + &quot;&lt;br&gt;&quot;;<br />
    <br />
       break;<br />
    <br />
     case &quot;exit&quot;:<br />
    <br />
       console.log(&quot;Process exited with code &quot; + msg.data);<br />
       console.log(stdout);<br />
       document.write(outputhtml);<br />
    <br />
       getDownloadLink(outputfile, &quot;output.mp3&quot;);<br />
       worker.terminate();<br />
    <br />
    <br />
       break;<br />
     }<br />
    };<br />
    <br />
       &lt;/script&gt;

    And the console output looks good :

    stderr: ffmpeg version n3.1.2 Copyright (c) 2000-2016 the FFmpeg developers index.html:66:4
    stderr:   built with emcc (Emscripten gcc/clang-like replacement) 1.36.7 () index.html:66:4
    stderr:   configuration: --cc=emcc --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --enable-avfilter --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vp8 --enable-decoder=vp9 --enable-decoder=theora --enable-decoder=mpeg2video --enable-decoder=mpeg4 --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=png --enable-decoder=mjpeg --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=ac3 --enable-decoder=aac --enable-decoder=ass --enable-decoder=ssa --enable-decoder=srt --enable-decoder=webvtt --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=avi --enable-demuxer=mov --enable-demuxer=flv --enable-demuxer=mpegps --enable-demuxer=image2 --enable-demuxer=mp3 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl --disable-securetransport --disable-xlib --disable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags=-I../lame/dist/include --extra-ldflags=-L../lame/dist/lib index.html:66:4
    stderr:   libavutil      55. 28.100 / 55. 28.100 index.html:66:4
    stderr:   libavcodec     57. 48.101 / 57. 48.101 index.html:66:4
    stderr:   libavformat    57. 41.100 / 57. 41.100 index.html:66:4
    stderr:   libavfilter     6. 47.100 /  6. 47.100 index.html:66:4
    stderr:   libswscale      4.  1.100 /  4.  1.100 index.html:66:4
    stderr:   libswresample   2.  1.100 /  2.  1.100 index.html:66:4
    stderr: [mp3 @ 0x812380] Warning: not compiled with thread support, using thread emulation index.html:66:4
    stderr: Input #0, mp3, from 'input.mp3': index.html:66:4
    stderr:   Metadata: index.html:66:4
    stderr:     encoder         : Lavf57.66.101 index.html:66:4
    stderr:   Duration: 00:00:03.02, start: 0.023021, bitrate: 128 kb/s index.html:66:4
    stderr:     Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s index.html:66:4
    stderr:     Metadata: index.html:66:4
    stderr:       encoder         : Lavc57.75 index.html:66:4
    stderr: [mp3 @ 0x8240f0] Warning: not compiled with thread support, using thread emulation index.html:66:4
    stderr: [libmp3lame @ 0x81b8a0] Warning: not compiled with thread support, using thread emulation index.html:66:4
    stderr: [mp3 @ 0x80b0f0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. index.html:66:4
    stderr: Output #0, mp3, to 'output.mp3': index.html:66:4
    stderr:   Metadata: index.html:66:4
    stderr:     TSSE            : Lavf57.41.100 index.html:66:4
    stderr:     Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p index.html:66:4
    stderr:     Metadata: index.html:66:4
    stderr:       encoder         : Lavc57.48.101 libmp3lame index.html:66:4
    stderr: Stream mapping: index.html:66:4
    stderr:   Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame)) index.html:66:4
    stderr: Press [q] to stop, [?] for help index.html:66:4
    stderr: size=      47kB time=00:00:03.00 bitrate= 129.6kbits/s speed=10.9x    index.html:66:4
    stderr: video:0kB audio:47kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.489831% index.html:66:4
    Process exited with code 0

    I have set the output into the memfs in the code :

    memfs.push(name : "output.mp3", data : outputfile) ;

    But I cannot get the result file data in outputfile to create the blob downloadd link.

  • Boussole SPIP

    SPIP.net-La documentation officielle et téléchargement de (...) SPIP Code-La documentation du code de SPIP Programmer SPIP-La documentation pour développer avec (...) Traduire SPIP-Espace de traduction de SPIP et de ses (...) Plugins SPIP-L'annuaire des plugins SPIP SPIP-Contrib-L'espace des contributions à SPIP Forge SPIP-L'espace de développement de SPIP et de ses (...) Discuter sur SPIP-Les nouveaux forums de la communauté (...) SPIP Party-L'agenda des apéros et autres rencontres (...) Médias SPIP-La médiathèque de SPIP SPIP Syntaxe-Tester l'édition de texte dans SPIP