Recherche avancée

Médias (91)

Autres articles (98)

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

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

  • 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

Sur d’autres sites (10367)

  • 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))
  • ffmpeg minterpolate and rubberband - how to stretch audio to fit ?

    5 juin 2023, par bossturbo

    What is the best way to control the length of the audio and pitch shift using rubberband ?

    


    I tried setting 'asetpts=PTS*16' to match the video PTS, but it appears to be ignored. The only thing that seems to determine the length of the audio is rubberband pitch. Even 'tempo=0.0625' does not appear to do anything.

    


    I would like to be able to set the audio length to match the slower video section and set the pitch to whatever I want, like minimum 0.15 and have it stretch the audio length as needed.

    


    ffmpeg -ss 123.978571 -i "original-120fps.MP4" -filter_complex "
[0:v]trim=0:0.375,setpts=PTS-STARTPTS,minterpolate='fps=480',setpts=PTS*16[slowv]; 
[0:a]atrim=0:0.375,asetpts=PTS-STARTPTS,rubberband=pitch=0.08:tempo=0.0625[slowa];"
 -y -r 60 -map [slowv] -map [slowa] -preset veryfast "output.mp4"


    


    Finally, is there a good guide to using lib-rubberband ? FFmpeg docs for rubberband doesn't explain anything.

    


  • Extract individual macroblock types and their corresponding motion vectors [closed]

    14 mai 2023, par Prajit Kumar

    I need to make a pair for each macroblock from a frame of a video containing its type and motion vector.

    


    I extracted motion vectors by using the python module of mv-extractor.

    


    For macroblock type I used ffmpeg command : ffmpeg -threads 1 -debug 'mb_type' -i file.h264 -f null -

    


    The info received from ffmpeg command doesn't match with the location of motion vectors extracted (Macroblocks which are divided into smaller blocks of size 8X16 or 16X8 do not match with the info of macroblock size received in motion vector info). Also, the ffmpeg command for extracting macroblock type doesn't work properly on some videos.

    


    Can you please tell a more streamlined way of doing this task.