Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (109)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

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

Sur d’autres sites (9735)

  • FFmpeg zoompan filter always arcs when panning — how to get a straight‐line pan to a focus rectangle center ?

    26 mai, par Mykyta Manuilenko

    I’m trying to generate a 10s video from a single PNG image with FFmpeg’s zoompan filter, where the crop window zooms in from the image center and simultaneously pans in a perfectly straight line to the center of a predefined focus rectangle.

    


    My input parameters :

    


    "zoompan": {
  "timings": {
    "entry": 0.5, // show full frame
    "zoom": 1, // zoom-in/zoom-out timing
    "outro": 0.5 // show full frame in the end
  },
  "focusRect": {
    "x": 1086.36,
    "y": 641.87,
    "width": 612.44,
    "height": 344.86
  }
}


    


    My input/output values :

    


      

    • fps : 25
    • 


    • image input dimensions : 1920 × 1080
    • 


    • output video dimensions : 1920 × 1080
    • 


    


    My calculations :

    


        // Width of the bounding box to zoom into
    const bboxWidth = focusRect.width;

    // Height of the bounding box to zoom into
    const bboxHeight = focusRect.height;

    // X coordinate (center of the bounding box)
    const bboxX = focusRect.x + focusRect.width / 2;

    // Y coordinate (center of the bounding box)
    const bboxY = focusRect.y + focusRect.height / 2;

    // Time (in seconds) to wait before starting the zoom-in
    const preWaitSec = timings.entry;

    // Duration (in seconds) of the zoom-in/out animation
    const zoomSec = timings.zoom;

    // Time (in seconds) to wait on the last frame after zoom-out
    const postWaitSec = timings.outro;

    // Frame counts
    const preWaitF = Math.round(preWaitSec * fps);
    const zoomInF = Math.round(zoomSec * fps);
    const zoomOutF = Math.round(zoomSec * fps);
    const postWaitF = Math.round(postWaitSec * fps);

    // Calculate total frames and holdF
    const totalF = Math.round(duration * fps);

    // Zoom target so that bbox fills the output
    const zoomTarget = Math.max(
      inputWidth / bboxWidth,
      inputHeight / bboxHeight,
    );

    // Calculate when zoom-out should start (totalF - zoomOutF - postWaitF)
    const zoomOutStartF = totalF - zoomOutF - postWaitF;

    // Zoom expression (simple linear in/out)
    const zoomExpr = [
      // Pre-wait (hold at 1)
      `if(lte(on,${preWaitF}),1,`,
      // Zoom in (linear)
      `if(lte(on,${preWaitF + zoomInF}),1+(${zoomTarget}-1)*((on-${preWaitF})/${zoomInF}),`,
      // Hold zoomed
      `if(lte(on,${zoomOutStartF}),${zoomTarget},`,
      // Zoom out (linear)
      `if(lte(on,${zoomOutStartF + zoomOutF}),${zoomTarget}-((${zoomTarget}-1)*((on-${zoomOutStartF})/${zoomOutF})),`,
      // End
      `1))))`,
    ].join('');

    // Center bbox for any zoom
    const xExpr = `${bboxX} - (${outputWidth}/zoom)/2`;
    const yExpr = `${bboxY} - (${outputHeight}/zoom)/2`;

    // Build the filter string
    const zoomPanFilter = [
      `zoompan=`,
      `s=${outputWidth}x${outputHeight}`,
      `:fps=${fps}`,
      `:d=${totalF}`,
      `:z='${zoomExpr}'`,
      `:x='${xExpr}'`,
      `:y='${yExpr}'`,
      `,gblur=sigma=0.5`,
      `,minterpolate=mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=${fps}`,
    ].join('');


    


    So, my FFmpeg command looks like :

    


    ffmpeg -t 10 -framerate 25 -loop 1 -i input.png -y -filter_complex "[0:v]zoompan=s=1920x1080:fps=25:d=250:z='if(lte(on,13),1,if(lte(on,38),1+(3.1350009796878058-1)*((on-13)/25),if(lte(on,212),3.1350009796878058,if(lte(on,237),3.1350009796878058-((3.1350009796878058-1)*((on-212)/25)),1))))':x='1392.58 - (1920/zoom)/2':y='814.3 - (1080/zoom)/2',gblur=sigma=0.5,minterpolate=mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=25,format=yuv420p,pad=ceil(iw/2)*2:ceil(ih/2)*2" -vcodec libx264 -f mp4 -t 10 -an -crf 23 -preset medium -copyts output.mp4


    


    Actual behavior :

    


    The pan starts at the image center, but follows a curved (arc-like) trajectory before it settles on the focus‐rect center (first it goes to the right bottom corner and then to the focus‐rect center).

    


    Expected behavior :

    


    The pan should move the crop window’s center in a perfectly straight line from (iw/2, ih/2) to (1392.58, 814.3) over the 25-frame zoom‐in (similar to pinch-zooming on a smartphone).

    


    Questions :

    


      

    • How can I express a truly linear interpolation of the crop window center inside zoompan so that the pan path is a straight line in source coordinates ?

      


    • 


    • Is there a better way (perhaps using different FFmpeg filters or scripting) to achieve this effect ?

      


    • 


    


  • Anomalie #3630 : Logo d’auteur et fonction de recherche de logo

    29 décembre 2015, par b b

    Salut, je ne comprends pas quand tu dis :

    Or la description parle de "type", et non pas d’id.

    Le phpdoc de la fonction mentionne bien l’id, cf : http://code.spip.net/autodoc/tree/ecrire/public/quete.php.html#function_quete_logo

    Quel code utilises-tu et quel résultat attends-tu ?

  • Why is the ffmpeg `-vsync passthrough` option not extracting the same number of frames as shown in the printed info ?

    3 juin 2022, par aininja

    I am using ffmpeg to extract all the frames in a video. To get the timestamps of each frame, I'm using the -vf showinfo filter and matching the frame numbers. The problem is that sometimes the number of frames shown in the info doesn't match up with the number of frames extracted. Why could this be happening ? Is there some default output option that I need to change to avoid this ? Is this non-deterministic behavior a bug ?

    


    The commands used to extract and inspect the frames are :

    


    $ mkdir frames
$ ffmpeg -i video.mp4 -f image2 -vf showinfo -vsync passthrough -q:v 1 frames/%05d.jpg 2> info.txt
$ NUM_FRAMES_INFO=$(cat info.txt | grep pts_time | wc -l)
$ NUM_FRAMES_JPGS=$(ls frames/*.jpg | wc -l)
$ echo ${NUM_FRAMES_INFO} ?= ${NUM_FRAMES_JPGS}


    


    For most videos, this produces the correct outputs all the time. For some videos, however, there is a mismatch occasionally. Also worth mentioning is that MP4 videos are the only ones used and tested. These videos generally only had a single video stream in them.