Recherche avancée

Médias (91)

Autres articles (104)

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

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

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

  • merge 4 videos and put audio in different tracks/channels

    4 septembre 2013, par Gijserman

    I'm pretty new to ffmpeg, so I'm having a bit of a struggle.

    I have found a way to merge 4 videos into one side-by-side video grid (2x2) with following code :

    ffmpeg -y -i vid1.mp4 -i vid2.mp4 -i vid3.mp4 -i vid4.mp4 -filter_complex "[0:0]pad=iw*2:ih*2[a];[1:0]null[b];[2:0]null[c];[3:0]null[d];[a][b]overlay=w[x];[x][c]overlay=0:h[y];[y][d]overlay=w:h" multiple_input_grid.mp4

    What I would like to do is distribute the audio of each video as follows

    • Audio from vid1 to audiotrack 1 -> left channel
    • Audio from vid2 to audiotrack 1 -> right channel
    • Audio from vid3 to audiotrack 2 -> left channel
    • Audio from vid4 to audiotrack 2 -> right channel

    So multiple_input_grid.mp4 will have 2 audio tracks with different left/right audio

    Is there a way of doing this in ffmpeg ?

    Thanks

    The command I'm using (this should have 4 different sources, but has 4x the same) :

    C:\Users\Gijs\Documents\ffmpeg-20130820-git-68b63a3-win64-static\bin>ffmpeg -y -
    i VIDEO0050.mp4 -i VIDEO0050.mp4 -i VIDEO0050.mp4 -i VIDEO0050.mp4 -filter_compl
    ex "[0:0]pad=iw*2:ih*2[a];[1:0]null[b];[2:0]null[c];[3:0]null[d];[a][b]overlay=w
    [x];[x][c]overlay=0:h[y];[y][d]overlay=w:h" multiple_input_grid.mp4

    Output :

    ffmpeg version N-55644-g68b63a3 Copyright (c) 2000-2013 the FFmpeg developers
     built on Aug 19 2013 20:32:00 with gcc 4.7.3 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
    ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
    amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
    enable-libxvid --enable-zlib
     libavutil      52. 42.100 / 52. 42.100
     libavcodec     55. 28.100 / 55. 28.100
     libavformat    55. 13.103 / 55. 13.103
     libavdevice    55.  3.100 / 55.  3.100
     libavfilter     3. 82.100 /  3. 82.100
     libswscale      2.  5.100 /  2.  5.100
     libswresample   0. 17.103 /  0. 17.103
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VIDEO0050.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 0
       compatible_brands: isom3gp4
       creation_time   : 2013-08-13 13:32:27
     Duration: 00:00:28.35, start: 0.000000, bitrate: 5298 kb/s
       Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
    v420p, 720x1280, 5001 kb/s, SAR 65536:65536 DAR 9:16, 29.40 fps, 30.17 tbr, 90k
    tbn, 180k tbc
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : VideoHandle
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 95 k
    b/s
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : SoundHandle
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'VIDEO0050.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 0
       compatible_brands: isom3gp4
       creation_time   : 2013-08-13 13:32:27
     Duration: 00:00:28.35, start: 0.000000, bitrate: 5298 kb/s
       Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
    v420p, 720x1280, 5001 kb/s, SAR 65536:65536 DAR 9:16, 29.40 fps, 30.17 tbr, 90k
    tbn, 180k tbc
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : VideoHandle
       Stream #1:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 95 k
    b/s
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : SoundHandle
    Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'VIDEO0050.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 0
       compatible_brands: isom3gp4
       creation_time   : 2013-08-13 13:32:27
     Duration: 00:00:28.35, start: 0.000000, bitrate: 5298 kb/s
       Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
    v420p, 720x1280, 5001 kb/s, SAR 65536:65536 DAR 9:16, 29.40 fps, 30.17 tbr, 90k
    tbn, 180k tbc
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : VideoHandle
       Stream #2:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 95 k
    b/s
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : SoundHandle
    Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'VIDEO0050.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 0
       compatible_brands: isom3gp4
       creation_time   : 2013-08-13 13:32:27
     Duration: 00:00:28.35, start: 0.000000, bitrate: 5298 kb/s
       Stream #3:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
    v420p, 720x1280, 5001 kb/s, SAR 65536:65536 DAR 9:16, 29.40 fps, 30.17 tbr, 90k
    tbn, 180k tbc
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : VideoHandle
       Stream #3:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 95 k
    b/s
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : SoundHandle
    [libx264 @ 0000000002788fc0] using SAR=1/1
    [libx264 @ 0000000002788fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    AVX
    [libx264 @ 0000000002788fc0] profile High, level 5.0
    [libx264 @ 0000000002788fc0] 264 - core 135 r2345 f0c1c53 - H.264/MPEG-4 AVC cod
    ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 r
    ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
    _ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
    p=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 deci
    mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
    adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
    5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
    0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'multiple_input_grid.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 0
       compatible_brands: isom3gp4
       encoder         : Lavf55.13.103
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1440x2
    560 [SAR 1:1 DAR 9:16], q=-1--1, 11584 tbn, 30.17 tbc
       Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
    Hz, mono, s16, 128 kb/s
       Metadata:
         creation_time   : 2013-08-13 13:32:27
         handler_name    : SoundHandle
    Stream mapping:
     Stream #0:0 (h264) -> pad (graph 0)
     Stream #1:0 (h264) -> null (graph 0)
     Stream #2:0 (h264) -> null (graph 0)
     Stream #3:0 (h264) -> null (graph 0)
     overlay (graph 0) -> Stream #0:0 (libx264)
     Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
    Press [q] to stop, [?] for help
    frame=   19 fps=0.0 q=0.0 size=       0kB time=00:00:00.94 bitrate=   0.4kbits/s
    frame=   42 fps= 41 q=0.0 size=       0kB time=00:00:01.64 bitrate=   0.2kbits/s
    frame=   46 fps= 23 q=0.0 size=       0kB time=00:00:01.76 bitrate=   0.2kbits/s
    frame=   54 fps= 21 q=29.0 size=     179kB time=00:00:01.99 bitrate= 735.9kbits/
    frame=   58 fps= 19 q=29.0 size=     338kB time=00:00:02.22 bitrate=1245.2kbits/
    frame=   65 fps= 17 q=29.0 size=     546kB time=00:00:02.34 bitrate=1908.9kbits/
    frame=   73 fps= 16 q=29.0 size=     778kB time=00:00:02.57 bitrate=2476.6kbits/
    frame=   80 fps= 16 q=29.0 size=     927kB time=00:00:02.92 bitrate=2599.0kbits/
    frame=   85 fps= 15 q=29.0 size=    1089kB time=00:00:02.92 bitrate=3053.5kbits/
    frame=   91 fps= 14 q=29.0 size=    1268kB time=00:00:03.15 bitrate=3293.1kbits/
    frame=   99 fps= 14 q=29.0 size=    1481kB time=00:00:03.50 bitrate=3462.3kbits/
    frame=  107 fps= 14 q=29.0 size=    1666kB time=00:00:03.73 bitrate=3653.1kbits/
    frame=  115 fps= 14 q=29.0 size=    1898kB time=00:00:03.96 bitrate=3919.8kbits/
    frame=  123 fps= 13 q=29.0 size=    2121kB time=00:00:04.19 bitrate=4137.0kbits/
    frame=  130 fps= 13 q=29.0 size=    2267kB time=00:00:04.43 bitrate=4190.3kbits/
    frame=  135 fps= 13 q=29.0 size=    2428kB time=00:00:04.66 bitrate=4265.3kbits/
    frame=  143 fps= 13 q=29.0 size=    2625kB time=00:00:04.89 bitrate=4392.4kbits/
    frame=  149 fps= 13 q=29.0 size=    2783kB time=00:00:05.01 bitrate=4548.5kbits/
    frame=  155 fps= 13 q=29.0 size=    2984kB time=00:00:05.36 bitrate=4560.0kbits/
    frame=  163 fps= 13 q=29.0 size=    3195kB time=00:00:05.59 bitrate=4680.1kbits/
    frame=  171 fps= 13 q=29.0 size=    3396kB time=00:00:05.82 bitrate=4776.1kbits/
    frame=  179 fps= 13 q=29.0 size=    3573kB time=00:00:06.05 bitrate=4832.0kbits/
    frame=  186 fps= 13 q=29.0 size=    3785kB time=00:00:06.28 bitrate=4929.5kbits/
    frame=  192 fps= 13 q=29.0 size=    3949kB time=00:00:06.52 bitrate=4960.0kbits/
    frame=  200 fps= 13 q=29.0 size=    4150kB time=00:00:06.75 bitrate=5033.0kbits/
    frame=  206 fps= 13 q=29.0 size=    4306kB time=00:00:06.87 bitrate=5134.7kbits/
    frame=  212 fps= 12 q=29.0 size=    4513kB time=00:00:07.21 bitrate=5121.3kbits/
    frame=  220 fps= 12 q=29.0 size=    4707kB time=00:00:07.45 bitrate=5175.1kbits/
    frame=  228 fps= 12 q=29.0 size=    4918kB time=00:00:07.68 bitrate=5244.0kbits/
    frame=  235 fps= 12 q=29.0 size=    5068kB time=00:00:07.91 bitrate=5245.4kbits/
    frame=  241 fps= 12 q=29.0 size=    5249kB time=00:00:08.14 bitrate=5277.5kbits/
    frame=  248 fps= 12 q=29.0 size=    5444kB time=00:00:08.37 bitrate=5321.9kbits/
    frame=  256 fps= 12 q=29.0 size=    5666kB time=00:00:08.61 bitrate=5390.4kbits/
    frame=  264 fps= 12 q=29.0 size=    5869kB time=00:00:08.84 bitrate=5436.2kbits/
    frame=  268 fps= 12 q=29.0 size=    5976kB time=00:00:09.07 bitrate=5393.6kbits/
    frame=  276 fps= 12 q=29.0 size=    6201kB time=00:00:09.30 bitrate=5457.8kbits/
    frame=  284 fps= 12 q=29.0 size=    6416kB time=00:00:09.54 bitrate=5509.1kbits/
    frame=  292 fps= 12 q=29.0 size=    6622kB time=00:00:09.77 bitrate=5551.1kbits/
    frame=  297 fps= 12 q=29.0 size=    6744kB time=00:00:10.00 bitrate=5521.7kbits/
    frame=  306 fps= 12 q=29.0 size=    7125kB time=00:00:10.23 bitrate=5701.5kbits/
    frame=  314 fps= 12 q=29.0 size=    7364kB time=00:00:10.46 bitrate=5762.2kbits/
    frame=  321 fps= 12 q=29.0 size=    7540kB time=00:00:10.70 bitrate=5771.5kbits/
    frame=  327 fps= 12 q=29.0 size=    7732kB time=00:00:11.04 bitrate=5732.3kbits/
    frame=  331 fps= 12 q=29.0 size=    7834kB time=00:00:11.16 bitrate=5747.2kbits/
    frame=  337 fps= 12 q=29.0 size=    8025kB time=00:00:11.28 bitrate=5827.0kbits/
    frame=  342 fps= 12 q=29.0 size=    8191kB time=00:00:11.39 bitrate=5887.2kbits/
    frame=  349 fps= 12 q=29.0 size=    8395kB time=00:00:11.63 bitrate=5912.9kbits/
    frame=  357 fps= 12 q=29.0 size=    8648kB time=00:00:11.97 bitrate=5914.6kbits/
    frame=  365 fps= 12 q=29.0 size=    8908kB time=00:00:12.21 bitrate=5976.1kbits/
    frame=  372 fps= 12 q=29.0 size=    9100kB time=00:00:12.44 bitrate=5991.4kbits/
    frame=  377 fps= 12 q=29.0 size=    9281kB time=00:00:12.55 bitrate=6054.1kbits/
    frame=  382 fps= 12 q=29.0 size=    9435kB time=00:00:12.79 bitrate=6042.7kbits/
    frame=  389 fps= 12 q=29.0 size=    9633kB time=00:00:13.02 bitrate=6059.2kbits/
    frame=  397 fps= 12 q=29.0 size=    9864kB time=00:00:13.25 bitrate=6096.3kbits/
    frame=  405 fps= 12 q=29.0 size=   10104kB time=00:00:13.48 bitrate=6137.0kbits/
    frame=  412 fps= 12 q=29.0 size=   10289kB time=00:00:13.83 bitrate=6091.8kbits/
    frame=  417 fps= 12 q=29.0 size=   10465kB time=00:00:13.95 bitrate=6144.6kbits/
    frame=  424 fps= 12 q=29.0 size=   10691kB time=00:00:14.18 bitrate=6174.5kbits/
    frame=  429 fps= 12 q=29.0 size=   10895kB time=00:00:14.30 bitrate=6241.0kbits/
    frame=  434 fps= 12 q=29.0 size=   11068kB time=00:00:14.41 bitrate=6289.4kbits/
    frame=  441 fps= 12 q=29.0 size=   11281kB time=00:00:14.76 bitrate=6258.8kbits/
    frame=  448 fps= 12 q=29.0 size=   11507kB time=00:00:14.99 bitrate=6285.4kbits/
    frame=  453 fps= 12 q=29.0 size=   11713kB time=00:00:15.11 bitrate=6348.8kbits/
    frame=  460 fps= 12 q=29.0 size=   11936kB time=00:00:15.34 bitrate=6372.2kbits/
    frame=  464 fps= 12 q=29.0 size=   12124kB time=00:00:15.57 bitrate=6375.6kbits/
    frame=  471 fps= 12 q=29.0 size=   12394kB time=00:00:15.80 bitrate=6422.1kbits/
    frame=  474 fps= 12 q=29.0 size=   12519kB time=00:00:15.80 bitrate=6486.8kbits/
    frame=  481 fps= 12 q=29.0 size=   12790kB time=00:00:16.04 bitrate=6531.2kbits/
    frame=  488 fps= 12 q=29.0 size=   13020kB time=00:00:16.27 bitrate=6553.7kbits/
    frame=  493 fps= 11 q=29.0 size=   13261kB time=00:00:16.50 bitrate=6581.2kbits/
    frame=  499 fps= 11 q=29.0 size=   13430kB time=00:00:16.73 bitrate=6572.9kbits/
    frame=  504 fps= 11 q=29.0 size=   13643kB time=00:00:16.85 bitrate=6631.1kbits/
    frame=  508 fps= 11 q=29.0 size=   13788kB time=00:00:16.97 bitrate=6655.8kbits/
    frame=  514 fps= 11 q=29.0 size=   13995kB time=00:00:17.08 bitrate=6709.5kbits/
    frame=  519 fps= 11 q=29.0 size=   14187kB time=00:00:17.43 bitrate=6665.6kbits/
    frame=  525 fps= 11 q=29.0 size=   14402kB time=00:00:17.55 bitrate=6722.0kbits/
    frame=  531 fps= 11 q=29.0 size=   14653kB time=00:00:17.78 bitrate=6750.1kbits/
    frame=  537 fps= 11 q=29.0 size=   14909kB time=00:00:17.89 bitrate=6823.4kbits/
    frame=  544 fps= 11 q=29.0 size=   15172kB time=00:00:18.13 bitrate=6854.6kbits/
    frame=  553 fps= 11 q=29.0 size=   15667kB time=00:00:18.48 bitrate=6945.0kbits/
    frame=  558 fps= 11 q=29.0 size=   15829kB time=00:00:18.59 bitrate=6972.8kbits/
    frame=  564 fps= 11 q=29.0 size=   16067kB time=00:00:18.82 bitrate=6990.6kbits/
    frame=  570 fps= 11 q=29.0 size=   16264kB time=00:00:18.94 bitrate=7033.1kbits/
    frame=  576 fps= 11 q=29.0 size=   16530kB time=00:00:19.29 bitrate=7019.1kbits/
    frame=  582 fps= 11 q=29.0 size=   16754kB time=00:00:19.40 bitrate=7071.5kbits/
    frame=  588 fps= 11 q=29.0 size=   17015kB time=00:00:19.64 bitrate=7096.9kbits/
    frame=  595 fps= 11 q=29.0 size=   17255kB time=00:00:19.87 bitrate=7112.8kbits/
    frame=  601 fps= 11 q=29.0 size=   17491kB time=00:00:19.98 bitrate=7168.3kbits/
    frame=  606 fps= 11 q=29.0 size=   17659kB time=00:00:20.22 bitrate=7153.8kbits/
    frame=  611 fps= 11 q=29.0 size=   17835kB time=00:00:20.45 bitrate=7143.0kbits/
    frame=  618 fps= 11 q=29.0 size=   18125kB time=00:00:20.56 bitrate=7218.1kbits/
    frame=  624 fps= 11 q=29.0 size=   18306kB time=00:00:20.80 bitrate=7208.9kbits/
    frame=  631 fps= 11 q=29.0 size=   18510kB time=00:00:21.15 bitrate=7169.4kbits/
    frame=  638 fps= 11 q=29.0 size=   18771kB time=00:00:21.26 bitrate=7230.6kbits/
    frame=  644 fps= 11 q=29.0 size=   18953kB time=00:00:21.49 bitrate=7221.9kbits/
    frame=  647 fps= 11 q=29.0 size=   19065kB time=00:00:21.61 bitrate=7225.8kbits/
    frame=  653 fps= 11 q=29.0 size=   19312kB time=00:00:21.73 bitrate=7280.0kbits/
    frame=  660 fps= 11 q=29.0 size=   19499kB time=00:00:22.07 bitrate=7234.8kbits/
    frame=  666 fps= 11 q=29.0 size=   19717kB time=00:00:22.19 bitrate=7277.2kbits/
    frame=  673 fps= 11 q=29.0 size=   19897kB time=00:00:22.42 bitrate=7267.7kbits/
    frame=  679 fps= 11 q=29.0 size=   20081kB time=00:00:22.54 bitrate=7297.2kbits/
    frame=  685 fps= 11 q=29.0 size=   20324kB time=00:00:22.89 bitrate=7273.1kbits/
    frame=  692 fps= 11 q=29.0 size=   20536kB time=00:00:23.12 bitrate=7275.0kbits/
    frame=  700 fps= 11 q=29.0 size=   20776kB time=00:00:23.47 bitrate=7251.0kbits/
    frame=  707 fps= 11 q=29.0 size=   20948kB time=00:00:23.58 bitrate=7275.1kbits/
    frame=  711 fps= 11 q=29.0 size=   21160kB time=00:00:23.70 bitrate=7312.5kbits/
    frame=  716 fps= 11 q=29.0 size=   21299kB time=00:00:23.82 bitrate=7324.8kbits/
    frame=  722 fps= 11 q=29.0 size=   21472kB time=00:00:24.16 bitrate=7277.8kbits/
    frame=  728 fps= 11 q=29.0 size=   21674kB time=00:00:24.28 bitrate=7311.2kbits/
    frame=  736 fps= 11 q=29.0 size=   21912kB time=00:00:24.63 bitrate=7287.1kbits/
    frame=  744 fps= 11 q=29.0 size=   22163kB time=00:00:24.86 bitrate=7301.6kbits/
    frame=  749 fps= 11 q=29.0 size=   22354kB time=00:00:24.98 bitrate=7330.2kbits/
    frame=  755 fps= 11 q=29.0 size=   22555kB time=00:00:25.09 bitrate=7362.0kbits/
    frame=  761 fps= 11 q=29.0 size=   22739kB time=00:00:25.33 bitrate=7354.2kbits/
    frame=  767 fps= 11 q=29.0 size=   23006kB time=00:00:25.56 bitrate=7372.7kbits/
    frame=  774 fps= 11 q=29.0 size=   23232kB time=00:00:25.79 bitrate=7378.2kbits/
    frame=  781 fps= 11 q=29.0 size=   23464kB time=00:00:26.02 bitrate=7385.5kbits/
    frame=  788 fps= 11 q=29.0 size=   23711kB time=00:00:26.14 bitrate=7430.0kbits/
    frame=  792 fps= 11 q=29.0 size=   23853kB time=00:00:26.25 bitrate=7441.6kbits/
    frame=  799 fps= 11 q=29.0 size=   24083kB time=00:00:26.60 bitrate=7414.9kbits/
    frame=  806 fps= 11 q=29.0 size=   24519kB time=00:00:26.83 bitrate=7483.7kbits/
    frame=  813 fps= 11 q=29.0 size=   24713kB time=00:00:27.07 bitrate=7478.3kbits/
    frame=  818 fps= 11 q=29.0 size=   24926kB time=00:00:27.18 bitrate=7510.7kbits/
    frame=  823 fps= 11 q=29.0 size=   25074kB time=00:00:27.41 bitrate=7491.2kbits/
    frame=  830 fps= 11 q=29.0 size=   25314kB time=00:00:27.65 bitrate=7499.2kbits/
    frame=  836 fps= 11 q=29.0 size=   25541kB time=00:00:27.76 bitrate=7535.0kbits/
    frame=  841 fps= 11 q=29.0 size=   25669kB time=00:00:28.00 bitrate=7510.0kbits/
    frame=  850 fps= 11 q=29.0 size=   25971kB time=-577014:-32:-22.-77 bitrate=N/A
    frame=  850 fps= 10 q=-1.0 Lsize=   27415kB time=00:00:28.37 bitrate=7915.7kbits
    /s dup=21 drop=0
    video:26940kB audio:444kB subtitle:0 global headers:0kB muxing overhead 0.113344
    %
    [libx264 @ 0000000002788fc0] frame I:4     Avg QP:20.92  size:166382
    [libx264 @ 0000000002788fc0] frame P:246   Avg QP:23.11  size: 60370
    [libx264 @ 0000000002788fc0] frame B:600   Avg QP:26.45  size: 20116
    [libx264 @ 0000000002788fc0] consecutive B-frames:  4.2%  1.9%  9.2% 84.7%
    [libx264 @ 0000000002788fc0] mb I  I16..4: 12.5% 73.1% 14.4%
    [libx264 @ 0000000002788fc0] mb P  I16..4:  1.9%  3.4%  0.5%  P16..4: 55.6% 14.5
    %  7.5%  0.0%  0.0%    skip:16.6%
    [libx264 @ 0000000002788fc0] mb B  I16..4:  0.2%  0.3%  0.1%  B16..8: 43.8%  3.9
    %  0.8%  direct: 2.9%  skip:48.0%  L0:50.7% L1:46.7% BI: 2.6%
    [libx264 @ 0000000002788fc0] 8x8 transform intra:60.5% inter:79.4%
    [libx264 @ 0000000002788fc0] coded y,uvDC,uvAC intra: 50.1% 56.3% 11.6% inter: 1
    4.5% 16.6% 0.1%
    [libx264 @ 0000000002788fc0] i16 v,h,dc,p: 35% 23% 12% 31%
    [libx264 @ 0000000002788fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 15% 25%  6%  4%
    5%  4%  9%  5%
    [libx264 @ 0000000002788fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 14% 13%  6%  6%
    7%  4%  8%  4%
    [libx264 @ 0000000002788fc0] i8c dc,h,v,p: 61% 14% 21%  3%
    [libx264 @ 0000000002788fc0] Weighted P-Frames: Y:2.8% UV:2.0%
    [libx264 @ 0000000002788fc0] ref P L0: 58.0%  6.9% 26.5%  8.4%  0.1%
    [libx264 @ 0000000002788fc0] ref B L0: 86.3% 10.7%  3.0%
    [libx264 @ 0000000002788fc0] ref B L1: 93.4%  6.6%
    [libx264 @ 0000000002788fc0] kb/s:7832.26
  • php ming flash swf slideshow to mp4/avi

    19 août 2013, par Stefan

    After hours of searching and trying i finally got a nice script together that generates a good looking Flash .swf file with a nice transaction in between de images.
    It works great if you access the swf file directly in a browser, depending on the amount of images the flash created takes anywhere between 10 and 60 seconds.
    But when uploading to Youtube the movie created flashed by in one second.
    Because swf isnt really a accepted fileformat for Youtube we decided to convert the flash file to mp4 or avi using ffmpeg.
    Unfortunally that didnt work, it had the same effect as the youtube movie.
    We had a old version of ffmpeg and updated that to a recent version and tried to convert again with the same result.
    The main thing i see is that ffmpeg cant see the swf file duration and bitrate, they are both 'N/A' while were do set them in the php script.
    I thought it looked like the Metadata doesnt get written and i cant find anything on that regarding Ming.
    But i downloaded a phpclass that extracts the metadata from the swf and that tells me the framerate etc is getting set.

    Now i have to admit i havent really tested with the new version because the commandline options are a little different but ill work on that after i post this.
    In the previous version we tried setting the framerate of the source swf file, but that didnt work either.

    Anyone here that can has a idea ? it would be greatly appriciated.

    PHP Ming Script :

         $fps = 30;
            foreach($objects as $objectId => $images){
                   // START FLASH MOVIE
                   $m = new SWFMovie();
                   $m->setDimension($width, $height);
                   $m->setBackground(0, 0, 0);
                   $m->setRate($fps);
                   $m->setFrames(count($images)*202); //count(images)* 2 breaks *($fps*$breakTime)+22(fadeOut))

                   $i = 0;
                   foreach($images as $image){

                       // REMOVE THE BACKGROUND IMAGE
                       if($behind){
                           $m->remove($behind);
                       }
                       // # REMOVE

                       // LOAD NEW IMAGE
                       $img = new SWFBitmap(fopen($image,"rb"));
                       $pic = $m->add($img);
                       $pic->setdepth(3);
                       // # LOAD

                       // BREAK TIME
                       for($j=1;$j<=($fps*$breakTime);$j++){
                           $m->nextFrame();
                       }
                       $m->remove($pic);
                       // # BREAK

                       // LOAD THE NEXT IMAGE AS BACKGROUND, IF LAST IMAGE, LOAD FIRST
                       $nextBackgrondImage =($images[$i+1]) ? $images[$i+1] : $images[0] ;
                       $img = new SWFBitmap(fopen($nextBackgrondImage,"rb"));
                       $behind = $m->add($img);
                       $behind->setdepth(2);
                       // # LOAD

                       // AND FADE OUT AGAIN
                       $img = fadeOut($image, $width, $height);
                       $pic = $m->add($img);
                       $pic->setdepth(3);
                       // # FADE OUT

                       // BREAK TIME
                       for($j=1;$j<=($fps*$breakTime);$j++){
                           $m->nextFrame();
                       }
                       $m->remove($pic);
                       # BREAK
                       $i++;
                   }      
                   $m->save('./flash/'.$nvmId.'_'.$objectId.'.swf');  
               unset($m);
               }
    }

    FFMPEG version :

    root@server:~# ffmpeg -version
    \FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
     built on Aug 15 2013 20:43:21 with gcc 4.4.5
     configuration: --enable-libmp3lame --enable-libtheora --enable-libx264
     --enable-libgsm --enable-postproc --enable-libxvid --enable-libfaac --enable-pthreads
     --enable-libvorbis --enable-gpl --enable-x11grab --enable-nonfree
     libavutil     50.36. 0 / 50.36. 0
     libavcore      0.16. 1 /  0.16. 1
     libavcodec    52.108. 0 / 52.108. 0
     libavformat   52.93. 0 / 52.93. 0
     libavdevice   52. 2. 3 / 52. 2. 3
     libavfilter    1.74. 0 /  1.74. 0
     libswscale     0.12. 0 /  0.12. 0
     libpostproc   51. 2. 0 / 51. 2. 0
    FFmpeg SVN-r26402
    libavutil     50.36. 0 / 50.36. 0
    libavcore      0.16. 1 /  0.16. 1
    libavcodec    52.108. 0 / 52.108. 0
    libavformat   52.93. 0 / 52.93. 0
    libavdevice   52. 2. 3 / 52. 2. 3
    libavfilter    1.74. 0 /  1.74. 0
    libswscale     0.12. 0 /  0.12. 0
    libpostproc   51. 2. 0 / 51. 2. 0

    FFMPEG command

    root@server:~# ffmpeg -r 30 -i /pathTo/flash/73003_8962011.swf -r 30 -ar 22050 -b 2048k /pathTo/flash/output.avi
    FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
     built on Aug 15 2013 20:43:21 with gcc 4.4.5
     configuration: --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libgsm --enable-postproc --enable-libxvid
     --enable-libfaac --enable-pthreads --enable-libvorbis --enable-gpl --enable-x11grab --enable-nonfree
     libavutil     50.36. 0 / 50.36. 0
     libavcore      0.16. 1 /  0.16. 1
     libavcodec    52.108. 0 / 52.108. 0
     libavformat   52.93. 0 / 52.93. 0
     libavdevice   52. 2. 3 / 52. 2. 3
     libavfilter    1.74. 0 /  1.74. 0
     libswscale     0.12. 0 /  0.12. 0
     libpostproc   51. 2. 0 / 51. 2. 0
    [swf @ 0x1ca1510] Estimating duration from bitrate, this may be inaccurate
    Input #0, swf, from '/pathTo/flash/73003_8962011.swf':
     Duration: N/A, bitrate: N/A
       Stream #0.0: Video: mjpeg, yuvj420p, 360x480, 30 fps, 30 tbr, 30 tbn, 30 tbc
    File '/pathTo/output.avi' already exists. Overwrite ? [y/N] y
    [buffer @ 0x1cb42d0] w:360 h:480 pixfmt:yuvj420p
    [ffsink @ 0x1cb4570] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x1cb4870] w:360 h:480 fmt:yuvj420p -> w:360 h:480 fmt:yuv420p flags:0xa0000004
    Output #0, avi, to '/pathTo/flash/output.avi':
     Metadata:
       ISFT            : Lavf52.93.0
       Stream #0.0: Video: mpeg4, yuv420p, 360x480, q=2-31, 2048 kb/s, 30 tbn, 30 tbc
    Stream mapping:
     Stream #0.0 -> #0.0
    Press [q] to stop encoding
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    Input Stream #0.0 frame size changed to 640x480, yuvj420p
    frame=   39 fps=  0 q=17.5 Lsize=     524kB time=1.30 bitrate=3304.9kbits/s
    video:518kB audio:0kB global headers:0kB muxing overhead 1.250735%

    Metadata :

    DEBUG: Data values initialized
    DEBUG: Opened ./flash/98701_8965910.swf
    DEBUG: Read MAGIC signature: FWS
    DEBUG: Read VERSION: 9
    DEBUG: Partial SIZE read: 225
    DEBUG: Partial SIZE read: 28928
    DEBUG: Partial SIZE read: 1441792
    DEBUG: Partial SIZE read: 0
    DEBUG: Total SIZE: 1470945
    DEBUG: RECT field size: 15 bits
    DEBUG: RECT binary value: 000000000000000 (0)
    DEBUG: RECT binary value: 011001000000000 (640)
    DEBUG: RECT binary value: 000000000000000 (0)
    DEBUG: RECT binary value: 010010110000000 (480)
    DEBUG: Frame rate: 30.0
    DEBUG: Frames: 2222
    DEBUG: Finished processing ./flash/98701_8965910.swf
    FILE: ./flash/98701_8965910.swf
    MAGIC: FWS
    VERSION: 9
    SIZE: 1470945 bytes
    WIDHT: 640
    HEIGHT: 480
    FPS: 30.0 Frames/s
    FRAMES: 2222 FRAME
  • How to use (django-celery,RQ) worker to execute a video filetype conversion (ffmpeg) in django on heroku (My code works locally)

    15 janvier 2013, par GetItDone

    One part of my website includes a form that allows users to upload video. I use ffmpeg to convert the video to flv. My media and static files are stored on Amazon S3. I can get everything to work perfectly locally, however I can't seem to figure out how to use a worker to run the video conversion subprocess in production. I have dj-celery and rq installed in my app. The code in my view that I was able to get to work locally is :

    #views.py
    def upload_broadcast(request):
       if request.method == 'POST':
           form = VideoUploadForm(request.POST, request.FILES)
           if form.is_valid():
               new_video=form.save()
               def convert_to_flv(video):
                   filename = video.video_upload
                   sourcefile = "%s%s" % (settings.MEDIA_ROOT, filename)
                   flvfilename = "%s.flv" % video.id
                   imagefilename = "%s.png" % video.id
                   thumbnailfilename = "%svideos/flv/%s" % (settings.MEDIA_ROOT, imagefilename)
                   targetfile = "%svideos/flv/%s" % (settings.MEDIA_ROOT, flvfilename)
                   ffmpeg = "ffmpeg -i %s -acodec mp3 -ar 22050 -f flv -s 320x240 %s" % (sourcefile, targetfile)
                   grabimage = "ffmpeg -y -i %s -vframes 1 -ss 00:00:02 -an -vcodec png -f rawvideo -s 320x240 %s" % (sourcefile, thumbnailfilename)
                   print ("SOURCE: %s" % sourcefile)
                   print ("TARGET: %s" % targetfile)
                   print ("TARGET IMAGE: %s" % thumbnailfilename)
                   print ("FFMPEG TASK CODE: %s" % ffmpeg)
                   print ("IMAGE TASK CODE: %s" % grabimage)
                   try:
                       ffmpegresult = subprocess.call(ffmpeg)
                       print "---------------FFMPEG---------------"
                       print ffmpegresult
                   except:
                       print "Not working."
                   try:
                       videothumbnail = subprocess.call(grabimage)
                       print "---------------IMAGE---------------"
                       print videothumbnail
                   except:
                       print "Not working."
                   video.flvfilename = flvfilename
                   video.videothumbnail = imagefilename
                   video.save()

               convert_to_flv(new_video)

               return HttpResponseRedirect('/video_list/')
       else:
    ...

    This is my first time trying to use a worker (or ever pushing a project to production), so even with the documentation it is still unclear to me what I need to do. I have tried several different things but nothing seems to work. Is there just a simple way to tell celery to run the ffmpegresult = subprocess.call(ffmpeg) ? Thanks in advance for any help or insight.

    EDIT- Added heroku logs

    2013-01-10T20:58:57+00:00 app[web.1]: TARGET: /media/videos/flv/8.flv
    2013-01-10T20:58:57+00:00 app[web.1]: IMAGE TASK CODE: ffmpeg -y -i /media/videos/practice.wmv -vframes 1 -ss 00:00:02 - an -vcodec png -f rawvideo -s 320x240 /media/videos/flv/8.png
    2013-01-10T20:58:57+00:00 app[web.1]: SOURCE: /media/videos/practice.wmv
    2013-01-10T20:58:57+00:00 app[web.1]: FFMPEG TASK CODE: ffmpeg -i /media/videos/practice.wmv -acodec mp3 -ar 22050 -f fl v -s 320x240 /media/videos/flv/8.flv
    2013-01-10T20:58:57+00:00 app[web.1]: TARGET IMAGE: /media/videos/flv/8.png
    2013-01-10T20:58:57+00:00 app[web.1]: Not working.
    2013-01-10T20:58:57+00:00 app[web.1]: Not working.

    NEWER EDIT

    I tried adding a tasks.py and added the task :

    celery = Celery('tasks', broker='redis://guest@localhost//')

    @celery.task
    def ffmpeg_task(video):
       converted_file = subprocess.call(video)
       return converted_file

    then I changed the relevant section of my view to :

    ...
    try:
       ffmpeg_task.delay(ffmpeg)
       print "---------------FFMPEG---------------"
       print ffmpegresult
    except:
       print "Not working."
    ...

    My new logs are :

    2013-01-15T13:19:52+00:00 app[web.1]: TARGET IMAGE: /media/videos/flv/12.png
    2013-01-15T13:19:52+00:00 app[web.1]: SOURCE: /media/videos/practice.wmv
    2013-01-15T13:19:52+00:00 app[web.1]: FFMPEG TASK CODE: ffmpeg -i /media/videos/practice.wmv -acodec mp3 -ar 22050 -f fl v -s 320x240 /media/videos/flv/12.flv
    2013-01-15T13:19:52+00:00 app[web.1]: IMAGE TASK CODE: ffmpeg -y -i /media/videos/practice.wmv -vframes 1 -ss 00:00:02 -an -vcodec png -f rawvideo -s 320x240 /media/videos/flv/12.png
    2013-01-15T13:19:52+00:00 app[web.1]: TARGET: /media/videos/flv/12.flv
    2013-01-15T13:20:17+00:00 app[web.1]: 2013-01-15 13:20:17 [2] [CRITICAL] WORKER TIMEOUT (pid:12)
    2013-01-15T13:20:17+00:00 app[web.1]: 2013-01-15 13:20:17 [2] [CRITICAL] WORKER TIMEOUT (pid:12)
    2013-01-15T13:20:17+00:00 app[web.1]: 2013-01-15 13:20:17 [19] [INFO] Booting worker with pid: 19

    Am I completely missing something ? I'll keep trying, but will be very appreciative of any direction or assistance.