Recherche avancée

Médias (91)

Autres articles (62)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (6311)

  • FFMPEG command runs forever even on using timelimit

    21 décembre 2017, par t6nand

    Mostly I use a java code to run FFMPEG bash commands for watermarking a logo on video. I am using the following FFmpeg command to overlay an image on video. I have observed that at times for some random videos, the process keeps on running even after the timelimit assigned to it expires. At times it’s more than a day or couple of days until not directly killed using kill -9 pid :

    ffmpeg -timelimit 900 -y -i
    input_video
    -i logoImage -filter_complex "[0:v]scale=trunc(iw/2)*2:trunc(ih/2)*2[even] ;[1:v][even]scale2ref=iw*0.25 :(iw*0.25)*(0.46446702)[2nd][ref] ;[ref][2nd]overlay=(main_w-overlay_w) :(main_h-overlay_h)"
    -c:v libx264 -b:v 300K -crf 28 -preset slow outputVideo

    But this command never completes even on using -timelimit flag at times for some videos.

    I have observed that for such processes output from ps aux|grep ffmpeg yeilds in something like :

    ubuntu 16620 0.6 6.7 1595044 515392 ? Sl Dec20 12:05
    ffmpeg -timelimit 900 -y -i
    input_video
    -i logoImage -filter_complex "[0:v]scale=trunc(iw/2)*2:trunc(ih/2)*2[even] ;[1:v][even]scale2ref=iw*0.25 :(iw*0.25)*(0.46446702)[2nd][ref] ;[ref][2nd]overlay=(main_w-overlay_w) :(main_h-overlay_h)"
    -c:v libx264 -b:v 300K -crf 28 -preset slow outputVideo

    It indicates that this process is in interruptible sleep state i.e. waiting for an event to complete. On using sudo strace -p 16620 to trace which system call is this process hung up on it results in something like :

    Process 16620 attached write(2, "frame= 4121 fps= 10 q=33.0 size="...,
    99

    i.e. it’s stuck writing to a file.

    What could be the reason for this problem ?
    And is there any other way to kill FFMPEG process which overshoots desired time limit ?

  • How do I connect two GIFs to play one after another in Python ?

    9 novembre 2022, par Andrew

    If I have two GIFs, GIF 1 being 10 seconds long and GIF 2 being 5 seconds long, is there a way to connect them so the final GIF is a total of 15 seconds long ?

    


    Would I have to loop through each frame of both the GIFs with imageio.mimread() and output, once all the frames are read in memory ?

    


    Or is there another way by knowing the start and end times and shifting it ?

    


    Edit :
The solution presented by FirefoxMetzger is extremely Pythonic, ideal if you do not wish to install other software / packages like gifsicle.

    


    import imageio.v3 as iio
import numpy as np

frames = np.vstack([
    iio.imread("imageio1.gif"),
    iio.imread("imageio2.gif"),
])

# get duration each frame is displayed
iio.imwrite("imageio_combined.gif", frames)


    


    This completes in 15.6 seconds for two GIFs, each containing 100 frames.

    


    However, if runtime is important, I recommend gifsicle :

    


    gifsicle(
    sources=["imageio1.gif", "imageio2.gif"], # or just omit it and will use the first source provided.
    destination="imageio3.gif",
    options=["--optimize=2", "--threads=2", "--no-conserve-memory"]
)


    


    This completes in 4.8 seconds, which is three times as fast.

    


  • Run ffmpeg once but get multiple screenshots

    9 novembre 2017, par user779159

    I get a screenshot from a remote video file using ffmpeg with a command like ffmpeg -ss $TIME -i $URL -frames:v 1 -filter:v $FILTER file.jpg (-ss comes before -i for fast seeking https://trac.ffmpeg.org/wiki/Seeking). $FILTER is how I want to transform the screenshot, like cropping/resizing. In this case it’s "crop=iw-5:ih-5, scale=100:100:force_original_aspect_ratio=increase, crop=100:100")

    If I want to get 3 screenshots, at 3 seconds, 5 seconds, and 14 seconds, I need to run this command 3 separate times, passing 3, 5, and 14 as $TIME. But is it possible to run the command once but have it output multiple screenshot files for the different times ?

    And would ffmpeg do that in a way where it would make the round-trip remote request just 1 time instead of 3 ? In that case it would be more efficient. If not, then maybe it’s better to make the 3 requests separately since I could do it in parallel.