Recherche avancée

Médias (0)

Mot : - Tags -/interaction

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (53)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (9932)

  • Getting realtime output of ffmpeg with pexpect

    27 février 2014, par Shuman

    hi i'm trying to get the progress info when calling ffmpeg command line tool, with pexpect, i can get the progress with regex, but the problem is after a few seconds, maybe 20 or 10sec, pexpect stops getting new print outs from ffmpeg, it's still running, i saw the output file size growing. am i doing something wrong ?

    cmd = 'ffmpeg -i rtmp://xxxx -c copy -absf aac_adtstoasc /usr/tmp/tmp/out.mp4'

    import os
    import re
    import time
    import subprocess


    import pexpect

    thread = pexpect.spawn(cmd)

    print 'started'

    reo = re.compile("""\S+\s+(?P\d+)  # frame
                        \s\S+\s+(?P<fps>\d+)           # fps
                        \sq=(?P<q>\S+)                    # q
                        \s\S+\s+(?P<size>\S+)          # size
                        \stime=(?P<time>\S+)           # time
                        \sbitrate=(?P<bitrate>[\d\.]+) # bitrate
                        """, re.X)

    durationReo = (&#39;(?&lt;=Duration:\s)\S+(?=,)&#39;)

    cpl = thread.compile_pattern_list([
       pexpect.EOF,
       reo,
       durationReo
    ])


    while True:
       i = thread.expect_list(cpl, timeout=None)
       if i == 0: # EOF
           print "the sub process exited"
           break
       elif i == 1:
           frame_number = thread.match.group(0)
           print frame_number
       elif i == 2:
           durationLine = thread.match.group(0).strip()
           print &#39;Duration:&#39;, durationLine
    </bitrate></time></size></q></fps>

    the output is

    started                                                                                  
    Duration: 03:55:42.00                                                                    
    frame=   74 fps= 55 q=-1.0 size=     984kB time=00:00:06.17 bitrate=1304.5                
    frame=   89 fps= 43 q=-1.0 size=    1197kB time=00:00:07.43 bitrate=1319.8                
    frame=  113 fps= 41 q=-1.0 size=    1407kB time=00:00:09.33 bitrate=1234.8
    frame=  125 fps= 32 q=-1.0 size=    1613kB time=00:00:10.35 bitrate=1275.6
    frame=  132 fps= 29 q=-1.0 size=    1705kB time=00:00:10.95 bitrate=1274.7
    frame=  135 fps= 26 q=-1.0 size=    1825kB time=00:00:11.23 bitrate=1330.6
    frame=  140 fps= 24 q=-1.0 size=    2022kB time=00:00:11.60 bitrate=1426.5
    frame=  140 fps= 21 q=-1.0 size=    2097kB time=00:00:11.70 bitrate=1467.7
    frame=  142 fps= 19 q=-1.0 size=    2224kB time=00:00:11.79 bitrate=1544.4
    frame=  143 fps= 17 q=-1.0 size=    2447kB time=00:00:11.98 bitrate=1672.8
    frame=  145 fps= 16 q=-1.0 size=    2687kB time=00:00:12.07 bitrate=1822.8
    frame=  155 fps= 15 q=-1.0 size=    2780kB time=00:00:12.95 bitrate=1757.6
    frame=  163 fps= 15 q=-1.0 size=    2940kB time=00:00:13.65 bitrate=1764.2
    frame=  167 fps= 14 q=-1.0 size=    3062kB time=00:00:13.83 bitrate=1812.3
    frame=  168 fps= 13 q=-1.0 size=    3149kB time=00:00:14.02 bitrate=1839.4
    frame=  190 fps= 14 q=-1.0 size=    3322kB time=00:00:15.78 bitrate=1723.6
    frame=  213 fps= 15 q=-1.0 size=    3481kB time=00:00:17.78 bitrate=1603.4
    frame=  235 fps= 16 q=-1.0 size=    3671kB time=00:00:19.59 bitrate=1534.3
    frame=  244 fps= 16 q=-1.0 size=    3790kB time=00:00:20.29 bitrate=1530.0
    frame=  256 fps= 16 q=-1.0 size=    3909kB time=00:00:21.31 bitrate=1502.1
    frame=  276 fps= 16 q=-1.0 size=    4029kB time=00:00:22.94 bitrate=1438.8
    frame=  299 fps= 17 q=-1.0 size=    4177kB time=00:00:24.93 bitrate=1372.1
    frame=  339 fps= 19 q=-1.0 size=    4388kB time=00:00:28.28 bitrate=1270.9
    frame=  363 fps= 19 q=-1.0 size=    4557kB time=00:00:30.18 bitrate=1236.8
    frame=  405 fps= 20 q=-1.0 size=    4587kB time=00:00:33.76 bitrate=1113.1
    frame=  421 fps= 20 q=-1.0 size=    4598kB time=00:00:35.15 bitrate=1071.4

    it stops here but the code is still running. the file size is still growing and the code didn't exit, so it's not because of the timeout bug in pexpect.

    and also , if user press ctrl+c to terminate the main program, ffmpeg still runs in the bg, how do i also tell it to exit ?

    edit : i found that the culprit might be ffmpeg is not printing out all the info after 10 lines or so. it only update the display where it needs to be changed.so the regex is not matching, so what to do now , make 6 seperate regex ?

    edit2 : it seems if i use this regex, it works...

    reo = re.compile("""frame=\s*(?P\d+)  # frame
                        \sfps=\s*(?P<fps>\d+)           # fps
                        \sq=\s*(?P<q>\S+)                    # q
                        \ssize=\s*(?P<size>\S+)          # size
                        \stime=\s*(?P<time>\S+)           # time
                        \sbitrate=\s*(?P<bitrate>[\d\.]+) # bitrate
                        """, re.X)
    </bitrate></time></size></q></fps>

    it's saying only match when frame number is updated, ( maybe this implies all the other text are also updated ? )

  • avcodec/vqavideo : reset accounting on error

    19 décembre 2021, par Michael Niedermayer
    avcodec/vqavideo : reset accounting on error
    

    Fixes : Timeout (same growing chunk is decoded to failure repeatedly)
    Fixes : 42582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6531195591065600

    Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/vqavideo.c
  • Converting mkv to h264 FFmpeg

    14 janvier 2021, par Rikus Honey

    EDIT :&#xA;This question has become very popular and is one of the top results for searching "convert mkv to h264 ffmpeg" and thus I feel it is appropriate to add that for anyone stumbling upon this question to rather use

    &#xA;

    ffmpeg -i input.mkv -c:v libx264 -c:a aac output.mp4&#xA;

    &#xA;

    as libvo_aacenc has been removed in recent versions of FFmpeg and it now has a native aac encoder. For more information visit the FFmpeg wiki page for encoding AAC.

    &#xA;

    Here is the original question :

    &#xA;

    I would like to convert my .mkv files to .mp4 using FFmpeg. I have tried the following code :

    &#xA;

    ffmpeg -i input.mkv -c:v libx264 -c:a libvo_aacenc output.mp4&#xA;

    &#xA;

    But I get the error :

    &#xA;

    &#xA;

    Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height.

    &#xA;

    &#xA;

    Is there any way to get around this ? I have tried setting the bitrate of the audio but the problem seems to persist.

    &#xA;