Recherche avancée

Médias (91)

Autres articles (59)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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 (8269)

  • 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 ?

    


  • swscale/x86/input.asm : add x86-optimized planer rgb2yuv functions

    24 novembre 2021, par Mark Reid
    swscale/x86/input.asm : add x86-optimized planer rgb2yuv functions
    

    sse2 only operates on 2 lanes per loop for to_y and to_uv functions, due
    to the lack of pmulld instruction. Emulating pmulld with 2 pmuludq and shuffles
    proved too costly and made to_uv functions slower then the c implementation.

    For to_y on sse2 only float functions are generated,
    I was are not able outperform the c implementation on the integer pixel formats.

    For to_a on see4 only the float functions are generated.
    sse2 and sse4 generated nearly identical performing code on integer pixel formats,
    so only sse2/avx2 versions are generated.

    planar_gbrp_to_y_512_c : 1197.5
    planar_gbrp_to_y_512_sse4 : 444.5
    planar_gbrp_to_y_512_avx2 : 287.5
    planar_gbrap_to_y_512_c : 1204.5
    planar_gbrap_to_y_512_sse4 : 447.5
    planar_gbrap_to_y_512_avx2 : 289.5
    planar_gbrp9be_to_y_512_c : 1380.0
    planar_gbrp9be_to_y_512_sse4 : 543.5
    planar_gbrp9be_to_y_512_avx2 : 340.0
    planar_gbrp9le_to_y_512_c : 1200.5
    planar_gbrp9le_to_y_512_sse4 : 442.0
    planar_gbrp9le_to_y_512_avx2 : 282.0
    planar_gbrp10be_to_y_512_c : 1378.5
    planar_gbrp10be_to_y_512_sse4 : 544.0
    planar_gbrp10be_to_y_512_avx2 : 337.5
    planar_gbrp10le_to_y_512_c : 1200.0
    planar_gbrp10le_to_y_512_sse4 : 448.0
    planar_gbrp10le_to_y_512_avx2 : 285.5
    planar_gbrap10be_to_y_512_c : 1380.0
    planar_gbrap10be_to_y_512_sse4 : 542.0
    planar_gbrap10be_to_y_512_avx2 : 340.5
    planar_gbrap10le_to_y_512_c : 1199.0
    planar_gbrap10le_to_y_512_sse4 : 446.0
    planar_gbrap10le_to_y_512_avx2 : 289.5
    planar_gbrp12be_to_y_512_c : 10563.0
    planar_gbrp12be_to_y_512_sse4 : 542.5
    planar_gbrp12be_to_y_512_avx2 : 339.0
    planar_gbrp12le_to_y_512_c : 1201.0
    planar_gbrp12le_to_y_512_sse4 : 440.5
    planar_gbrp12le_to_y_512_avx2 : 286.0
    planar_gbrap12be_to_y_512_c : 1701.5
    planar_gbrap12be_to_y_512_sse4 : 917.0
    planar_gbrap12be_to_y_512_avx2 : 338.5
    planar_gbrap12le_to_y_512_c : 1201.0
    planar_gbrap12le_to_y_512_sse4 : 444.5
    planar_gbrap12le_to_y_512_avx2 : 288.0
    planar_gbrp14be_to_y_512_c : 1370.5
    planar_gbrp14be_to_y_512_sse4 : 545.0
    planar_gbrp14be_to_y_512_avx2 : 338.5
    planar_gbrp14le_to_y_512_c : 1199.0
    planar_gbrp14le_to_y_512_sse4 : 444.0
    planar_gbrp14le_to_y_512_avx2 : 279.5
    planar_gbrp16be_to_y_512_c : 1364.0
    planar_gbrp16be_to_y_512_sse4 : 544.5
    planar_gbrp16be_to_y_512_avx2 : 339.5
    planar_gbrp16le_to_y_512_c : 1201.0
    planar_gbrp16le_to_y_512_sse4 : 445.5
    planar_gbrp16le_to_y_512_avx2 : 280.5
    planar_gbrap16be_to_y_512_c : 1377.0
    planar_gbrap16be_to_y_512_sse4 : 545.0
    planar_gbrap16be_to_y_512_avx2 : 338.5
    planar_gbrap16le_to_y_512_c : 1201.0
    planar_gbrap16le_to_y_512_sse4 : 442.0
    planar_gbrap16le_to_y_512_avx2 : 279.0
    planar_gbrpf32be_to_y_512_c : 4113.0
    planar_gbrpf32be_to_y_512_sse2 : 2438.0
    planar_gbrpf32be_to_y_512_sse4 : 1068.0
    planar_gbrpf32be_to_y_512_avx2 : 904.5
    planar_gbrpf32le_to_y_512_c : 3818.5
    planar_gbrpf32le_to_y_512_sse2 : 2024.5
    planar_gbrpf32le_to_y_512_sse4 : 1241.5
    planar_gbrpf32le_to_y_512_avx2 : 657.0
    planar_gbrapf32be_to_y_512_c : 3707.0
    planar_gbrapf32be_to_y_512_sse2 : 2444.0
    planar_gbrapf32be_to_y_512_sse4 : 1077.0
    planar_gbrapf32be_to_y_512_avx2 : 909.0
    planar_gbrapf32le_to_y_512_c : 3822.0
    planar_gbrapf32le_to_y_512_sse2 : 2024.5
    planar_gbrapf32le_to_y_512_sse4 : 1176.0
    planar_gbrapf32le_to_y_512_avx2 : 658.5

    planar_gbrp_to_uv_512_c : 2325.8
    planar_gbrp_to_uv_512_sse2 : 1726.8
    planar_gbrp_to_uv_512_sse4 : 771.8
    planar_gbrp_to_uv_512_avx2 : 506.8
    planar_gbrap_to_uv_512_c : 2281.8
    planar_gbrap_to_uv_512_sse2 : 1726.3
    planar_gbrap_to_uv_512_sse4 : 768.3
    planar_gbrap_to_uv_512_avx2 : 496.3
    planar_gbrp9be_to_uv_512_c : 2336.8
    planar_gbrp9be_to_uv_512_sse2 : 1924.8
    planar_gbrp9be_to_uv_512_sse4 : 852.3
    planar_gbrp9be_to_uv_512_avx2 : 552.8
    planar_gbrp9le_to_uv_512_c : 2270.3
    planar_gbrp9le_to_uv_512_sse2 : 1512.3
    planar_gbrp9le_to_uv_512_sse4 : 764.3
    planar_gbrp9le_to_uv_512_avx2 : 491.3
    planar_gbrp10be_to_uv_512_c : 2281.8
    planar_gbrp10be_to_uv_512_sse2 : 1917.8
    planar_gbrp10be_to_uv_512_sse4 : 855.3
    planar_gbrp10be_to_uv_512_avx2 : 541.3
    planar_gbrp10le_to_uv_512_c : 2269.8
    planar_gbrp10le_to_uv_512_sse2 : 1515.3
    planar_gbrp10le_to_uv_512_sse4 : 759.8
    planar_gbrp10le_to_uv_512_avx2 : 487.8
    planar_gbrap10be_to_uv_512_c : 2382.3
    planar_gbrap10be_to_uv_512_sse2 : 1924.8
    planar_gbrap10be_to_uv_512_sse4 : 855.3
    planar_gbrap10be_to_uv_512_avx2 : 540.8
    planar_gbrap10le_to_uv_512_c : 2382.3
    planar_gbrap10le_to_uv_512_sse2 : 1512.3
    planar_gbrap10le_to_uv_512_sse4 : 759.3
    planar_gbrap10le_to_uv_512_avx2 : 484.8
    planar_gbrp12be_to_uv_512_c : 2283.8
    planar_gbrp12be_to_uv_512_sse2 : 1936.8
    planar_gbrp12be_to_uv_512_sse4 : 858.3
    planar_gbrp12be_to_uv_512_avx2 : 541.3
    planar_gbrp12le_to_uv_512_c : 2278.8
    planar_gbrp12le_to_uv_512_sse2 : 1507.3
    planar_gbrp12le_to_uv_512_sse4 : 760.3
    planar_gbrp12le_to_uv_512_avx2 : 485.8
    planar_gbrap12be_to_uv_512_c : 2385.3
    planar_gbrap12be_to_uv_512_sse2 : 1927.8
    planar_gbrap12be_to_uv_512_sse4 : 855.3
    planar_gbrap12be_to_uv_512_avx2 : 539.8
    planar_gbrap12le_to_uv_512_c : 2377.3
    planar_gbrap12le_to_uv_512_sse2 : 1516.3
    planar_gbrap12le_to_uv_512_sse4 : 759.3
    planar_gbrap12le_to_uv_512_avx2 : 484.8
    planar_gbrp14be_to_uv_512_c : 2283.8
    planar_gbrp14be_to_uv_512_sse2 : 1935.3
    planar_gbrp14be_to_uv_512_sse4 : 852.3
    planar_gbrp14be_to_uv_512_avx2 : 540.3
    planar_gbrp14le_to_uv_512_c : 2276.8
    planar_gbrp14le_to_uv_512_sse2 : 1514.8
    planar_gbrp14le_to_uv_512_sse4 : 762.3
    planar_gbrp14le_to_uv_512_avx2 : 484.8
    planar_gbrp16be_to_uv_512_c : 2383.3
    planar_gbrp16be_to_uv_512_sse2 : 1881.8
    planar_gbrp16be_to_uv_512_sse4 : 852.3
    planar_gbrp16be_to_uv_512_avx2 : 541.8
    planar_gbrp16le_to_uv_512_c : 2378.3
    planar_gbrp16le_to_uv_512_sse2 : 1476.8
    planar_gbrp16le_to_uv_512_sse4 : 765.3
    planar_gbrp16le_to_uv_512_avx2 : 485.8
    planar_gbrap16be_to_uv_512_c : 2382.3
    planar_gbrap16be_to_uv_512_sse2 : 1886.3
    planar_gbrap16be_to_uv_512_sse4 : 853.8
    planar_gbrap16be_to_uv_512_avx2 : 550.8
    planar_gbrap16le_to_uv_512_c : 2381.8
    planar_gbrap16le_to_uv_512_sse2 : 1488.3
    planar_gbrap16le_to_uv_512_sse4 : 765.3
    planar_gbrap16le_to_uv_512_avx2 : 491.8
    planar_gbrpf32be_to_uv_512_c : 4863.0
    planar_gbrpf32be_to_uv_512_sse2 : 3347.5
    planar_gbrpf32be_to_uv_512_sse4 : 1800.0
    planar_gbrpf32be_to_uv_512_avx2 : 1199.0
    planar_gbrpf32le_to_uv_512_c : 4725.0
    planar_gbrpf32le_to_uv_512_sse2 : 2753.0
    planar_gbrpf32le_to_uv_512_sse4 : 1474.5
    planar_gbrpf32le_to_uv_512_avx2 : 927.5
    planar_gbrapf32be_to_uv_512_c : 4859.0
    planar_gbrapf32be_to_uv_512_sse2 : 3269.0
    planar_gbrapf32be_to_uv_512_sse4 : 1802.0
    planar_gbrapf32be_to_uv_512_avx2 : 1201.5
    planar_gbrapf32le_to_uv_512_c : 6338.0
    planar_gbrapf32le_to_uv_512_sse2 : 2756.5
    planar_gbrapf32le_to_uv_512_sse4 : 1476.0
    planar_gbrapf32le_to_uv_512_avx2 : 908.5

    planar_gbrap_to_a_512_c : 383.3
    planar_gbrap_to_a_512_sse2 : 66.8
    planar_gbrap_to_a_512_avx2 : 43.8
    planar_gbrap10be_to_a_512_c : 601.8
    planar_gbrap10be_to_a_512_sse2 : 86.3
    planar_gbrap10be_to_a_512_avx2 : 34.8
    planar_gbrap10le_to_a_512_c : 602.3
    planar_gbrap10le_to_a_512_sse2 : 48.8
    planar_gbrap10le_to_a_512_avx2 : 31.3
    planar_gbrap12be_to_a_512_c : 601.8
    planar_gbrap12be_to_a_512_sse2 : 111.8
    planar_gbrap12be_to_a_512_avx2 : 41.3
    planar_gbrap12le_to_a_512_c : 385.8
    planar_gbrap12le_to_a_512_sse2 : 75.3
    planar_gbrap12le_to_a_512_avx2 : 39.8
    planar_gbrap16be_to_a_512_c : 386.8
    planar_gbrap16be_to_a_512_sse2 : 79.8
    planar_gbrap16be_to_a_512_avx2 : 31.3
    planar_gbrap16le_to_a_512_c : 600.3
    planar_gbrap16le_to_a_512_sse2 : 40.3
    planar_gbrap16le_to_a_512_avx2 : 30.3
    planar_gbrapf32be_to_a_512_c : 1148.8
    planar_gbrapf32be_to_a_512_sse2 : 611.3
    planar_gbrapf32be_to_a_512_sse4 : 234.8
    planar_gbrapf32be_to_a_512_avx2 : 183.3
    planar_gbrapf32le_to_a_512_c : 851.3
    planar_gbrapf32le_to_a_512_sse2 : 263.3
    planar_gbrapf32le_to_a_512_sse4 : 199.3
    planar_gbrapf32le_to_a_512_avx2 : 156.8

    Reviewed-by : Paul B Mahol <onemda@gmail.com>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libswscale/x86/input.asm
    • [DH] libswscale/x86/swscale.c
    • [DH] tests/checkasm/sw_gbrp.c
  • I created a Python code to capture live video using FFmpeg, but the output screen only shows noise

    16 octobre 2024, par chun3 hyun

    The code below is Python code that made my computer screen video capture in real time via ffmpeg.

    &#xA;

    When I run the code below, it goes well until a new window named 'Captured Frame' is created. But this 'Captured Frame' window doesn't show the full screen of my computer, and the gray screen is generating a lot of noise.

    &#xA;

    import cv2&#xA;import numpy as np&#xA;import subprocess&#xA;&#xA;def frame_capture():&#xA;    # Set FFmpeg command (capture desired window or area)&#xA;    ffmpeg_command = [&#xA;        &#x27;ffmpeg&#x27;,&#xA;        &#x27;-f&#x27;, &#x27;gdigrab&#x27;,  # Windows screen capture (using gdigrab)&#xA;        &#x27;-framerate&#x27;, &#x27;30&#x27;,  # Setting the Frame Speed&#xA;        &#x27;-i&#x27;, &#x27;desktop&#x27;,  # What to capture (for example, full screen)&#xA;        &#x27;-pix_fmt&#x27;, &#x27;bgr0&#x27;,&#xA;        &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;,  # Video codec settings&#xA;        &#x27;-tune&#x27;, &#x27;zerolatency&#x27;,&#xA;        &#x27;-an&#x27;,  # Disable audio&#xA;        &#x27;-sn&#x27;,  # Disable Caption&#xA;        &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-&#x27;&#xA;    ]&#xA;&#xA;    # Running the FFmpeg process&#xA;    process = subprocess.Popen(ffmpeg_command, stdout=subprocess.PIPE, bufsize=10**8)&#xA;&#xA;    while True:&#xA;        # Read Frame from FFmpeg (Resolution Example: 1920x1080)&#xA;        raw_frame = process.stdout.read(1920 * 1080 * 3)  # 1920x1080 resolution, BGR format&#xA;        if not raw_frame:&#xA;            break  # Shut down the loop when you can no longer receive frames&#xA;&#xA;        # Converting frame data to a numpy array&#xA;        frame = np.frombuffer(raw_frame, np.uint8).reshape((1080, 1920, 3))&#xA;&#xA;        # Add frame processing code here&#xA;        # Example: Showing a frame on the screen&#xA;        cv2.imshow(&#x27;Captured Frame&#x27;, frame)&#xA;&#xA;        # Press the &#x27;q&#x27; key to end&#xA;        if cv2.waitKey(1) &amp; 0xFF == ord(&#x27;q&#x27;):&#xA;            break&#xA;&#xA;    # End of process and release of resources&#xA;    process.stdout.close()&#xA;    process.wait()&#xA;    cv2.destroyAllWindows()&#xA;frame_capture()&#xA;

    &#xA;

    What could I have done wrong ? When I directly input the FFmpeg command in the Windows command prompt(knows as 'cmd') as shown below to save the video (in .mp4 format), I can see that the screen is output normally in the saved file. It seems that FFmpeg itself is installed correctly, but I don't know what the cause is.

    &#xA;

    hwnd=132554 -pix_fmt yuv420p -vf "scale=iw-mod(iw\,2):ih-mod(ih\,2)" -draw_mouse 1 -t 10 output.mp4&#xA;

    &#xA;

    The handle number written above was the handle of the active Chrome window on my computer.

    &#xA;

    My ffmpeg version is 2024-10-10-git-0f5592cfc7-full_build-www.gyan.dev My Python version is 3.12.4&#xA;My Windows version and build are as specified below.&#xA;:Windows 11 Home, 10.0.22631

    &#xA;

    Capturing the computer screen with FFmpeg. I tried it, but the output screen shows only noise.

    &#xA;