Recherche avancée

Médias (0)

Mot : - Tags -/interaction

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

Autres articles (65)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (7408)

  • Resize the video

    8 juin 2016, par Android dev

    I have a requirement for video size before upload on the server and would like to resize the video to make sure it will not go the threshold.

    So far I ended up with this command :

    ffmpeg -y -i E:\test3.mp4 -s 640*480 -r 15 -aspect 3:4 -ab 12288 -vcodec mpeg4 -b 2097152 E:\debug_video.mp4

    The issues with this command :
    - is it changes aspect ratio of the video
    - it works too slow (30 seconds for 12 seconds 24mb video on Nexus 5)

    The best solution so far for the first issue is to check the video resolution first and only than run the ffmpeg.

    Do you know how to do that with help of ffmpeg as two separate commands or as a single one ? Do you know how to make it faster ? Thank you in advance

    UPDATE
    The console output is below. Please let me know if you would like to get console output for onProgress callback

    adb -s 07f0f4ac01897da5 logcat "ffmpeg:*" "*:S"
    06-08 17:43:29.589 20835 20835 D ffmpeg  : FFmpeg:onProgress: ffmpeg version n3.
    0.1 Copyright (c) 2000-2016 the FFmpeg developers
    06-08 17:43:29.589 20835 20835 D ffmpeg  : FFmpeg:onProgress:   built with gcc 4
    .8 (GCC)
    06-08 17:43:29.592 20835 20835 D ffmpeg  : FFmpeg:onProgress:   configuration: -
    -target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchai
    n-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime
    -cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/s
    ysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enab
    le-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disabl
    e-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable
    -ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-sha
    red --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-
    pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --
    extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/includ
    e -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-a
    ll' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android
    /lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxf
    lags=
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libavutil      5
    5. 17.103 / 55. 17.103
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libavcodec     5
    7. 24.102 / 57. 24.102
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libavformat    5
    7. 25.100 / 57. 25.100
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libavdevice    5
    7.  0.101 / 57.  0.101
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libavfilter
    6. 31.100 /  6. 31.100
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libswscale
    4.  0.100 /  4.  0.100
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libswresample
    2.  0.101 /  2.  0.101
    06-08 17:43:29.600 20835 20835 D ffmpeg  : FFmpeg:onProgress:   libpostproc    5
    4.  0.100 / 54.  0.100
    06-08 17:43:29.885 20835 20835 D ffmpeg  : FFmpeg:onProgress: Input #0, mov,mp4,
    m4a,3gp,3g2,mj2, from '/storage/emulated/0/Pictures/test2.mp4':
    06-08 17:43:29.885 20835 20835 D ffmpeg  : FFmpeg:onProgress:   Metadata:
    06-08 17:43:29.885 20835 20835 D ffmpeg  : FFmpeg:onProgress:     major_brand
     : mp42
    06-08 17:43:29.885 20835 20835 D ffmpeg  : FFmpeg:onProgress:     minor_version
     : 0
    06-08 17:43:29.885 20835 20835 D ffmpeg  : FFmpeg:onProgress:     compatible_bra
    nds: isommp42
    06-08 17:43:29.886 20835 20835 D ffmpeg  : FFmpeg:onProgress:     creation_time
     : 2016-06-02 09:20:58
    06-08 17:43:29.886 20835 20835 D ffmpeg  : FFmpeg:onProgress:     com.android.ve
    rsion: 6.0.1
    06-08 17:43:29.886 20835 20835 D ffmpeg  : FFmpeg:onProgress:   Duration: 00:00:
    12.03, start: 0.000000, bitrate: 17234 kb/s
    06-08 17:43:29.886 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Stream #0:0(en
    g): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 16902 kb/s,
    SAR 1:1 DAR 16:9, 29.81 fps, 29.85 tbr, 90k tbn, 180k tbc (default)
    06-08 17:43:29.886 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Metadata:
    06-08 17:43:29.890 20835 20835 D ffmpeg  : FFmpeg:onProgress:       rotate
       : 90
    06-08 17:43:29.890 20835 20835 D ffmpeg  : FFmpeg:onProgress:       creation_tim
    e   : 2016-06-02 09:20:58
    06-08 17:43:29.891 20835 20835 D ffmpeg  : FFmpeg:onProgress:       handler_name
       : VideoHandle
    06-08 17:43:29.891 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Side data:
    06-08 17:43:29.891 20835 20835 D ffmpeg  : FFmpeg:onProgress:       displaymatri
    x: rotation of -90.00 degrees
    06-08 17:43:29.892 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Stream #0:1(en
    g): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s (default)

    06-08 17:43:29.892 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Metadata:
    06-08 17:43:29.893 20835 20835 D ffmpeg  : FFmpeg:onProgress:       creation_tim
    e   : 2016-06-02 09:20:58
    06-08 17:43:29.893 20835 20835 D ffmpeg  : FFmpeg:onProgress:       handler_name
       : SoundHandle
    06-08 17:43:29.893 20835 20835 D ffmpeg  : FFmpeg:onProgress: Please use -b:a or
    -b:v, -b is ambiguous
    06-08 17:43:29.894 20835 20835 D ffmpeg  : FFmpeg:onProgress: Codec AVOption pre
    set (Set the encoding preset (cf. x264 --fullhelp)) specified for output file #0
    (/storage/emulated/0/Pictures/scaled_video.mp4) has not been used for any strea
    m. The most likely reason is either wrong type (e.g. a video option with no vide
    o streams) or that it is a private option of some encoder which was not actually
    used for any stream.
    06-08 17:43:29.939 20835 20835 D ffmpeg  : FFmpeg:onProgress: [mpeg4 @ 0xb5c4440
    0] Invalid pixel aspect ratio 5121/5120, limit is 255/255 reducing
    06-08 17:43:29.996 20835 20835 D ffmpeg  : FFmpeg:onProgress: Output #0, mp4, to
    '/storage/emulated/0/Pictures/scaled_video.mp4':
    06-08 17:43:29.998 20835 20835 D ffmpeg  : FFmpeg:onProgress:   Metadata:
    06-08 17:43:29.999 20835 20835 D ffmpeg  : FFmpeg:onProgress:     major_brand
     : mp42
    06-08 17:43:30.000 20835 20835 D ffmpeg  : FFmpeg:onProgress:     minor_version
     : 0
    06-08 17:43:30.000 20835 20835 D ffmpeg  : FFmpeg:onProgress:     compatible_bra
    nds: isommp42
    06-08 17:43:30.001 20835 20835 D ffmpeg  : FFmpeg:onProgress:     com.android.ve
    rsion: 6.0.1
    06-08 17:43:30.002 20835 20835 D ffmpeg  : FFmpeg:onProgress:     encoder
     : Lavf57.25.100
    06-08 17:43:30.003 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Stream #0:0(en
    g): Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 640x1138 [SAR 1:1 DAR 320:569],
    q=2-31, 2097 kb/s, SAR 5121:5120 DAR 9:16, 15 fps, 15360 tbn, 15 tbc (default)
    06-08 17:43:30.004 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Metadata:
    06-08 17:43:30.005 20835 20835 D ffmpeg  : FFmpeg:onProgress:       handler_name
       : VideoHandle
    06-08 17:43:30.006 20835 20835 D ffmpeg  : FFmpeg:onProgress:       creation_tim
    e   : 2016-06-02 09:20:58
    06-08 17:43:30.007 20835 20835 D ffmpeg  : FFmpeg:onProgress:       encoder
       : Lavc57.24.102 mpeg4
    06-08 17:43:30.008 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Side data:
    06-08 17:43:30.008 20835 20835 D ffmpeg  : FFmpeg:onProgress:       unknown side
    data type 10 (24 bytes)
    06-08 17:43:30.008 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Stream #0:1(en
    g): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, fltp, 12 kb/s (def
    ault)
    06-08 17:43:30.008 20835 20835 D ffmpeg  : FFmpeg:onProgress:     Metadata:
    06-08 17:43:30.008 20835 20835 D ffmpeg  : FFmpeg:onProgress:       creation_tim
    e   : 2016-06-02 09:20:58
    06-08 17:43:30.008 20835 20835 D ffmpeg  : FFmpeg:onProgress:       handler_name
       : SoundHandle
    06-08 17:43:30.009 20835 20835 D ffmpeg  : FFmpeg:onProgress:       encoder
       : Lavc57.24.102 aac
    06-08 17:43:30.009 20835 20835 D ffmpeg  : FFmpeg:onProgress: Stream mapping:
    06-08 17:43:30.009 20835 20835 D ffmpeg  : FFmpeg:onProgress:   Stream #0:0 -> #
    0:0 (h264 (native) -> mpeg4 (native))
    06-08 17:43:30.009 20835 20835 D ffmpeg  : FFmpeg:onProgress:   Stream #0:1 -> #
    0:1 (aac (native) -> aac (native))
    06-08 17:43:30.010 20835 20835 D ffmpeg  : FFmpeg:onProgress: Press [q] to stop,
    [?] for help
    06-08 17:43:30.730 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=    2 fps=0.
    0 q=2.0 size=     129kB time=00:00:01.00 bitrate=1056.4kbits/s speed=1.66x
    06-08 17:43:31.350 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=    5 fps=4.
    0 q=2.0 size=     314kB time=00:00:01.00 bitrate=2566.0kbits/s dup=0 drop=1 spee
    d=0.809x
    06-08 17:43:31.842 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=    8 fps=4.
    6 q=7.5 size=     404kB time=00:00:01.00 bitrate=3302.5kbits/s dup=0 drop=4 spee
    d=0.573x
    06-08 17:43:32.367 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   10 fps=4.
    4 q=8.7 size=     431kB time=00:00:01.00 bitrate=3523.1kbits/s dup=0 drop=6 spee
    d=0.441x
    06-08 17:43:32.873 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   13 fps=4.
    7 q=9.0 size=     518kB time=00:00:01.00 bitrate=4230.9kbits/s dup=0 drop=9 spee
    d=0.361x
    06-08 17:43:33.392 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   15 fps=4.
    5 q=11.6 size=     536kB time=00:00:01.00 bitrate=4381.7kbits/s dup=0 drop=11 sp
    eed=0.303x
    06-08 17:43:34.011 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   17 fps=4.
    3 q=11.7 size=     558kB time=00:00:02.00 bitrate=2279.7kbits/s dup=0 drop=13 sp
    eed=0.512x
    06-08 17:43:34.621 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   20 fps=4.
    4 q=12.5 size=     598kB time=00:00:02.00 bitrate=2444.5kbits/s dup=0 drop=16 sp
    eed=0.443x
    06-08 17:43:35.207 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   23 fps=4.
    5 q=11.3 size=     630kB time=00:00:02.00 bitrate=2574.3kbits/s dup=0 drop=19 sp
    eed=0.394x
    06-08 17:43:35.726 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   26 fps=4.
    6 q=10.1 size=     689kB time=00:00:02.00 bitrate=2815.3kbits/s dup=0 drop=22 sp
    eed=0.357x
    06-08 17:43:36.252 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   28 fps=4.
    6 q=9.6 size=     707kB time=00:00:02.00 bitrate=2888.7kbits/s dup=0 drop=24 spe
    ed=0.327x
    06-08 17:43:36.749 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   31 fps=4.
    7 q=9.5 size=     726kB time=00:00:02.06 bitrate=2879.6kbits/s dup=0 drop=27 spe
    ed=0.311x
    06-08 17:43:37.341 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   33 fps=4.
    6 q=9.3 size=     767kB time=00:00:03.00 bitrate=2089.4kbits/s dup=0 drop=29 spe
    ed=0.417x
    06-08 17:43:37.872 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   35 fps=4.
    5 q=9.4 size=     791kB time=00:00:03.00 bitrate=2154.3kbits/s dup=0 drop=31 spe
    ed=0.386x
    06-08 17:43:38.447 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   38 fps=4.
    6 q=9.2 size=     854kB time=00:00:03.00 bitrate=2324.7kbits/s dup=0 drop=34 spe
    ed=0.361x
    06-08 17:43:39.005 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   41 fps=4.
    6 q=8.2 size=     883kB time=00:00:03.00 bitrate=2404.7kbits/s dup=0 drop=36 spe
    ed=0.338x
    06-08 17:43:39.507 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   43 fps=4.
    6 q=9.0 size=     918kB time=00:00:03.00 bitrate=2499.3kbits/s dup=0 drop=38 spe
    ed=0.32x
    06-08 17:43:40.065 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   46 fps=4.
    6 q=9.6 size=     948kB time=00:00:03.06 bitrate=2531.5kbits/s dup=0 drop=41 spe
    ed=0.307x
    06-08 17:43:40.602 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   48 fps=4.
    6 q=9.3 size=     990kB time=00:00:04.01 bitrate=2021.2kbits/s dup=0 drop=43 spe
    ed=0.381x
    06-08 17:43:41.189 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   51 fps=4.
    6 q=7.3 size=    1025kB time=00:00:04.01 bitrate=2094.5kbits/s dup=0 drop=46 spe
    ed=0.361x
    06-08 17:43:41.744 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   54 fps=4.
    6 q=6.9 size=    1064kB time=00:00:04.01 bitrate=2173.0kbits/s dup=0 drop=49 spe
    ed=0.345x
    06-08 17:43:42.288 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   56 fps=4.
    6 q=6.1 size=    1082kB time=00:00:04.01 bitrate=2209.5kbits/s dup=0 drop=51 spe
    ed=0.329x
    06-08 17:43:42.872 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   59 fps=4.
    6 q=4.5 size=    1107kB time=00:00:04.01 bitrate=2260.3kbits/s dup=0 drop=54 spe
    ed=0.314x
    06-08 17:43:43.292 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   61 fps=4.
    6 q=3.2 size=    1152kB time=00:00:04.26 bitrate=2212.2kbits/s dup=0 drop=56 spe
    ed=0.321x
    06-08 17:43:43.986 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   64 fps=4.
    6 q=3.9 size=    1178kB time=00:00:05.01 bitrate=1924.7kbits/s dup=0 drop=59 spe
    ed=0.361x
    06-08 17:43:44.518 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   66 fps=4.
    6 q=3.6 size=    1196kB time=00:00:05.01 bitrate=1953.9kbits/s dup=0 drop=61 spe
    ed=0.347x
    06-08 17:43:45.104 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   69 fps=4.
    6 q=3.4 size=    1232kB time=00:00:05.01 bitrate=2013.0kbits/s dup=0 drop=64 spe
    ed=0.334x
    06-08 17:43:45.687 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   72 fps=4.
    6 q=4.9 size=    1263kB time=00:00:05.01 bitrate=2063.4kbits/s dup=0 drop=67 spe
    ed=0.321x
    06-08 17:43:46.262 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   75 fps=4.
    6 q=3.5 size=    1307kB time=00:00:05.01 bitrate=2135.1kbits/s dup=0 drop=70 spe
    ed=0.31x
    06-08 17:43:46.840 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   77 fps=4.
    6 q=3.1 size=    1334kB time=00:00:06.01 bitrate=1816.5kbits/s dup=0 drop=72 spe
    ed=0.359x
    06-08 17:43:47.354 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   80 fps=4.
    6 q=3.5 size=    1380kB time=00:00:06.01 bitrate=1878.6kbits/s dup=0 drop=75 spe
    ed=0.349x
    06-08 17:43:47.826 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   82 fps=4.
    6 q=3.6 size=    1412kB time=00:00:06.01 bitrate=1923.2kbits/s dup=0 drop=77 spe
    ed=0.339x
    06-08 17:43:48.346 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   85 fps=4.
    7 q=3.5 size=    1476kB time=00:00:06.01 bitrate=2009.8kbits/s dup=0 drop=80 spe
    ed=0.33x
    06-08 17:43:48.911 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   88 fps=4.
    7 q=3.5 size=    1524kB time=00:00:06.01 bitrate=2074.7kbits/s dup=0 drop=83 spe
    ed=0.32x
    06-08 17:43:49.496 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   91 fps=4.
    7 q=3.8 size=    1556kB time=00:00:06.06 bitrate=2101.5kbits/s dup=0 drop=86 spe
    ed=0.313x
    06-08 17:43:50.100 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   93 fps=4.
    7 q=4.1 size=    1616kB time=00:00:07.01 bitrate=1886.0kbits/s dup=0 drop=88 spe
    ed=0.352x
    06-08 17:43:50.598 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   95 fps=4.
    6 q=4.3 size=    1652kB time=00:00:07.01 bitrate=1928.4kbits/s dup=0 drop=90 spe
    ed=0.342x
    06-08 17:43:51.182 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=   98 fps=4.
    7 q=4.7 size=    1728kB time=00:00:07.01 bitrate=2017.1kbits/s dup=0 drop=93 spe
    ed=0.333x
    06-08 17:43:51.693 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  100 fps=4.
    6 q=4.6 size=    1763kB time=00:00:07.01 bitrate=2057.5kbits/s dup=0 drop=95 spe
    ed=0.325x
    06-08 17:43:52.272 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  103 fps=4.
    6 q=4.6 size=    1812kB time=00:00:07.01 bitrate=2115.1kbits/s dup=0 drop=98 spe
    ed=0.317x
    06-08 17:43:52.839 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  106 fps=4.
    7 q=4.2 size=    1845kB time=00:00:07.06 bitrate=2138.7kbits/s dup=0 drop=101 sp
    eed=0.311x
    06-08 17:43:53.383 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  108 fps=4.
    6 q=4.1 size=    1886kB time=00:00:08.02 bitrate=1925.7kbits/s dup=0 drop=103 sp
    eed=0.344x
    06-08 17:43:53.966 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  111 fps=4.
    7 q=3.5 size=    1940kB time=00:00:08.02 bitrate=1981.0kbits/s dup=0 drop=106 sp
    eed=0.336x
    06-08 17:43:54.472 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  113 fps=4.
    6 q=3.1 size=    1968kB time=00:00:08.02 bitrate=2010.1kbits/s dup=0 drop=108 sp
    eed=0.329x
    06-08 17:43:55.129 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  116 fps=4.
    6 q=3.3 size=    2016kB time=00:00:08.02 bitrate=2058.5kbits/s dup=0 drop=111 sp
    eed=0.321x
    06-08 17:43:55.624 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  119 fps=4.
    7 q=3.2 size=    2052kB time=00:00:08.02 bitrate=2096.0kbits/s dup=0 drop=114 sp
    eed=0.314x
    06-08 17:43:56.082 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  121 fps=4.
    6 q=2.7 size=    2119kB time=00:00:08.06 bitrate=2152.0kbits/s dup=0 drop=116 sp
    eed=0.309x
    06-08 17:43:56.729 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  124 fps=4.
    7 q=4.0 size=    2172kB time=00:00:09.02 bitrate=1971.5kbits/s dup=0 drop=119 sp
    eed=0.339x
    06-08 17:43:57.292 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  127 fps=4.
    7 q=3.5 size=    2210kB time=00:00:09.02 bitrate=2006.0kbits/s dup=0 drop=122 sp
    eed=0.332x
    06-08 17:43:57.793 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  129 fps=4.
    7 q=3.3 size=    2234kB time=00:00:09.02 bitrate=2028.1kbits/s dup=0 drop=124 sp
    eed=0.326x
    06-08 17:43:58.431 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  132 fps=4.
    7 q=3.3 size=    2275kB time=00:00:09.02 bitrate=2065.6kbits/s dup=0 drop=127 sp
    eed=0.319x
    06-08 17:43:58.986 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  135 fps=4.
    7 q=3.4 size=    2344kB time=00:00:09.02 bitrate=2127.5kbits/s dup=0 drop=130 sp
    eed=0.313x
    06-08 17:43:59.374 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  136 fps=4.
    6 q=3.2 size=    2356kB time=00:00:09.10 bitrate=2119.0kbits/s dup=0 drop=131 sp
    eed=0.31x
    06-08 17:43:59.986 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  139 fps=4.
    6 q=2.9 size=    2392kB time=00:00:10.02 bitrate=1954.2kbits/s dup=0 drop=133 sp
    eed=0.335x
    06-08 17:44:00.582 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  142 fps=4.
    7 q=2.8 size=    2428kB time=00:00:10.02 bitrate=1983.5kbits/s dup=0 drop=136 sp
    eed=0.329x
    06-08 17:44:01.158 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  145 fps=4.
    7 q=3.0 size=    2516kB time=00:00:10.02 bitrate=2055.4kbits/s dup=0 drop=139 sp
    eed=0.323x
    06-08 17:44:01.691 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  148 fps=4.
    7 q=4.6 size=    2583kB time=00:00:10.02 bitrate=2110.7kbits/s dup=0 drop=142 sp
    eed=0.317x
    06-08 17:44:02.168 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  150 fps=4.
    7 q=4.8 size=    2626kB time=00:00:10.02 bitrate=2145.1kbits/s dup=0 drop=144 sp
    eed=0.312x
    06-08 17:44:02.587 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  152 fps=4.
    7 q=5.0 size=    2668kB time=00:00:10.32 bitrate=2117.0kbits/s dup=0 drop=146 sp
    eed=0.317x
    06-08 17:44:03.209 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  154 fps=4.
    6 q=5.0 size=    2709kB time=00:00:11.02 bitrate=2012.4kbits/s dup=0 drop=148 sp
    eed=0.333x
    06-08 17:44:03.815 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  157 fps=4.
    7 q=3.7 size=    2770kB time=00:00:11.02 bitrate=2057.2kbits/s dup=0 drop=151 sp
    eed=0.327x
    06-08 17:44:04.402 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  160 fps=4.
    7 q=3.3 size=    2800kB time=00:00:11.02 bitrate=2079.7kbits/s dup=0 drop=154 sp
    eed=0.321x
    06-08 17:44:04.965 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  163 fps=4.
    7 q=3.0 size=    2835kB time=00:00:11.02 bitrate=2105.7kbits/s dup=0 drop=157 sp
    eed=0.316x
    06-08 17:44:05.505 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  166 fps=4.
    7 q=3.1 size=    2880kB time=00:00:11.06 bitrate=2131.8kbits/s dup=0 drop=160 sp
    eed=0.313x
    06-08 17:44:06.094 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  169 fps=4.
    7 q=3.3 size=    2880kB time=00:00:11.26 bitrate=2093.9kbits/s dup=0 drop=163 sp
    eed=0.313x
    06-08 17:44:06.603 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  171 fps=4.
    7 q=3.8 size=    2880kB time=00:00:11.40 bitrate=2069.5kbits/s dup=0 drop=165 sp
    eed=0.312x
    06-08 17:44:07.192 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  174 fps=4.
    7 q=3.6 size=    2880kB time=00:00:11.60 bitrate=2033.8kbits/s dup=0 drop=168 sp
    eed=0.313x
    06-08 17:44:07.772 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  177 fps=4.
    7 q=3.3 size=    2880kB time=00:00:11.80 bitrate=1999.3kbits/s dup=0 drop=171 sp
    eed=0.313x
    06-08 17:44:08.287 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  180 fps=4.
    7 q=3.2 size=    2880kB time=00:00:12.00 bitrate=1966.0kbits/s dup=0 drop=174 sp
    eed=0.314x
    06-08 17:44:08.900 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  182 fps=4.
    7 q=3.5 size=    3118kB time=00:00:12.13 bitrate=2105.2kbits/s dup=0 drop=176 sp
    eed=0.313x
    06-08 17:44:08.915 20835 20835 D ffmpeg  : FFmpeg:onProgress: frame=  182 fps=4.
    7 q=3.5 Lsize=    3205kB time=00:00:12.13 bitrate=2163.7kbits/s dup=0 drop=176 s
    peed=0.312x
    06-08 17:44:08.915 20835 20835 D ffmpeg  : FFmpeg:onProgress: video:3177kB audio
    :21kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.19565
    3%
    06-08 17:44:08.946 20835 20835 D ffmpeg  : FFmpeg:onProgress: [aac @ 0xb5c44c00]
    Qavg: 137.182
    06-08 17:44:08.963 20835 20835 D ffmpeg  : FFmpeg:onSuccess: ffmpeg version n3.0
    .1 Copyright (c) 2000-2016 the FFmpeg developers
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   built with gcc 4.8 (GCC)
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   configuration: --target-os=linux --
    cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-l
    inux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroo
    t=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic
    --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --ena
    ble-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-f
    fserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-f
    fprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static
    --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix
    =/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/ho
    me/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE
    -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags
    ='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -
    Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libavutil      55. 17.103 / 55. 17.
    103
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libavcodec     57. 24.102 / 57. 24.
    102
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libavformat    57. 25.100 / 57. 25.
    100
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libavdevice    57.  0.101 / 57.  0.
    101
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libavfilter     6. 31.100 /  6. 31.
    100
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libswscale      4.  0.100 /  4.  0.
    100
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libswresample   2.  0.101 /  2.  0.
    101
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   libpostproc    54.  0.100 / 54.  0.
    100
    06-08 17:44:08.963 20835 20835 D ffmpeg  : Input #0, mov,mp4,m4a,3gp,3g2,mj2, fr
    om '/storage/emulated/0/Pictures/test2.mp4':
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   Metadata:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     major_brand     : mp42
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     minor_version   : 0
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     compatible_brands: isommp42
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     creation_time   : 2016-06-02 09:2
    0:58
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     com.android.version: 6.0.1
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   Duration: 00:00:12.03, start: 0.000
    000, bitrate: 17234 kb/s
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Stream #0:0(eng): Video: h264 (Ba
    seline) (avc1 / 0x31637661), yuv420p, 1920x1080, 16902 kb/s, SAR 1:1 DAR 16:9, 2
    9.81 fps, 29.85 tbr, 90k tbn, 180k tbc (default)
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Metadata:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       rotate          : 90
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       creation_time   : 2016-06-02 09
    :20:58
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       handler_name    : VideoHandle
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Side data:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       displaymatrix: rotation of -90.
    00 degrees
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Stream #0:1(eng): Audio: aac (LC)
    (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s (default)
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Metadata:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       creation_time   : 2016-06-02 09
    :20:58
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       handler_name    : SoundHandle
    06-08 17:44:08.963 20835 20835 D ffmpeg  : Please use -b:a or -b:v, -b is ambigu
    ous
    06-08 17:44:08.963 20835 20835 D ffmpeg  : Codec AVOption preset (Set the encodi
    ng preset (cf. x264 --fullhelp)) specified for output file #0 (/storage/emulated
    /0/Pictures/scaled_video.mp4) has not been used for any stream. The most likely
    reason is either wrong type (e.g. a video option with no video streams) or that
    it is a private option of some encoder which was not actually used for any strea
    m.
    06-08 17:44:08.963 20835 20835 D ffmpeg  : [mpeg4 @ 0xb5c44400] Invalid pixel as
    pect ratio 5121/5120, limit is 255/255 reducing
    06-08 17:44:08.963 20835 20835 D ffmpeg  : Output #0, mp4, to '/storage/emulated
    /0/Pictures/scaled_video.mp4':
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   Metadata:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     major_brand     : mp42
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     minor_version   : 0
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     compatible_brands: isommp42
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     com.android.version: 6.0.1
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     encoder         : Lavf57.25.100
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Stream #0:0(eng): Video: mpeg4 (
    [0][0][0] / 0x0020), yuv420p, 640x1138 [SAR 1:1 DAR 320:569], q=2-31, 2097 kb/s,
    SAR 5121:5120 DAR 9:16, 15 fps, 15360 tbn, 15 tbc (default)
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Metadata:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       handler_name    : VideoHandle
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       creation_time   : 2016-06-02 09
    :20:58
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       encoder         : Lavc57.24.102
    mpeg4
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Side data:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       unknown side data type 10 (24 b
    ytes)
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Stream #0:1(eng): Audio: aac (LC)
    ([64][0][0][0] / 0x0040), 48000 Hz, mono, fltp, 12 kb/s (default)
    06-08 17:44:08.963 20835 20835 D ffmpeg  :     Metadata:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       creation_time   : 2016-06-02 09
    :20:58
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       handler_name    : SoundHandle
    06-08 17:44:08.963 20835 20835 D ffmpeg  :       encoder         : Lavc57.24.102
    aac
    06-08 17:44:08.963 20835 20835 D ffmpeg  : Stream mapping:
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   Stream #0:0 -> #0:0 (h264 (native)
    -> mpeg4 (native))
    06-08 17:44:08.963 20835 20835 D ffmpeg  :   Stream #0:1 -> #0:1 (aac (native) -
    > aac (native))
    06-08 17:44:08.963 20835 20835 D ffmpeg  : Press [q] to stop, [?] for help
    06-08 17:44:08.963 20835 20835 D ffmpeg  : frame=    2 fps=0.0 q=2.0 size=     1
    29kB time=00:00:01.00 bitrate=1056.4kbits/s speed=1.66x
    06-08 17:44:08.963 20835 20835 D ffmpeg  : frame=    5 fps=4.0 q=2.0 size=     3
    14kB time=00:00:01.00 bitrate=2566.0kbits/s dup=0 drop=1 speed=0.809x
    06-08 17:44:08.963 20835 20835 D ffmpeg  : frame=    8
    06-08 17:44:08.963 20835 20835 D ffmpeg  : FFmpeg:onFinish:
  • Why when converting avi video file to another format the first 2-3 seconds are blurry ?

    13 juin 2016, par Sharon Gabriel

    The source file is avi. The target new file is mp4.
    The first 2-3 seconds are blurry. Then after 2-3 second the whole video until the end is smooth and sharp.

    Another sub question is how come that 2.16 GB avi file after conversion using ffmpeg is only 1.34 MB ? It’s not part of a movie or something it’s collection of screenshots images i did in c# and then used AviFile Lib to create from them a avi video file. and yet from 2.16 GB to 1.34 MB and it keep the quality i think almost the same quality like the original avi file and the same duration 2:20 minutes.

    About the blurry problem this is my code where i set the ffmpeg arguments and set the process :

    private void Convert()
           {
               try
               {
                   Control.CheckForIllegalCrossThreadCalls = false;
                   if (ComboBox1.SelectedIndex == 3)
                   {
                       strFFCMD = " -i " + (char)34 + InputFile + (char)34 + " -c:v libx264 -s 1920x1080 -pix_fmt yuv420p -qp 18 -profile high444 -c:a libvo_aacenc -b:a 128k -ar 44100 -ac 2 -y " + OutputFile;
                   }    
                   psiProcInfo.FileName = exepath;
                   psiProcInfo.Arguments = strFFCMD;        
                   psiProcInfo.UseShellExecute = false;      
                   psiProcInfo.WindowStyle = ProcessWindowStyle.Hidden;    
                   psiProcInfo.RedirectStandardError = true;            
                   psiProcInfo.RedirectStandardOutput = true;        
                   psiProcInfo.CreateNoWindow = true;                
                   prcFFMPEG.StartInfo = psiProcInfo;          
                   prcFFMPEG.Start();
                   ffReader = prcFFMPEG.StandardError;

                   do
                   {
                       if (Bgw1.CancellationPending)
                       {
                           return;
                       }
                       Button5.Enabled = true;
                       Button3.Enabled = false;
                       strFFOUT = ffReader.ReadLine();                    
                       RichTextBox1.Text = strFFOUT;
                       if (strFFOUT != null)
                       {
                           if (strFFOUT.Contains("frame="))
                           {
                               currentFramestr = strFFOUT.Substring(7, 6).Trim();
                               Regex rx = new Regex(@"^\d+");
                               Match m = rx.Match(currentFramestr);
                               if (m.Success)
                               {
                                   currentFrameInt = System.Convert.ToInt32(m.Value);
                               }
                           }
                       }
                       string percentage = ((double)ProgressBar1.Value / (double)ProgressBar1.Maximum * 100.0).ToString();
                       textBox3.Text = ProgressBar1.Value.ToString();                    
                       ProgressBar1.Maximum = FCount + 1;
                       ProgressBar1.Value = (currentFrameInt);
                       Label12.Text = "Current Encoded Frame: " + currentFrameInt;
                       Label11.Text = percentage;
                   } while (!(prcFFMPEG.HasExited || string.IsNullOrEmpty(strFFOUT)));
               }
               catch(Exception err)
               {
                   string errors = err.ToString();
               }
           }

    psiProcInfo is ProcessStartInfo

    prcFFMPEG is Process

    And this is how it looks like when i play the target the new created converted video file the mp4 the first seconds :

    Duration : 00:02:20

    Width : 1920 Height : 1080

    Data Rate and Total Rate both : 80kbps

    Frame rate : 2 frames/second

    Blurry

    This is the output of the ffmpeg console while converting the file.

     ffmpeg version 2.8.git Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 5.2.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 11.100 / 55. 11.100
     libavcodec     57. 17.100 / 57. 17.100
     libavformat    57. 20.100 / 57. 20.100
     libavdevice    57.  0.100 / 57.  0.100
     libavfilter     6. 21.100 /  6. 21.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    [avi @ 00000147a882b660] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, avi, from 'C:\temp\video\new.avi':
     Duration: 00:02:20.50, start: 0.000000, bitrate: 132710 kb/s
       Stream #0:0: Video: rawvideo, bgra, 1920x1080, 2 fps, 2 tbr, 2 tbn, 2 tbc
    Please use -profile:a or -profile:v, -profile is ambiguous
    Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (C:\temp\video\5.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
    [libx264 @ 00000147a882c820] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 00000147a882c820] profile High, level 4.0
    [libx264 @ 00000147a882c820] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=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_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=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 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=18 ip_ratio=1.40 pb_ratio=1.30 aq=0
    Output #0, mp4, to 'C:\temp\video\5.mp4':
     Metadata:
       encoder         : Lavf57.20.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=-1--1, 2 fps, 16384 tbn, 2 tbc
       Metadata:
         encoder         : Lavc57.17.100 libx264
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame=    8 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   15 fps= 14 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   21 fps= 13 q=18.0 size=      92kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   30 fps= 14 q=18.0 size=     141kB time=00:00:04.50 bitrate= 257.3kbits/s speed=2.03x    
    frame=   37 fps= 13 q=20.0 size=     164kB time=00:00:08.00 bitrate= 167.6kbits/s speed=2.82x    
    frame=   46 fps= 14 q=18.0 size=     185kB time=00:00:12.50 bitrate= 121.0kbits/s speed= 3.7x    
    frame=   51 fps= 13 q=19.0 size=     194kB time=00:00:15.00 bitrate= 106.1kbits/s speed=3.87x    
    frame=   58 fps= 13 q=18.0 size=     210kB time=00:00:18.50 bitrate=  93.2kbits/s speed=4.19x    
    frame=   65 fps= 13 q=20.0 size=     224kB time=00:00:22.00 bitrate=  83.6kbits/s speed=4.46x    
    frame=   71 fps= 13 q=19.0 size=     238kB time=00:00:25.00 bitrate=  78.1kbits/s speed=4.56x    
    frame=   78 fps= 13 q=18.0 size=     253kB time=00:00:28.50 bitrate=  72.6kbits/s speed=4.75x    
    frame=   83 fps= 13 q=19.0 size=     265kB time=00:00:31.00 bitrate=  70.0kbits/s speed= 4.7x    
    frame=   89 fps= 12 q=20.0 size=     280kB time=00:00:34.00 bitrate=  67.4kbits/s speed=4.73x    
    frame=   95 fps= 12 q=19.0 size=     291kB time=00:00:37.00 bitrate=  64.5kbits/s speed=4.73x    
    frame=  102 fps= 12 q=18.0 size=     308kB time=00:00:40.50 bitrate=  62.3kbits/s speed=4.84x    
    frame=  107 fps= 12 q=19.0 size=     317kB time=00:00:43.00 bitrate=  60.4kbits/s speed=4.82x    
    frame=  115 fps= 12 q=19.0 size=     336kB time=00:00:47.00 bitrate=  58.6kbits/s speed=4.96x    
    frame=  123 fps= 12 q=20.0 size=     354kB time=00:00:51.00 bitrate=  56.8kbits/s speed=5.09x    
    frame=  132 fps= 12 q=20.0 size=     371kB time=00:00:55.50 bitrate=  54.8kbits/s speed=5.25x    
    frame=  139 fps= 13 q=20.0 size=     392kB time=00:00:59.00 bitrate=  54.5kbits/s speed=5.32x    
    frame=  146 fps= 13 q=19.0 size=     408kB time=00:01:02.50 bitrate=  53.5kbits/s speed=5.37x    
    frame=  150 fps= 12 q=20.0 size=     417kB time=00:01:04.50 bitrate=  52.9kbits/s speed=5.28x    
    frame=  155 fps= 12 q=18.0 size=     428kB time=00:01:07.00 bitrate=  52.4kbits/s speed=5.25x    
    frame=  161 fps= 12 q=20.0 size=     441kB time=00:01:10.00 bitrate=  51.6kbits/s speed=5.26x    
    frame=  167 fps= 12 q=19.0 size=     462kB time=00:01:13.00 bitrate=  51.9kbits/s speed=5.29x    
    frame=  174 fps= 12 q=20.0 size=     483kB time=00:01:16.50 bitrate=  51.7kbits/s speed=5.33x    
    frame=  181 fps= 12 q=18.0 size=     614kB time=00:01:20.00 bitrate=  62.8kbits/s speed=5.36x    
    frame=  187 fps= 12 q=20.0 size=     763kB time=00:01:23.00 bitrate=  75.3kbits/s speed=5.35x    
    frame=  193 fps= 12 q=19.0 size=     852kB time=00:01:26.00 bitrate=  81.2kbits/s speed=5.36x    
    frame=  199 fps= 12 q=18.0 size=     865kB time=00:01:29.00 bitrate=  79.6kbits/s speed=5.37x    
    frame=  206 fps= 12 q=20.0 size=     932kB time=00:01:32.50 bitrate=  82.6kbits/s speed=5.39x    
    frame=  211 fps= 12 q=20.0 size=     943kB time=00:01:35.00 bitrate=  81.3kbits/s speed=5.38x    
    frame=  217 fps= 12 q=18.0 size=    1007kB time=00:01:38.00 bitrate=  84.1kbits/s speed=5.38x    
    frame=  223 fps= 12 q=20.0 size=    1175kB time=00:01:41.00 bitrate=  95.3kbits/s speed=5.38x    
    frame=  230 fps= 12 q=20.0 size=    1195kB time=00:01:44.50 bitrate=  93.7kbits/s speed=5.42x    
    frame=  235 fps= 12 q=18.0 size=    1205kB time=00:01:47.00 bitrate=  92.3kbits/s speed= 5.4x    
    frame=  241 fps= 12 q=20.0 size=    1222kB time=00:01:50.00 bitrate=  91.0kbits/s speed= 5.4x    
    frame=  247 fps= 12 q=19.0 size=    1232kB time=00:01:53.00 bitrate=  89.3kbits/s speed=5.39x    
    frame=  255 fps= 12 q=19.0 size=    1252kB time=00:01:57.00 bitrate=  87.7kbits/s speed=5.45x    
    frame=  260 fps= 12 q=20.0 size=    1274kB time=00:01:59.50 bitrate=  87.3kbits/s speed=5.44x    
    frame=  267 fps= 12 q=20.0 size=    1287kB time=00:02:03.00 bitrate=  85.7kbits/s speed=5.45x    
    frame=  272 fps= 12 q=18.0 size=    1304kB time=00:02:05.50 bitrate=  85.1kbits/s speed=5.43x    
    frame=  278 fps= 12 q=20.0 size=    1314kB time=00:02:08.50 bitrate=  83.8kbits/s speed=5.41x    
    frame=  281 fps= 12 q=-1.0 Lsize=    1376kB time=00:02:19.50 bitrate=  80.8kbits/s speed=5.76x    
    video:1372kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.299861%
    [libx264 @ 00000147a882c820] frame I:2     Avg QP:15.00  size: 98930
    [libx264 @ 00000147a882c820] frame P:80    Avg QP:18.00  size:  7068
  • ffmpeg conversion using libx264 looks terrible - interlaced

    17 juin 2016, par justin

    I’m in the process of converting some files from my set-top box (.ASF) format to something more portable that will work with plex and roku more readily. In doing so I’m using ffmpeg, but having unsatisfying results. Whereas the original doesn’t have ANY notable interlacing defects, the converted file does. I think it has something to do with the libx264 converter because of the following experiment :

    Running this command :

    ffmpeg -i file.asf -vcodec copy -acodec copy -bsf:a aac_adtstoasc -ss 150 -t 15 short.mp4

    ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
     built with Apple LLVM version 7.3.0 (clang-703.0.29)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
     libavutil      55. 17.103 / 55. 17.103
     libavcodec     57. 24.102 / 57. 24.102
     libavformat    57. 25.100 / 57. 25.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 31.100 /  6. 31.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    [asf @ 0x7f9f84000000] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, asf, from 'file.asf':
     Metadata:
       title           : Slingbox
       artist          : Sling Media
       comment         : test
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: h264 (High) (h264 / 0x34363268), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 30.30 fps, 30 tbr, 1k tbn, 59.94 tbc
       Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 32000 Hz, stereo, fltp, 96 kb/s
       Stream #0:2: Unknown: none
    File 'short.mp4' already exists. Overwrite ? [y/N] y
    Output #0, mp4, to 'short.mp4':
     Metadata:
       title           : Slingbox
       artist          : Sling Media
       comment         : test
       encoder         : Lavf57.25.100
       Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 30.30 fps, 30 tbr, 16k tbn, 1k tbc
       Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 32000 Hz, stereo, 96 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [mp4 @ 0x7f9f8388c200] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    [mp4 @ 0x7f9f8388c200] pts has no value
       Last message repeated 449 times
    frame=  450 fps=0.0 q=-1.0 Lsize=    9002kB time=00:00:15.02 bitrate=4907.9kbits/s speed=92.1x    
    video:8817kB audio:173kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.125406%

    Which produces a file which has no interlacing artifact and appears to be same exact file size as the original (if run without the -ss and -t commands).

    But running this command (without any options) :

    ffmpeg -i test.asf -ss 150 -t 15 short2.mp4

    ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
     built with Apple LLVM version 7.3.0 (clang-703.0.29)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
     libavutil      55. 17.103 / 55. 17.103
     libavcodec     57. 24.102 / 57. 24.102
     libavformat    57. 25.100 / 57. 25.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 31.100 /  6. 31.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    [asf @ 0x7fec32801400] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, asf, from 'test.asf':
     Metadata:
       title           : Slingbox
       artist          : Sling Media
       comment         : test
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: h264 (High) (h264 / 0x34363268), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 30.30 fps, 30 tbr, 1k tbn, 59.94 tbc
       Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 32000 Hz, stereo, fltp, 96 kb/s
       Stream #0:2: Unknown: none
    [libx264 @ 0x7fec32102800] using SAR=1/1
    [libx264 @ 0x7fec32102800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x7fec32102800] profile High, level 4.0
    [libx264 @ 0x7fec32102800] 264 - core 148 r2668 fd2c324 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - - options: cabac=1 ref=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_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'short2.mp4':
     Metadata:
       title           : Slingbox
       artist          : Sling Media
       comment         : test
       encoder         : Lavf57.25.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.24.102 libx264
       Side data:
         unknown side data type 10 (24 bytes)
       Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 32000 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc57.24.102 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    frame=  450 fps= 20 q=-1.0 Lsize=    6732kB time=00:00:15.00 bitrate=3674.9kbits/s speed=0.657x    
    video:6481kB audio:240kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.168370%
    [libx264 @ 0x7fec32102800] frame I:12    Avg QP:18.85  size: 39804
    [libx264 @ 0x7fec32102800] frame P:291   Avg QP:21.40  size: 17543
    [libx264 @ 0x7fec32102800] frame B:147   Avg QP:22.61  size:  7167
    [libx264 @ 0x7fec32102800] consecutive B-frames: 42.9% 36.9% 11.3%  8.9%
    [libx264 @ 0x7fec32102800] mb I  I16..4: 43.2% 52.0%  4.8%
    [libx264 @ 0x7fec32102800] mb P  I16..4: 11.9% 16.0%  1.0%  P16..4: 30.2%  3.0%  1.7%  0.0%  0.0%    skip:36.2%
    [libx264 @ 0x7fec32102800] mb B  I16..4:  0.6%  0.9%  0.1%  B16..8: 25.7%  1.4%  0.2%  direct: 4.6%  skip:66.6%  L0:49.0% L1:49.4% BI: 1.6%
    [libx264 @ 0x7fec32102800] 8x8 transform intra:55.1% inter:92.0%
    [libx264 @ 0x7fec32102800] coded y,uvDC,uvAC intra: 22.5% 38.6% 6.6% inter: 6.5% 17.3% 0.5%
    [libx264 @ 0x7fec32102800] i16 v,h,dc,p: 28% 47%  8% 17%
    [libx264 @ 0x7fec32102800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 15% 42%  1%  1%  2%  1%  2%  1%
    [libx264 @ 0x7fec32102800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 78%  6%  1%  1%  1%  1%  1%  1%
    [libx264 @ 0x7fec32102800] i8c dc,h,v,p: 59% 19% 19%  3%
    [libx264 @ 0x7fec32102800] Weighted P-Frames: Y:14.4% UV:3.8%
    [libx264 @ 0x7fec32102800] ref P L0: 65.5%  6.6% 19.0%  8.4%  0.4%
    [libx264 @ 0x7fec32102800] ref B L0: 89.6%  8.9%  1.5%
    [libx264 @ 0x7fec32102800] ref B L1: 98.6%  1.4%
    [libx264 @ 0x7fec32102800] kb/s:3539.34
    [aac @ 0x7fec32103a00] Qavg: 573.580

    Produces a file which has quite a bit of interlacing defect when playing on my HD projector thru Roku via Plex (direct play enabled, apparently no transcoding).

    still frame from second transcode showing visual defect

    Lest I be overly picky, I engaged my wife in this test, showing her the two files and she agreed that the one that used libx264 was significantly worse and unwatchable. Can’t figure out how to shrink this file down without causing these interlacing defects — it happens even when I don’t try to shrink it ! Any thoughts ?

    Video files :

    https://dl.dropboxusercontent.com/u/23091/m1/short.mp4
    https://dl.dropboxusercontent.com/u/23091/m1/short2.mp4

    Update : Additionally, I tried a few settings to generate a MPEG4 (.AVI) file and had similar lack of success. Similar interlacing defects.