Recherche avancée

Médias (91)

Autres articles (52)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

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

Sur d’autres sites (7207)

  • Remove frames based off an image with FFmpeg

    15 novembre 2020, par VEXED

    The Goal : Take a frame or a reference image and use that to decide what frames to keep/remove from an old screen recording (no audio).

    


    To be slightly more specific, I want to match a specific program that is being used in the screen recording. The program is always full screen and could potentially be identified just by a crop of the top left corner.

    


    The Question : What would be the best way to take an image, in particular a cropped corner of say 100px width and height, and look for the same matching corner in a video ? I would want to output those matches to a new file, that or remove the non-matching frames and create a new file with all the frames that match.

    


    What I Know : I know that duplicate frame removal is very possible, and I already use that for screen recordings.

    


    -filter:v mpdecimate, setpts=N/FRAME_RATE/TB \


    


    The above is being used in my screen recording script to remove duplicate frames.

    


    I'm also aware that you can crop using FFmpeg, but I'm not looking to have actual cropped output. I'm only looking to use a crop to find the portion that matches my reference image or reference frame.

    


    ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4


    


    The above is a basic crop.

    


    The only reference to finding frames by images is this one. It didn't do what I wanted and just produced dark and distorted output. Though I might be understanding what the aim of that post was incorrectly.

    


    Notes : Thanks in advance for any help, this frame/image matching doesn't have to be done while recording, but can be done in post.

    


  • Why is ffmpeg choking on this particular PNG file ?

    13 novembre 2022, par kohloth

    I'm trying to make a video out of 4 still images with ffmpeg.

    


    This is the command I am having trouble with getting working at the moment :

    


    ffmpeg -y -loop 1 -framerate 24 -t 3 \
-i ./images/title-card.png -loop 1 -framerate 24 -t 4 \
-i ./images/001.png -loop 1 -framerate 24 -t 4 \
-i ./images/002.png -loop 1 -framerate 24 -t 3 \
-i ./images/003.png -loop 1 -framerate 24 -t 4 \
-filter_complex "[0][1][2][3]concat=n=4:v=1:a=0" \
/tmp/silentVideoTest.mp4


    


    Unfortunately, I get this error :

    


    [Parsed_concat_0 @ 0x5603df1c4080] Input link in1:v0 parameters (size 1024x1024, SAR 0:1) do not match the corresponding output link in0:v0 parameters (1024x1024, SAR 3937:3937)
[Parsed_concat_0 @ 0x5603df1c4080] Failed to configure output pad on Parsed_concat_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #3:0


    


    I have no idea what this error means. But if I use a different png for the first image, it works fine. I understand that there is something about the first png that ffmpeg does not like ; the SAR, which I believe is some kind of png metadata bit or something ?

    


    Problem is :

    


      

    • The error is confusing to me
    • 


    • I see no option to set the SAR when exporting images from Krita, Pinta, or Photopea.
    • 


    • I do not know how to view the SAR value of an image, so I can't verify that this is really the problem
    • 


    


    Also, whats more is, I've used this command in the past to change an image's SAR (I think) but it seems to only work half the time ?

    


    ffmpeg -i title-card.png -vf setsar=1 title-card-new-sar.png


    


    No idea what the value of setsar should be, so I am using 1.

    


    Would love if someone could tell me how to get it to work. In particular, how do I view the SAR of a PNG file ?

    


    Maybe I am naieve, but shouldn't ffmpeg just be able to accept png images that are the same dimensions, compression, and stitch em together without errors ? i.e. Is there an option just to say "Fix the SAR ?" or "Use the SAR of the first image for all images ?"

    



    


    Edit : Trying it on some different images, having set the SAR with ffmpeg -i ./card.png -vf setsar=1 ./card-new-sar.png, I get a similar error :

    


    [Parsed_concat_0 @ 0x55e7b6b8b640] Input link in2:v0 parameters (size 1024x1024, SAR 2834:2834) do not match the corresponding output link in0:v0 parameters (1024x1024, SAR 1:1)
[Parsed_concat_0 @ 0x55e7b6b8b640] Failed to configure output pad on Parsed_concat_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #26:0


    


    ffmpeg still seems to complain that the SARs don't match...but surely, as its a ratio, a SAR of 2834:2834 does match a SAR of 1:1 ?

    



    


    Edit : Tried setting the SAR with ffmpeg -i ./card.png -vf setsar=2834:2834 ./card-new-sar.png, but now the error is (size 1024x1024, SAR 0:1) do not match the corresponding output link in0:v0 parameters (1024x1024, SAR 2834:2834).

    


  • Python subprocess : capture output of ffmpeg and run regular expression against it

    31 décembre 2014, par Jesse Adam

    I have the following code

    import subprocess
    import re
    from itertools import *

    command = ['ffprobe', '-i', '/media/some_file.mp4']
    p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    text = p.stderr.read()
    retcode = p.wait()
    text = text.decode('utf-8')
    p = re.compile("Duration(.*)")

    num = 0 #for debugging
    for line in iter(text.splitlines()):
       print(str(num) + line) #for debugging
       m = p.match(str(line))
       if m != None:
           print(m.group(1))

    When I look at the output there is a line that says "Duration" on it, however it is not captured, print(m.group(1)) is never reached. If I change the text variable to a hardcoded string of "Duration blahblah" I get " blahblah", which is what I expect. It seems like the regex doesn’t recognize the text coming back from stderr. How can I get the text into a format that the regex will recognize and match on ?


    I have come up with the following solution, should it help anyone else attempting to capture duration from ffmpeg using python

    import subprocess
    import re

    command = ['ffprobe', '-i', '/media/some_file.mp4']
    p = subprocess.Popen(command, stderr=subprocess.PIPE)
    text = p.stderr.read()
    retcode = p.wait()
    text = text.decode('utf-8')
    p = re.compile(".*Duration:\s([0-9:\.]*),", re.MULTILINE|re.DOTALL)
    m = p.match(text)
    print(m.group(1))