Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (37)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (6099)

  • Révision 22126 : Report minimal de r22116 r22118 r22119 : #3418 : Octave utilise une configuration...

    10 mai 2015, par cedric -
  • How to convert a Buffer to a video with fluent-ffmpeg and write the output to a WritableStream

    30 octobre 2023, par isaac.g

    For some context, I need to quickly render a small video (6.5 seconds long, at 15 FPS), and send it in a Discord channel with discord.js. I don't want to ever have to write anything to disk, because that'll slow it down and I just don't need it downloaded. So far, I was able to write the video to disk, but now I want to skip that step and send the video Buffer straight to discord.js. I was also able to output the video from ffmpeg to Discord as an audio file, but when I try to use the .mp4 format, I get a "Conversion failed !" error.

    


    I rendered the individual frames for the video using the canvas module, and export all of them as pngs using canvas.toBuffer("image/png");, and then push all the frames to an array. Then I combine the frames to one Buffer using Buffer.concat(), and then create a ReadableStream from the nodejs stream module. I also needed to write a custom WritableStream class that implements the _write method. Here's the class :

    


    class MyWritable extends Stream.Writable {
    constructor() {
        super();
        this.buffer = Buffer.from([]);
    }

    _write(chunk, encoding, callback) {
        this.buffer = Buffer.concat([this.buffer, chunk]);
        callback();
    }
}


    


    And here's how I implement everything using fluent-ffmpeg :

    


    const allFrames = Buffer.concat(framesArray);
const readable = Stream.Readable.from(allFrames);
const writable = new MyWritable();

const output = await (new Promise((resolve, reject) => {
    ffmpeg()
        .input(readableStream)
        .inputOptions([
            `-framerate 15`,
        ])
        .input("path_to_audio_file.mp3")
        .videoCodec("libx264")
        .format("mp4")
        .outputOptions([
            "-pix_fmt yuv420p"
        ])
        .duration(6.5)
        .fps(15)
        .writeToStream(writable)
        .on("finish", () => {
            // this is never reached, but it should resolve the promise with all the data that was written to the WritableStream (which should be the video)
            resolve(writable.buffer);
        })
        .on("error", (err) => {
            // this is never reached also
            reject(err);
        })
}))

// then I try to send the output buffer to Discord as an attachment, but I don't ever get here anyway


    


    And here's the error I get :

    


    node:events:491&#xA;      throw er; // Unhandled &#x27;error&#x27; event&#xA;      ^&#xA;&#xA;Error: ffmpeg exited with code 1: Conversion failed!&#xA;&#xA;    at ChildProcess.<anonymous> (/Users/isaac/Documents/Github/DiscordBot/node_modules/fluent-ffmpeg/lib/processor.js:182:22)&#xA;    at ChildProcess.emit (node:events:513:28)&#xA;    at ChildProcess._handle.onexit (node:internal/child_process:293:12)&#xA;Emitted &#x27;error&#x27; event on FfmpegCommand instance at:&#xA;    at emitEnd (/Users/isaac/Documents/Github/DiscordBot/node_modules/fluent-ffmpeg/lib/processor.js:424:16)&#xA;    at endCB (/Users/isaac/Documents/Github/DiscordBot/node_modules/fluent-ffmpeg/lib/processor.js:544:13)&#xA;    at handleExit (/Users/isaac/Documents/Github/DiscordBot/node_modules/fluent-ffmpeg/lib/processor.js:170:11)&#xA;    at ChildProcess.<anonymous> (/Users/isaac/Documents/Github/DiscordBot/node_modules/fluent-ffmpeg/lib/processor.js:182:11)&#xA;    at ChildProcess.emit (node:events:513:28)&#xA;    at ChildProcess._handle.onexit (node:internal/child_process:293:12)&#xA;</anonymous></anonymous>

    &#xA;

    Like I said earlier, if I change the format to an audio format, it exports perfectly fine. But I have no idea where the problem is with converting to a video.&#xA;Thanks in advance.

    &#xA;

  • Convert from webm to gif using FFMPEG with minimal loss in quality

    27 novembre 2017, par Neo Herakles

    so I want to convert all my webm files to gif but the quality degraded incredibly, there’s some barely visible lines along the picture, tried using crf to improve it but it doesn’t, could you help me ? Here’s my code :

    @echo off
    setlocal
    for %%G in ("%~dp0\webm\*.webm") do (
       ffmpeg -i "%%G" -pix_fmt rgb24 -crf 17 "%%G.gif"
       )
    )
    endlocal
    pause

    Also, could you instruct me in a way in which I can remove the .webm from the output filename ? it outputs as "(file name).webm.gif"