Recherche avancée

Médias (0)

Mot : - Tags -/utilisateurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (71)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (13397)

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

      


    • 


    


  • convert image stream received from ros subscribe topic straight to video with ffmpeg

    20 mai 2021, par techyidiot

    What i want to do is generate a video file(mp4 or mkv format) with ffmpeg from the receiving frames simultaneously without saving images on storage. Attached below is my python ROS subscriber code.

    


    import cv2
from cv_bridge import CvBridge
import rospy
from sensor_msgs.msg import Image
import numpy as np


def callback(data):
    # Used to convert between ROS and OpenCV images
    br = CvBridge()

    # Output debugging information to the terminal
    rospy.loginfo("receiving video frame")
    # Convert ROS Image message to OpenCV image
    current_frame = br.imgmsg_to_cv2(data)

    cv2.imshow("camera", current_frame)

    cv2.waitKey(1)


def listener():
    rospy.init_node("video_sub_py", anonymous=True)
    rospy.Subscriber("video_frames", Image, callback)

    rospy.spin()

    cv2.destroyAllWindows()


if __name__ == "__main__":
    listener()


    


  • Revision 82028 : Correction de l’url de la librairie flot (Jean Marie Grall )

    11 juin 2018, par eric@… — Log

    Correction de l’url de la librairie flot (Jean Marie Grall )