Recherche avancée

Médias (91)

Autres articles (49)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (5096)

  • Issues with MediaSourceExtension

    4 janvier 2023, par engine32

    I want to livestream audio only using MSE. I would like to send data/files via websockets, therefore no HLS nor DASH.

    


    But until I implement websockets, I thought to give it a try by statically loading the song in an array.

    


    Here is my code so far :

    


    <audio controls="controls"></audio>&#xA;..&#xA;<code class="echappe-js">&lt;script&gt;&amp;#xA;  const ms = new MediaSource();&amp;#xA;  var ae = document.getElementById(&quot;ap&quot;);&amp;#xA;  ae.src = URL.createObjectURL(ms);&amp;#xA;  ms.addEventListener(&amp;#x27;sourceopen&amp;#x27;, msOpen);&amp;#xA;  &amp;#xA;function msOpen(e) {&amp;#xA;  URL.revokeObjectURL(ae.src);&amp;#xA;  var mse = e.target;&amp;#xA;  const sourceBuffer = mse.addSourceBuffer(&amp;#x27;audio/mp4&amp;#x27;);&amp;#xA;  var u8A0 = new Uint8Array([0x00, 0x00, 0x00, 0x1C, 0x66, ...]);&amp;#xA;  sourceBuffer.appendBuffer(u8A0.buffer);&amp;#xA;  &amp;#xA;  sourceBuffer.addEventListener(&amp;#x27;updateend&amp;#x27;, function() {&amp;#xA;    if (!sourceBuffer.updating &amp;amp;&amp;amp; mse.readyState === &amp;#x27;open&amp;#x27;) {&amp;#xA;      mse.endOfStream();&amp;#xA;      console.log(&amp;#x27;Audio is ready to play!&amp;#x27;);&amp;#xA;    }&amp;#xA;  });&amp;#xA;}  &amp;#xA;&lt;/script&gt;&#xA;&#xA;

    &#xA;

    The result is that there are no errors in the debug window and the audio element correctly shows the duration of the song, about two min and half. However, once I click Play, the duration shows 0 (zero) and the song is not played. If I try to pause and play again, the debug window says :

    &#xA;

    *"Uncaught (in promise) DOMException : The fetching process for the media resource was aborted by the user agent at the user's request".&#xA;*&#xA;This is the ffmpeg command I used to prepare the file :

    &#xA;

    ffmpeg -i m.wav -c:a aac -b:a 32k -f mp4 output.mp4

    &#xA;

    Any help would be well appreciated.&#xA;Thank you.

    &#xA;

  • Video Manipulation with ffmpeg : Troubleshooting Conversion Issues

    26 janvier 2024, par Barno

    I want to manipulate my video using ffmpeg. I retrieve the stream from S3 with the following function :

    &#xA;

    async function getImageBufferFromS3(imageUrl) {&#xA;    const { bucketName, objectKey } = extractS3InfoFromUrl(imageUrl);&#xA;    const s3Client = configureS3Client();&#xA;&#xA;    const getObjectCommand = new GetObjectCommand({&#xA;        Bucket: bucketName,&#xA;        Key: objectKey&#xA;    });&#xA;&#xA;    const data = await s3Client.send(getObjectCommand);&#xA;    const imageBuffer = await streamToBuffer(data.Body);&#xA;    return imageBuffer;&#xA;}&#xA;&#xA;async function streamToBuffer(stream) {&#xA;    return new Promise((resolve, reject) => {&#xA;        const chunks = [];&#xA;        stream.on(&#x27;data&#x27;, (chunk) => chunks.push(chunk));&#xA;        stream.on(&#x27;error&#x27;, reject);&#xA;        stream.on(&#x27;end&#x27;, () => resolve(Buffer.concat(chunks)));&#xA;    });&#xA;}&#xA;

    &#xA;

    Now, I want to use ffmpeg to add text to it. First, I'd like to obtain the "clean" video :

    &#xA;

    module.exports.createVideoWithTextAndBackground = async (videoBuffer, customText = null) => {&#xA;  try {&#xA;    if (!customText) {&#xA;      return videoBuffer;&#xA;    }&#xA;    &#xA;    const fontPath = __dirname &#x2B; &#x27;/../public/fonts/Satoshi-Medium.ttf&#x27;;&#xA;&#xA;    try {&#xA;      return await new Promise((resolve, reject) => {&#xA;        const input = new stream.PassThrough();&#xA;        input.end(videoBuffer);&#xA;&#xA;        const output = new stream.Writable();&#xA;        const chunks = [];&#xA;&#xA;        output._write = (chunk, encoding, next) => {&#xA;          chunks.push(chunk);&#xA;          next();&#xA;        };&#xA;&#xA;        output.on(&#x27;finish&#x27;, () => {&#xA;          const resultBuffer = Buffer.concat(chunks);&#xA;          resolve(resultBuffer);&#xA;        });&#xA;&#xA;        output.on(&#x27;error&#x27;, (err) => {&#xA;          reject(err);&#xA;        });&#xA;&#xA;        ffmpeg()&#xA;          .input(input)&#xA;          .inputFormat(&#x27;mp4&#x27;)&#xA;          .toFormat(&#x27;mp4&#x27;)&#xA;          .pipe(output);&#xA;      });&#xA;    } catch (error) {&#xA;      console.error(error);&#xA;      throw error;&#xA;    }&#xA;&#xA;  } catch (error) {&#xA;    console.error(error);&#xA;    throw error;&#xA;  }&#xA;};&#xA;

    &#xA;

    However, I encountered the following error :

    &#xA;

    Error: ffmpeg exited with code 183: frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=N/A bitrate=N/A speed=N/A&#xA;

    &#xA;

    Conversion failed !

    &#xA;

    I don't face any issues when I don't use ffmpeg. I even tried ffmpeg -i to create a video with text using my console, confirming that ffmpeg works on my computer.

    &#xA;

  • Having issues finding the options to lower Quality with Animation Codec

    1er octobre 2018, par Necessary Null

    I’m trying to find if its possible to specify quality when converting to animation codec.

    I’ve used this bit of code and don’t see anything about quality.

    ffmpeg -h encoder=qtrle

    I know this is my generic command to get to animation codec

    ffmpeg -i input.mp4 -codec copy -c:v qtrle output.mov

    Any advice ?