Recherche avancée

Médias (0)

Mot : - Tags -/upload

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

Autres articles (77)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

Sur d’autres sites (8718)

  • FFMPEG scale and crop in single command

    26 mars 2016, par The Hungry Androider

    I’m using FFMPEG on Android using the following lib : http://writingminds.github.io/ffmpeg-android-java/

    This is the command I’m using :

    "-i " + path + " -vf scale=480:360,crop=360:360:0:00 -strict -2  -preset ultrafast " + fileOutPath

    My goal of this is to scale the image down to 480x360, then crop it to 360x360 from (0,0) (top left corner). HOWEVER, what ends up happening is that it crops from the vertical-center. So for example if you were to take a vide of three blocks on top of each other filling the entire screen, the crop would eventually show just the middle block, whereas I desire the top block.

    Any ideas as to what I’m doing wrong ?

    My ultimate goal from all of this is to get a square video of size 360x360.

    Output log :

    03-26 12:10:16.816 17198-17198/com.noq D/FFMPEG: FFMPEG onStart
    03-26 12:10:16.900 17198-17385/com.noq D/FFmpeg: Running publishing updates method
    03-26 12:10:16.914 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: WARNING: linker: /data/user/0/com.noq/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
    03-26 12:10:17.004 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
    03-26 12:10:17.004 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   built on Oct  7 2014 15:08:46 with gcc 4.8 (GCC)
    03-26 12:10:17.007 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
    03-26 12:10:17.021 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libavutil      54.  7.100 / 54.  7.100
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libavcodec     56.  1.100 / 56.  1.100
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libavformat    56.  4.101 / 56.  4.101
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libavdevice    56.  0.100 / 56.  0.100
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libavfilter     5.  1.100 /  5.  1.100
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libswscale      3.  0.100 /  3.  0.100
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libswresample   1.  1.100 /  1.  1.100
    03-26 12:10:17.022 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   libpostproc    53.  0.100 / 53.  0.100
    03-26 12:10:17.201 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/data/com.noq/files/Pictures/noq/1459008610063.mp4':
    03-26 12:10:17.201 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   Metadata:
    03-26 12:10:17.201 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     major_brand     : mp42
    03-26 12:10:17.201 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     minor_version   : 0
    03-26 12:10:17.201 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     compatible_brands: isommp42
    03-26 12:10:17.201 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     creation_time   : 2016-03-26 16:10:16
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   Duration: 00:00:02.02, start: 0.000000, bitrate: 6131 kb/s
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480, 5926 kb/s, SAR 65536:65536 DAR 4:3, 29.87 fps, 30.17 tbr, 90k tbn, 180k tbc (default)
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Metadata:
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       rotate          : 270
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       creation_time   : 2016-03-26 16:10:16
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       handler_name    : VideoHandle
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       encoder         : MOTO
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Side data:
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       displaymatrix: rotation of 90.00 degrees
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s (default)
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Metadata:
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       creation_time   : 2016-03-26 16:10:16
    03-26 12:10:17.202 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       handler_name    : SoundHandle
    03-26 12:10:17.263 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] using SAR=1/1
    03-26 12:10:17.297 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] using cpu capabilities: none!
    03-26 12:10:17.411 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] profile Constrained Baseline, level 2.1
    03-26 12:10:17.417 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
    03-26 12:10:17.464 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: Output #0, mp4, to '/storage/emulated/0/Android/data/com.noq/files/Pictures/noq/14590086100631459008616802_square.mp4':
    03-26 12:10:17.464 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   Metadata:
    03-26 12:10:17.464 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     major_brand     : mp42
    03-26 12:10:17.464 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     minor_version   : 0
    03-26 12:10:17.464 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     compatible_brands: isommp42
    03-26 12:10:17.464 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     encoder         : Lavf56.4.101
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 360x360 [SAR 1:1 DAR 1:1], q=-1--1, 30.17 fps, 11584 tbn, 30.17 tbc (default)
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Metadata:
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       rotate          : 270
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       creation_time   : 2016-03-26 16:10:16
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       handler_name    : VideoHandle
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       encoder         : Lavc56.1.100 libx264
    03-26 12:10:17.465 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
    03-26 12:10:17.466 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:     Metadata:
    03-26 12:10:17.466 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       creation_time   : 2016-03-26 16:10:16
    03-26 12:10:17.466 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       handler_name    : SoundHandle
    03-26 12:10:17.467 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:       encoder         : Lavc56.1.100 aac
    03-26 12:10:17.467 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: Stream mapping:
    03-26 12:10:17.467 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    03-26 12:10:17.467 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress:   Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    03-26 12:10:17.468 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: Press [q] to stop, [?] for help
    03-26 12:10:18.035 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: frame=    3 fps=0.0 q=0.0 size=       0kB time=00:00:01.00 bitrate=   0.4kbits/s dup=1 drop=0    
    03-26 12:10:18.526 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: frame=   21 fps= 20 q=24.0 size=      48kB time=00:00:01.00 bitrate= 390.3kbits/s dup=1 drop=0    
    03-26 12:10:19.008 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: frame=   26 fps= 17 q=25.0 size=      68kB time=00:00:01.85 bitrate= 301.1kbits/s dup=1 drop=0    
    03-26 12:10:19.533 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: frame=   47 fps= 23 q=23.0 size=     165kB time=00:00:01.87 bitrate= 719.7kbits/s dup=1 drop=0    
    03-26 12:10:19.956 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: frame=   62 fps= 25 q=-1.0 Lsize=     297kB time=00:00:02.05 bitrate=1184.9kbits/s dup=1 drop=0    
    03-26 12:10:19.956 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: video:262kB audio:33kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.992648%
    03-26 12:10:19.984 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] frame I:1     Avg QP:20.00  size: 18507
    03-26 12:10:19.984 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] frame P:61    Avg QP:23.52  size:  4079
    03-26 12:10:19.984 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] mb I  I16..4: 100.0%  0.0%  0.0%
    03-26 12:10:19.984 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] mb P  I16..4:  4.4%  0.0%  0.0%  P16..4: 70.9%  0.0%  0.0%  0.0%  0.0%    skip:24.7%
    03-26 12:10:19.985 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] coded y,uvDC,uvAC intra: 44.6% 40.1% 14.8% inter: 39.1% 32.7% 0.6%
    03-26 12:10:19.985 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] i16 v,h,dc,p: 42% 24% 21% 13%
    03-26 12:10:19.986 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] i8c dc,h,v,p: 44% 24% 25%  8%
    03-26 12:10:19.987 17198-17198/com.noq D/FFMPEG: FFMPEG onProgress: [libx264 @ 0xb78cde30] kb/s:1040.60
    03-26 12:10:20.002 17198-17198/com.noq D/FFMPEG: FFMPEG onSuccess: WARNING: linker: /data/user/0/com.noq/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
                                                    ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
                                                      built on Oct  7 2014 15:08:46 with gcc 4.8 (GCC)
                                                      configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
                                                      libavutil      54.  7.100 / 54.  7.100
                                                      libavcodec     56.  1.100 / 56.  1.100
                                                      libavformat    56.  4.101 / 56.  4.101
                                                      libavdevice    56.  0.100 / 56.  0.100
                                                      libavfilter     5.  1.100 /  5.  1.100
                                                      libswscale      3.  0.100 /  3.  0.100
                                                      libswresample   1.  1.100 /  1.  1.100
                                                      libpostproc    53.  0.100 / 53.  0.100
                                                    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/data/com.noq/files/Pictures/noq/1459008610063.mp4':
                                                      Metadata:
                                                        major_brand     : mp42
                                                        minor_version   : 0
                                                        compatible_brands: isommp42
                                                        creation_time   : 2016-03-26 16:10:16
                                                      Duration: 00:00:02.02, start: 0.000000, bitrate: 6131 kb/s
                                                        Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480, 5926 kb/s, SAR 65536:65536 DAR 4:3, 29.87 fps, 30.17 tbr, 90k tbn, 180k tbc (default)
                                                        Metadata:
                                                          rotate          : 270
                                                          creation_time   : 2016-03-26 16:10:16
                                                          handler_name    : VideoHandle
                                                          encoder         : MOTO
                                                        Side data:
                                                          displaymatrix: rotation of 90.00 degrees
                                                        Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s (default)
                                                        Metadata:
                                                          creation_time   : 2016-03-26 16:10:16
                                                          handler_name    : SoundHandle
                                                    [libx264 @ 0xb78cde30] using SAR=1/1
                                                    [libx264 @ 0xb78cde30] using cpu capabilities: none!
                                                    [libx264 @ 0xb78cde30] profile Constrained Baseline, level 2.1
                                                    [libx264 @ 0xb78cde30] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
                                                    Output #0, mp4, to '/storage/emulated/0/Android/data/com.noq/files/Pictures/noq/14590086100631459008616802_square.mp4':
                                                      Metadata:
                                                        major_brand     : mp42
                                                        minor_version   : 0
                                                        compatible_brands: isommp42
                                                        encoder         : Lavf56.4.101
                                                        Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 360x360 [SAR 1:1 DAR 1:1], q=-1--1, 30.17 fps, 11584 tbn, 30.17 tbc (default)
                                                        Metadata:
                                                          rotate          : 270
                                                          creation_time   : 2016-03-26 16:10:16
                                                          handler_name    : VideoHandle
                                                          encoder         : Lavc56.1.100 libx264
                                                        Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
                                                        Metadata:
                                                          creation_time   : 2016-03-26 16:10:16
                                                          handler_name    : SoundHandle
                                                          encoder         : La
    03-26 12:10:20.037 17198-17198/com.noq D/FFMPEG: FFMPEG onFinish
  • ffmpeg concat + scale2ref, reduced framerate

    15 décembre 2020, par Erwan Douaille

    I would like to concatenate multiple videos with differents aspect ratio, framerates, etc.
The working solution is scale2ref option with black background, no re-scale and concat.

    


    If I use my command line with movie1.mp4 (30fps 1920x1080 2sec) and movie2.mp4 (25fps 800x600 3sec) I except a final output at 25fps 1920x1080 5sec. This part works well.

    


    Then if I use my command line with movie1.mp4 (30fps 1920x1080 2sec) and movie2.mp4 (30fps 1920x1080 3sec) I except a final output at 30fps 1920x1080 5sec. But for an unknown reason my final output is 25fps 1920x1080 5 sec.

    


    I tried with a copy of movie1.mp4 and rename it to movie2.mp4 to ensure they are both perfectly identical and got the same issue.

    


    Input #0, lavfi, from 'color':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from './1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:02.47, start: 0.000000, bitrate: 6737 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 6567 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from './2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:02.47, start: 0.000000, bitrate: 6737 kb/s
    Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 6567 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #2:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    Output file :

    


    [libx264 @ 000001a689d44180] using SAR=1/1
[libx264 @ 000001a689d44180] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001a689d44180] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 000001a689d44180] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=24 lookahead_threads=4 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 './out.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.54.100 aac
frame=  124 fps= 72 q=-1.0 Lsize=    3842kB time=00:00:04.84 bitrate=6502.6kbits/s speed=2.79x


    


    Here is my command line :

    


    ffmpeg -y -f lavfi -i color -i ./1.mp4 -i ./2.mp4 -filter_complex_script ./3.txt  ./out.mp4


    


    The content of filter comple script :

    


    [0][1]scale2ref[canvas][vid1];[canvas][2]scale2ref='max(iw,main_w)':'max(ih,main_h)'[canvas][vid2];[canvas]split=2[canvas1][canvas2];[canvas1][vid1]overlay=x='(W-w)/2':y='(H-h)/2':shortest=1[vid1];[canvas2][vid2]overlay=x='(W-w)/2':y='(H-h)/2':shortest=1[vid2];[vid1][vid2]concat=n=2:v=1,setsar=1


    


    I´m quite sure it´s related to the lavfi input but I don´t know how to enforce it to be the best framerate available.

    


    Is it possible to enforce the "best" framerate available ?
Something like :

    


      

    • 30fps + 30fps = 30fps
    • 


    • 25fps + 25fps = 25fps
    • 


    • 25fps + 30fps = 30fps (or maybe 25 with perfect down sampling for the 30fps video)
    • 


    


    My ffmpeg commands are programmaticaly generated. Any automatic solution is prefered.

    


  • h.264 lossless video in python with ffmpeg

    7 mars 2015, par Ojtwist

    I have raw video files which I encoded via ffmpeg (lossless) :

    ffmpeg -i test.avi -c:v libx264 -preset veryslow -crf 0 output.mkv

    Now I tried to read these in python :

       FFMPEG_BIN = "ffmpeg"

       command = [FFMPEG_BIN,
                      '-i',path,
                      '-f', 'image2pipe',
                      '-pix_fmt','yuv444p',
                      '-r',framerate,
                      '-ss',startposition,
                      '-vcodec','rawvideo','-']

       pipe = sp.Popen(command,stdout=sp.PIPE,bufsize=10**8)

       while True:
           raw_image = pipe.stdout.read(640*480*3)

           image = np.fromstring(raw_image,dtype='uint8')

           image = image.reshape((480,640,3))

    I can’t find the good command to get the video lossless in python. If I try it as mentioned above and show it with matplotlib, I get :
    enter image description here

    If I set -vcodec to libx264 I get noise.

    enter image description here

    If i set -pix_fmt to rgb24, I get a normal looking image, but I can see some artifact due to the color conversion.

    What is the command I am looking for ?


    extra info, the output of the encoding (initial raw video ==> lossless h.264) :

    worker@worklati:~/data/DMG/test$ ffmpeg -i test.avi -c:v libx264 -preset veryslow -crf 0 output.mkv
    ffmpeg version 2.5.3 Copyright (c) 2000-2015 the FFmpeg developers
     built on Jan 11 2015 17:53:45 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, avi, from 'test.avi':
     Duration: 00:10:25.17, start: 0.000000, bitrate: 44237 kb/s
       Stream #0:0: Video: rawvideo, bgr24, 640x480, 6 fps, 6 tbr, 6 tbn, 6 tbc
    File 'output.mkv' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x1fd7160] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x1fd7160] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-bit
    [libx264 @ 0x1fd7160] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=9 psy=0 mixed_ref=1 me_range=24 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=6 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
    Output #0, matroska, to 'output.mkv':
     Metadata:
       encoder         : Lavf56.15.102
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 640x480, q=-1--1, 6 fps, 1k tbn, 6 tbc
       Metadata:
         encoder         : Lavc56.13.100 libx264
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame= 3751 fps= 40 q=-1.0 Lsize=  133724kB time=00:10:25.16 bitrate=1752.3kbits/s    
    video:133691kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.024307%
    [libx264 @ 0x1fd7160] frame I:16    Avg QP: 0.00  size: 58298
    [libx264 @ 0x1fd7160] frame P:3735  Avg QP: 0.00  size: 36403
    [libx264 @ 0x1fd7160] mb I  I16..4: 65.3%  6.9% 27.7%
    [libx264 @ 0x1fd7160] mb P  I16..4:  3.0%  2.1%  0.2%  P16..4: 71.2%  0.8% 22.4%  0.0%  0.0%    skip: 0.1%
    [libx264 @ 0x1fd7160] 8x8 transform intra:36.9% inter:49.5%
    [libx264 @ 0x1fd7160] coded y,u,v intra: 79.3% 0.0% 0.0% inter: 97.6% 0.0% 0.0%
    [libx264 @ 0x1fd7160] i16 v,h,dc,p: 20%  3% 76%  1%
    [libx264 @ 0x1fd7160] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  5%  8% 80%  1%  1%  2%  1%  1%  1%
    [libx264 @ 0x1fd7160] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 28% 16%  5%  7%  8%  5%  4%  5%
    [libx264 @ 0x1fd7160] Weighted P-Frames: Y:0.2% UV:0.0%
    [libx264 @ 0x1fd7160] ref P L0: 63.2%  0.0% 14.2%  5.3%  4.0%  3.2%  2.6%  1.1%  1.0%  1.0%  0.9%  1.1%  0.7%  0.6%  0.6%  0.6%
    [libx264 @ 0x1fd7160] kb/s:1751.85