Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (103)

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

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

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

  • Empty output when extracting frames with FFMPEG at specific timestamps taken from FFPROBE

    9 octobre 2023, par Andrew McDowell

    I am trying to extract frames from a video as close as possible to specific timestamps, but for some timestamps I'm getting no output.

    


    I'm first using ffprobe to get a list of all frames along with their time values :

    


    ffprobe -select_streams v -show_frames -show_entries frame=pts_time,pkt_pts_time,pict_type <input video="video" />

    &#xA;

    Which gives me an output like :

    &#xA;

    [FRAME]&#xA;pts_time=11.950000&#xA;pict_type=I&#xA;[/FRAME]&#xA;[FRAME]&#xA;pts_time=11.966667&#xA;pict_type=B&#xA;[/FRAME]&#xA;[FRAME]&#xA;pts_time=11.983333&#xA;pict_type=P&#xA;[/FRAME]&#xA;

    &#xA;

    I'm then parsing this and determining which frame is the closest to the time I want and using FFmpeg to extract frames which match the chosen times like so :

    &#xA;

    ffmpeg -i <input video="video" /> -filter:v "select=&#x27;eq(t, 11.950000)&#x2B;eq(t, 11.983333)&#x27;" -vsync drop -start_number 0 <output path="path">/frame-%08d.png</output>

    &#xA;

    This mostly works but I've noticed for some frames I get no output. From some testing it always seems to work for I frames and works occasionally for P or B frames but not always.

    &#xA;

    I can't see any pattern to which frames it works for or not and would love an insight into whether I'm doing something wrong in the extraction, or whether there's a way to determine which frames can be extracted or not.

    &#xA;

  • Python Av encode result is empty always

    19 septembre 2023, par Emir evcil

    I'm quite a newbie when it comes to ffmpeg and av, I was trying to do a simple encode - decode example but the encode result always returns an empty list. I don't understand the reason for this, I don't know how it can be solved.

    &#xA;

    import av&#xA;import numpy as np&#xA;import cv2 &#xA;&#xA;container = av.open(file = "video=PC Camera",format = "dshow",options = {"video_size":"640x480"},mode = "r")&#xA;&#xA;def getFrame():&#xA;    # open camera&#xA;    for frame in container.decode(video=0):&#xA;        yield frame&#xA;        &#xA;def encode(frame):&#xA;    encoder = av.CodecContext.create(&#x27;h264&#x27;, &#x27;w&#x27;)&#xA;    encoder.width = frame.width&#xA;    encoder.height = frame.height&#xA;    encoder.pix_fmt = frame.format.name&#xA;    encoder.bit_rate = 5000000&#xA;    encoder.framerate = 30&#xA;    encoder.open()&#xA;    frames = encoder.encode(frame)&#xA;    encoder.close()&#xA;    return frames&#xA;    &#xA;    &#xA;if __name__ == "__main__":&#xA;    while 1:&#xA;        frame = next(getFrame())&#xA;        frame_encoded = encode(frame)&#xA;        print(frame_encoded) // always empty&#xA;        if len(frame_encoded) == 0:&#xA;            continue&#xA;        #cv2.imshow("frame",frame.to_ndarray(format = "bgr24"))&#xA;        #cv2.waitKey(1)&#xA;

    &#xA;

  • Empty error object produced by ffprobe in Google Cloud Function

    20 septembre 2023, par willbattel

    Update : After more digging I found an open GitHub issue where others appear to be encountering the same behavior.

    &#xA;


    &#xA;

    I have a Google Cloud Function (2nd gen) in which I am trying to use ffprobe to get metadata from a video file stored in a Google Cloud Storage bucket. It is my understanding that I can generate a signed url and, by passing that directly to ffprobe, avoid loading the entire video file into memory. I generate a signed url and pass it to ffprobe, and then parse the output like so :

    &#xA;

    import ffmpeg from &#x27;fluent-ffmpeg&#x27;&#xA;import ffprobeStatic from &#x27;ffprobe-static&#x27;&#xA;&#xA;async function getVideoData(srcFile: File) {&#xA;    const [signedUrl] = await srcFile.getSignedUrl({&#xA;        action: &#x27;read&#x27;,&#xA;        expires: (new Date()).getMilliseconds() &#x2B; 60_000,&#xA;    })&#xA;&#xA;    const videoData: ffmpeg.FfprobeData = await new Promise((resolve, reject) => {&#xA;        ffmpeg.setFfprobePath(ffprobeStatic.path)&#xA;        ffmpeg.ffprobe(signedUrl, (err, data) => {&#xA;            if (err) {&#xA;                reject(err)&#xA;            }&#xA;            else {&#xA;                resolve(data)&#xA;            }&#xA;        })&#xA;    })&#xA;&#xA;    return videoData&#xA;}&#xA;

    &#xA;

    This code works (with the same signed URL) locally on my macOS machine, but does not when deployed in a 2nd generation Google Cloud Function. In the latter case, data is undefined and err is {}.

    &#xA;

    My main question is how to properly use ffprobe in 2nd gen Google Cloud Functions. I have tried to research this but documentation on ffmpeg/ffprobe on GCP is sparse. I'm also trying to figure out exactly why the error object err is empty...it's not very helpful 😅

    &#xA;

    Additional info :

    &#xA;

      &#xA;
    • Environment : Google Cloud Functions 2nd Gen
    • &#xA;

    • Runtime : Node 20
    • &#xA;

    • "ffprobe-static" : "3.1.0",
    • &#xA;

    • "fluent-ffmpeg" : "2.1.2"
    • &#xA;

    &#xA;

    Thanks in advance.

    &#xA;