Recherche avancée

Médias (0)

Mot : - Tags -/albums

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

Autres articles (24)

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (4135)

  • Evaluate function within ffmpeg drawtext

    22 juin 2022, par Dan Steingart

    I am looking to display a counter that is a multiple of the frame number on a video created with ffmpeg. Previous answers on SO taught me that a command of the form

    


    ffmpeg -y -r 25  -pattern_type glob -i '*.jpg' -vf "text='%{n}': start_number=0: x=0: y=0: fontcolor=black: fontsize=30: box=1: boxcolor=white: boxborderw=5" -c:a copy movie.mp4


    


    Will display the frame number, and this works nicely. But if I try to evaluate an expression within the %{}, e.g.

    


    ffmpeg -y -r 25  -pattern_type glob -i '*.jpg' -vf "text='%{n*50}': start_number=0: x=0: y=0: fontcolor=black: fontsize=30: box=1: boxcolor=white: boxborderw=5" -c:a copy movie.mp4


    


    Then I get the following error

    


    [Parsed_drawtext_0 @ 0x55683f9b00] %{n*50} is not known    


    


    on each frame. What is the proper syntax to evaluate n*50 and display in drawtext ? TIA.

    


  • FFMPEG Determine average color of an area of a video

    12 novembre 2019, par Naved Khan

    I have a use case where I’d want to insert one of two watermarks - one designed for a dark-ish background, the other for a light background into a video. Let’s say that I’d want to do this on the top right corner of the video.

    How do I determine the average color of the top right section of the video ? Post this, how do I determine which watermark to use by looking at the average color ?

    I have a solution right now where I am taking equally spaced screenshots and then measuring the average color, but it’s excruciatingly slow, especially for longer videos.

    # Calculate average color
       black_distances = []
       white_distances = []

       movie = FFMPEG::Movie.new(video_file)
       (0..movie.duration / 10).each do |second|

         # extract a frame
         filename = "tmp/watermark/#{SecureRandom.uuid}.jpg"
         movie.screenshot filename.to_s, seek_time: second

         # analyse frame for color distance
         frame = MiniMagick::Image.open(filename)
         frame.crop('20%x20%+80%+0')
         frame.resize('1x1')
         pixel = frame.get_pixels.flatten

         distance_from_black = Math.sqrt(((black[0] - pixel[0])**2 + (black[1] - pixel[1])**2 + (black[2] - pixel[2])**2))
         distance_from_white = Math.sqrt(((white[0] - pixel[0])**2 + (white[1] - pixel[1])**2 + (white[2] - pixel[2])**2))

         black_distances.push distance_from_black
         white_distances.push distance_from_white

         File.delete(filename) if File.exist?(filename)
       end

       average_black_distance = black_distances.reduce(:+).to_f / black_distances.size
       average_white_distance = white_distances.reduce(:+).to_f / white_distances.size

    I am also confused about how to use the resulting average_black_distance and average_white_distance to determine which watermark to use.

  • How to find higest bitrate in mp4 file and extract jpg ?

    10 octobre 2018, par Igor Petev

    I im using ffmpeg and have mp4 file that is in size around 50MB and duration 2m7sec.I need to write batch script for windows that will read whole mp4 file find position in seconds where higest bitrate is there and extract jpg image from that position.

    For example, i have mp4 trailer file that i would like to extract cover, using above script where i define time to extract jpg i get on some mp4 trailers black screen...so using above idea to find higet bitrate for shure will not be black screen, will be picture of some scene.

    Here is windows batch code that extract jpg dfrom mp4 using user defined time :

    @ECHO OFF
    SET oldName=
    SET newName=

    FOR %%A IN (*.mp4) DO (
    SET oldName=%%A
    SET newName=%%A
    CALL :MAKEJPG
    )

    :MAKEJPG
    SET newName=%newName:mp4=jpg%
    IF NOT EXIST %newName% (
    START /B /WAIT D:\www\ffmpeg.exe -i "%oldName%" -ss 00:00:17.30 -vcodec mjpeg -vframes 1 -f image2 "%newName%"
    EXIT
    )