Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (52)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • 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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (6560)

  • Evolution #2131 : Permettre de modifier la règle de modération des forum pour tout le site et tous...

    24 mars 2012, par cedric -

    voir #2612

  • Anomalie #2201 (Fermé) : balise li dans un message de forum

    19 août 2011, par cedric -

    corrigé a minima par http://zone.spip.org/trac/spip-zone/changeset/50553 mais il faudra y revenir

  • Python, grab frame number from FFMPEG

    22 janvier 2021, par Pyrometheous

    I'm using a script to compile an image sequence into a video.

    


    def ffmpeg_image_sequence(image_sequence, video, fps, encoder):
        global task
        task = False
        path = os.path.dirname(os.path.realpath(image_sequence))
        image_format = {
            'png': '\%06d.png',
            'iff': '\%06d.tiff',
            'tif': '\%06d.tif',
            'jpg': '\%06d.jpg'
        }
        sequence = path + image_format[image_sequence[-3:]]
        output_options = {
            'crf': 20,
            'preset': 'slow',
            'movflags': 'faststart',
            'pix_fmt': 'yuv420p',
            'c:v': encoder,
            'b:v': '20M'
        }
        try:
            (
                ffmpeg
                    .input(sequence, framerate=fps)
                    .output(video, **output_options)
            ).run()
        except ffmpeg.Error as e:
            warning(str(e))
        task = True


    


    I'm using wxPython for the GUI and ffmpeg for compiling the frames :

    


    import wx
import ffmpeg


    


    I'm running the above function in its own class so that it can be run in a different thread, allowing the statusbar to be updated with how much time has passed.

    


    def wait(start, text):
    time.sleep(.05)
    time_running = round(time.time() - start)
    update_status_bar(main_window, text + ' (Time Elapsed: ' + seconds_to_str(time_running) + ')')


    


    I'd like to replace this with ETA and percentage completed. The window that pops up when running the ffmpeg_image_sequence function displays the following information :

    


    frame=1234 fps= 16 q=13.0 size= 56789kB time=00:38:48.36 bitrate=12345.6kbits/sec speed=0.681x


    


    From what's printed to that window, I'd like to get the current frame= value to determine what percentage of the process is completed, then display something more like :

    


    def wait(text, frame, number_of_frames):
    time.sleep(.05)
    current_frame = frame
    number_of_frames = number_of_files_in_dir - 1
    percentage = round(current_frame / number_of_frames, 1)
    update_status_bar(main_window, text + ' ' + percentage + '% ' + Completed)


    


    With some math to calculate an ETA for completion as well.

    


    So, is there a way to grab that output text from the ffmpeg and turn just that frame= number into a variable ?