Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (89)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

Sur d’autres sites (10263)

  • ffmpeg chains parameters and options while being used in a loop

    10 janvier 2024, par Simon Nazarenko

    I got a code that generates videos from scratch (got gifs, captions and audio). It works amazing when done once, however, when put in a loop and it should create more than 1 video it freezes being caused by memory leak. Upon investigation I realized that ffmpeg (v1.1.0) chains the loop iterations carrying the parameters and options from the first iteration to the second. It then breaks (overwrites) the first video and infinitely writes the second.

    


    This is my dependency

    


    const ffmpeg = require("fluent-ffmpeg")()
  .setFfprobePath(ffprobe.path)
  .setFfmpegPath(ffmpegInstaller.path)


    


    It looks like this

    


    async function convertGifToVideo(
  gifFile,
  audioFile,
  subtitlesFile,
  tempDirectory
) {
  return new Promise((resolve, reject) => {
    const outputFile = `${tempDirectory}/video_${Date.now()}.mp4`
    
    ffmpeg
      .input(gifFile)
      .inputFormat("gif")
      .inputOptions("-stream_loop -1")
      .input(audioFile)
      .outputOptions("-shortest")
      .outputOptions(`-vf subtitles=${subtitlesFile}`)
      .outputOptions("-report")
      .output(outputFile)
      .on("end", () => {
        console.log(`Combined ${gifFile} and ${audioFile} into ${outputFile}`)
        resolve(outputFile)
      })
      .on("error", (err, stdout, stderr) => {
        console.error("Error combining GIF and audio:", err)
        console.error("ffmpeg stdout:", stdout)
        console.error("ffmpeg stderr:", stderr)
        reject(err)
      })
      .run()
  })
}


    


    And it's called in a loop

    


    for (const key in script) {
    if (script.hasOwnProperty(key)) {
      ...stuff

      const videoFileName = await convertGifToVideo(
        gifFileName,
        audioFileName,
        subtitlesFileName,
        tempDirectory
      )
    }
  }


    


    Here is a piece of log from the first video generation

    


    


    ffmpeg started on 2024-01-10 at 02:58:52
Report written to "ffmpeg-20240110-025852.log"
Command line :
/home/simon/Documents/AFYTUBE/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -f gif -stream_loop -1 -i ./temp/gif_funny_frogs.gif -i ./temp/funny_frogs.mp3 -y -shortest -vf "subtitles=./temp/funny_frogs.srt" -report ./temp/video_1704880732780.mp4

    


    


    Here is a piece of log from the second one

    


    


    /home/simon/Documents/AFYTUBE/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -f gif -stream_loop -1 -i ./temp/gif_funny_frogs.gif -i ./temp/funny_frogs.mp3 -f gif -stream_loop -1 -i ./temp/gif_leg_exercises.gif -i ./temp/leg_exercises.mp3 -y -shortest -vf "subtitles=./temp/funny_frogs.srt" -report -shortest -vf "subtitles=./temp/leg_exercises.srt" -report ./temp/video_1704880732780.mp4 ./temp/video_1704880750879.mp4

    


    


    Any ideas what I am doing wrong ?

    


  • avcodec/libjxl.h : include version.h

    23 janvier 2024, par Leo Izen
    avcodec/libjxl.h : include version.h
    

    This file has been exported since our minimum required version (0.7.0),
    but it wasn't documented. Instead it was transitively included by
    <jxl/decode.h> (but not jxl/encode.h), which ffmpeg relied on.

    libjxl broke its API in libjxl/libjxl@66b959239355aef5255 by removing
    the transitive include of version.h, and they do not plan on adding
    it back. Instead they are choosing to leave the API backwards-
    incompatible with downstream callers written for some fairly recent
    versions of their API.

    As a result, we include <jxl/version.h> to continue to build against
    more recent versions of libjxl. The version macros removed are also
    present in that file, so we no longer need to redefine them.

    Signed-off-by : Leo Izen <leo.izen@gmail.com>

    • [DH] libavcodec/libjxl.h
  • How to read frames of a video and write them on another video output using FFMPEG and nodejs

    29 décembre 2023, par Aviato

    I am working on a project where I need to process video frames one at a time in Node.js. I aim to avoid storing all frames in memory or the filesystem due to resource constraints. I plan to use the ffmpeg from child processes for video processing.&#xA;I tried reading a video file and then output frames of it in the filesystem first for testing purposes :-

    &#xA;

    const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;  &#x27;-i&#x27;, videoFile,&#xA;  &#x27;testfolder/%04d.png&#x27; // Output frames to stdout&#xA;]);&#xA;

    &#xA;

    and the above code works fine, it saves the video frames as png files in the filesystem. Now instead of saving them in the file system, I want to read the frames on at a time and use a image manipulation library and than write the final edited frames to another video as output

    &#xA;

    I tried this :-

    &#xA;

    const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;  &#x27;-i&#x27;, videoFile,&#xA;  &#x27;pipe:1&#x27; // Output frames to stdout&#xA;]);&#xA;&#xA;const ffmpegOutputProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;  &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;  &#x27;outputFileName.mp4&#x27;&#xA;  ]);&#xA;&#xA;ffmpegProcess.stdout.on(&#x27;data&#x27;, (data) => {&#xA;  // Process the frame data as needed&#xA;  console.log(&#x27;Received frame data:&#x27;);&#xA;  ffmpegOutputProcess.stdin.write(data)&#xA;});&#xA;&#xA;ffmpegProcess.on(&#x27;close&#x27;, (code) => {&#xA;  if (code !== 0) {&#xA;    console.error(`ffmpeg process exited with code ${code}`);&#xA;  } else {&#xA;    console.log(&#x27;ffmpeg process successfully completed&#x27;);&#xA;    &#xA;  }&#xA;});&#xA;&#xA;// Handle errors&#xA;ffmpegProcess.on(&#x27;error&#x27;, (err) => {&#xA;  console.error(&#x27;Error while spawning ffmpeg:&#x27;, err);&#xA;});&#xA;

    &#xA;

    But when I tried above code and also some other modifications in the input and output suffix in the command I got problems as below :-

    &#xA;

      &#xA;
    1. ffmpeg process exited with code 1
    2. &#xA;

    3. The final output video was corrupted when trying to initializing the filters for commands :-
    4. &#xA;

    &#xA;

    &#xA;const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA; &#x27;-i&#x27;, videoFile,&#xA; &#x27;-f&#x27;, &#x27;rawvideo&#x27;,&#xA; &#x27;-pix_fmt&#x27;, &#x27;rgb24&#x27;,&#xA; &#x27;pipe:1&#x27; // Output frames to stdout&#xA;]);&#xA;&#xA;const ffmpegOutputCommand = [&#xA; &#x27;-f&#x27;, &#x27;rawvideo&#x27;,&#xA; &#x27;-pix_fmt&#x27;, &#x27;rgb24&#x27;,&#xA; &#x27;-s&#x27;, &#x27;1920x1080&#x27;,&#xA; &#x27;-r&#x27;, &#x27;30&#x27;,&#xA; &#x27;-i&#x27;, &#x27;-&#x27;,&#xA; &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA; &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA; outputFileName&#xA;];&#xA;

    &#xA;

    Thank you so much in advance :)

    &#xA;