Recherche avancée

Médias (91)

Autres articles (31)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

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

Sur d’autres sites (8551)

  • To concatenate more than two video using FFMPEG

    21 décembre 2018, par Alok Kumar Verma

    I’ve been working on FFMPEG, this is indeed not an easy task since I’ve succeeded in doing some work. I’m done with concatenating two videos using ffmpeg but somehow when it comes to more than two it does not work. So I’m finding out some command to do my task.

    The thing I did is to merge two videos are :

    String complexCommand[] = {"-y", "-i", "/mnt/m_external_sd/Videos/VID-20161221-WA0000.mp4", "-i", "/mnt/m_external_sd/Videos/Brodha V - Aathma Raama [Music Video]_HD.mp4", "-strict", "experimental", "-filter_complex",
                "[0:v]scale=1920x1080,setsar=1:1[v0];[1:v] scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
                "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "1920x1080", "-vcodec", "libx264","-crf","27","-q","4","-preset", "ultrafast", savingPath};

    The above is working fine for two videos. I’ve tried altering my code for three videos but it does not work.

    What I’ve done in the above code is :

    • Added one more input after the second one
    • Changed the concat=3:v=1:a=1

    But it does not merge and gave me this error in my LogCat :

    FAILED with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
                                                          built with gcc 4.8 (GCC)
                                                          configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --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/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/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=
                                                          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
                                                          libswscale      4.  0.100 /  4.  0.100
                                                          libswresample   2.  0.101 /  2.  0.101
                                                          libpostproc    54.  0.100 / 54.  0.100
                                                        Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/m_external_sd/Videos/VID-20161221-WA0000.mp4':
                                                          Metadata:
                                                            major_brand     : isom
                                                            minor_version   : 512
                                                            compatible_brands: isomiso2avc1mp41
                                                            encoder         : Lavf57.25.100
                                                          Duration: 00:02:47.09, start: 0.000000, bitrate: 245 kb/s
                                                            Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 112 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)
                                                            Metadata:
                                                              handler_name    : VideoHandler
                                                            Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
                                                            Metadata:
                                                              handler_name    : SoundHandler
                                                        Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/m_external_sd/Videos/Brodha V - Aathma Raama [Music Video]_HD.mp4':
                                                          Metadata:
                                                            major_brand     : mp42
                                                            minor_version   : 0
                                                            compatible_brands: isommp42
                                                            creation_time   : 2013-12-15 13:11:41
                                                          Duration: 00:03:51.08, start: 0.000000, bitrate: 1693 kb/s
                                                            Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1498 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc (default)
                                                            Metadata:
                                                              handler_name    : VideoHandler
                                                            Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
                                                            Metadata:
                                                              creation_time   : 2013-12-15 13:11:41
                                                              handler_name    : IsoMedia File Produced by Google, 5-11-2011
                                                        Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/m_external_sd/DCIM/Sinha's POP/20150530_073113.mp4':
                                                          Metadata:
                                                            major_brand     : isom
                                                            minor_version   : 0
                                                            compatible_brands: isom3gp4
                                                            creation_time   : 2015-05-30 02:06:06
                                                          Duration: 00:04:48.48, start: 0.000000, bitrate: 3608 kb/s
                                                            Stream #2:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 720x480, 3478 kb/s, 30.28 fps, 30 tbr, 90k tbn, 180k tbc (default)
                                                            Metadata:
                                                              creation_time   : 2015-05-30 02:06:06
                                                              handler_name    : VideoHandle
                                                              encoder         :                                
                                                            Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 125 kb/s (default)
                                                            Metadata:
                                                              creation_time   : 2015-05-30 02:06:06
                                                              handler_name    : SoundHandle
                                                        [Parsed_setsar_1 @ 0xa9ea9220] num:den syntax is deprecated, please use num/den or named options instead
                                                        [Parsed_setsar_4 @ 0xa9ea9310] num:den syntax is deprecated, please use num/den or named options instead
                                                        [Parsed_setsar_1 @ 0xa9ea92c0] num:den syntax is deprecated, please use num/den or named options instead
                                                        [Parsed_setsar_4 @ 0xa9ea93b0] num:den syntax is deprecated, please us

    I’ve tried one more command which works fine for concatenating two videos but still it does not work for more than two videos :

    String complexCommand[] = {"-y", "-i", "/mnt/m_external_sd/Videos/VID-20161221-WA0000.mp4", "-i", "/mnt/m_external_sd/Videos/Brodha V - Aathma Raama [Music Video]_HD.mp4", "-i", "/mnt/m_external_sd/DCIM/Sinha's POP/20150530_073113.mp4", "-strict", "experimental", "-filter_complex",
               "[0:v]scale=480x640,setsar=1:1[v0];[1:v]scale=480x640,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=3:v=1:a=1",
               "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "480x640", "-vcodec", "libx264","-crf","27","-q","4","-preset", "ultrafast", savingPath};

    You can clearly see in the above code that I’ve tried using this for the three videos but still no luck. Will appreciate your help. Thanks.

    EDITS

    After following the LordNeckbeard’s suggestion from the comment section, I’ve used his suggestion in my code but after doing that still no luck however the console’s output got changed and here is the command which I used :

    String complexCommand[] = {"-y", "-i", "/mnt/m_external_sd/Videos/VID-20161221-WA0000.mp4", "-i", "/mnt/m_external_sd/Videos/Brodha V - Aathma Raama [Music Video]_HD.mp4", "-i", "/mnt/m_external_sd/DCIM/Sinha's POP/20150530_073113.mp4", "-strict", "experimental", "-filter_complex",
               "[0:v]scale=480x640,setsar=1[v0];[1:v]scale=480x640,setsar=1[v1];[v0][0:a][v1][1:a] concat=n=3:v=1:a=1",
               "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "480x640", "-vcodec", "libx264","-crf","27","-preset", "ultrafast", savingPath};

    Here you can clearly see that I’ve used setsar=1 and used -crf only.

    And the logs are :

    FAILED with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
                                                            built with gcc 4.8 (GCC)
                                                            configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --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/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/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=
                                                            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
                                                            libswscale      4.  0.100 /  4.  0.100
                                                            libswresample   2.  0.101 /  2.  0.101
                                                            libpostproc    54.  0.100 / 54.  0.100
                                                          Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/m_external_sd/Videos/VID-20161221-WA0000.mp4':
                                                            Metadata:
                                                              major_brand     : isom
                                                              minor_version   : 512
                                                              compatible_brands: isomiso2avc1mp41
                                                              encoder         : Lavf57.25.100
                                                            Duration: 00:02:47.09, start: 0.000000, bitrate: 245 kb/s
                                                              Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 112 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)
                                                              Metadata:
                                                                handler_name    : VideoHandler
                                                              Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
                                                              Metadata:
                                                                handler_name    : SoundHandler
                                                          Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/m_external_sd/Videos/Brodha V - Aathma Raama [Music Video]_HD.mp4':
                                                            Metadata:
                                                              major_brand     : mp42
                                                              minor_version   : 0
                                                              compatible_brands: isommp42
                                                              creation_time   : 2013-12-15 13:11:41
                                                            Duration: 00:03:51.08, start: 0.000000, bitrate: 1693 kb/s
                                                              Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1498 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc (default)
                                                              Metadata:
                                                                handler_name    : VideoHandler
                                                              Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
                                                              Metadata:
                                                                creation_time   : 2013-12-15 13:11:41
                                                                handler_name    : IsoMedia File Produced by Google, 5-11-2011
                                                          Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/m_external_sd/DCIM/Sinha's POP/20150530_073113.mp4':
                                                            Metadata:
                                                              major_brand     : isom
                                                              minor_version   : 0
                                                              compatible_brands: isom3gp4
                                                              creation_time   : 2015-05-30 02:06:06
                                                            Duration: 00:04:48.48, start: 0.000000, bitrate: 3608 kb/s
                                                              Stream #2:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 720x480, 3478 kb/s, 30.28 fps, 30 tbr, 90k tbn, 180k tbc (default)
                                                              Metadata:
                                                                creation_time   : 2015-05-30 02:06:06
                                                                handler_name    : VideoHandle
                                                                encoder         :                                
                                                              Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 125 kb/s (default)
                                                              Metadata:
                                                                creation_time   : 2015-05-30 02:06:06
                                                                handler_name    : SoundHandle
                                                          [Parsed_concat_4 @ 0xa7ea91d0] Input link in2:v0 parameters (size 720x480, SAR 0:1) do not match the corresponding output link in0:v0 parameters (480x640, SAR 1:1)
                                                          [Parsed_concat_4 @ 0xa7ea91d0] Failed to configure output pad on Parsed_concat_4
                                                          Error configuring complex filters.
                                                          Invalid argument

    NOTE : I have tried using setsar=1/1 but still got the same result.

  • ffmpeg pipe webcam stream input to two outputs image and video with audio included

    23 septembre 2017, par Arianna Gomez Vargas

    I have the next command :

    sudo ffmpeg -ar 44100 -ac 2 -f alsa -i hw:1,0 -f v4l2 -codec:v h264       -codec:a aac -ab 128k -framerate 30 -video_size hd720 -itsoffset 0.5 -i /dev/video0 -vf fps=1 snapsh%d.png -f mpeg -b:v 5000k -copyinkf -codec:v copy -codec:a aac -ab 128k -g 10 - | sudo ffmpeg -y -i - out.mp4

    and the objetive it is record audio and video simultaneously, and pipe the output to be capable to take screnshots of the output video. I’m using a logitech webcam, raspberry pi 3, the last version of ffmpeg with h264 and alsa support.

    But it is not working for me :(, I think that the problem it is enconding the audio stream, but I can find a solution yet.
    Someone have any suggest ? Thanks

    This is the output

    ffmpeg version N-86204-g8794cfb Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 4.9.2 (Raspbian 4.9.2-10)
    configuration: --enable-nonfree --enable-gpl --enable-libx264 --enable-libfdk-aac
    libavutil 55. 63.100 / 55. 63.100
    libavcodec 57. 96.101 / 57. 96.101
    libavformat 57. 72.101 / 57. 72.101
    libavdevice 57. 7.100 / 57. 7.100
    libavfilter 6. 90.100 / 6. 90.100
    libswscale 4. 7.101 / 4. 7.101
    libswresample 2. 8.100 / 2. 8.100
    libpostproc 54. 6.100 / 54. 6.100
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, alsa, from 'hw:1,0':
    Duration: N/A, start: 1506129856.832380, bitrate: 1024 kb/s
    Stream #0:0: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
    Input #1, video4linux2,v4l2, from '/dev/video0':
    Duration: N/A, start: 1821.745623, bitrate: N/A
    Stream #1:0: Video: h264 (Constrained Baseline), yuvj420p(pc, progressive), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 1000k tbn, 60 tbc
    Stream mapping:
    Stream #1:0 -> #0:0 (h264 (native) -> png (native))
    Stream #1:0 -> #1:0 (copy)
    Stream #0:0 -> #1:1 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    [video4linux2,v4l2 @ 0x23a2710] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [swscaler @ 0x25d4f40] deprecated pixel format used, make sure you did set range correctly
    [swscaler @ 0x25d4f40] No accelerated colorspace conversion found from yuv420p to rgb24.
    Output #0, image2, to '/home/pi/proyecto-aula-master/Videos/snapsh%d.png':
    Metadata:
    encoder : Lavf57.72.101
    Stream #0:0: Video: png, rgb24, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc
    Metadata:
    encoder : Lavc57.96.101 png
    [alsa @ 0x23904f0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [mpeg @ 0x23a48d0] VBV buffer size not set, using default size of 130KB
    If you want the mpeg file to be compliant to some specification
    Like DVD, VCD or others, make sure you set the correct buffer size
    Output #1, mpeg, to 'pipe:':
    Metadata:
    encoder : Lavf57.72.101
    Stream #1:0: Video: h264 (Constrained Baseline), yuvj420p(pc, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 5000 kb/s, 30 fps, 30 tbr, 90k tbn, 30 tbc
    Stream #1:1: Audio: aac (LC), 32000 Hz, stereo, fltp, 128 kb/s
    Metadata:
    encoder : Lavc57.96.101 aac
    [mpeg @ 0x23a48d0] Non-monotonous DTS in output stream 1:0; previous: 45000, current: 29998; changing to 45001. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x23a48d0] Non-monotonous DTS in output stream 1:0; previous: 45001, current: 32879; changing to 45002. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x23a48d0] Non-monotonous DTS in output stream 1:0; previous: 45002, current: 35759; changing to 45003. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x23a48d0] Non-monotonous DTS in output stream 1:0; previous: 45003, current: 38999; changing to 45004. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x23a48d0] Non-monotonous DTS in output stream 1:0; previous: 45004, current: 41880; changing to 45005. This may result in incorrect timestamps in the output file.
    [mpeg @ 0x23a48d0] Non-monotonous DTS in output stream 1:0; previous: 45005, current: 44759; changing to 45006. This may result in incorrect timestamps in the output file.
    frame= 0 fps=0.0 q=0.0 q=-1.0 size=N/A time=00:00:01.09 bitrate=N/A speed=2.0frame= 2 fps=1.8 q=0.0 q=-1.0 size=N/A time=00:00:01.76 bitrate=N/A dup=1 dro[alsa @ 0x23904f0] ALSA buffer xrun.
    frame= 3 fps=1.8 q=-0.0 q=-1.0 size=N/A time=00:00:02.19 bitrate=N/A dup=1 drframe= 3 fps=1.4 q=-0.0 q=-1.0 size=N/A time=00:00:02.86 bitrate=N/A dup=1 drframe= 4 fps=1.5 q=-0.0 q=-1.0 size=N/A time=00:00:03.36 bitrate=N/A dup=1 drframe= 4 fps=1.3 q=-0.0 q=-1.0 size=N/A time=00:00:03.86 bitrate=N/A dup=1 drframe= 5 fps=1.4 q=-0.0 q=-1.0 size=N/A time=00:00:04.36 bitrate=N/A dup=1 drframe= 5 fps=1.2 q=-0.0 q=-1.0 size=N/A time=00:00:04.86 bitrate=N/A dup=1 dr[alsa @ 0x23904f0] ALSA buffer xrun.
    [mp2 @ 0x262b660] Header missing
    frame= 6 fps=1.2 q=-0.0 q=-1.0 size=N/A time=00:00:05.38 bitrate=N/A dup=1 drframe= 7 fps=1.3 q=-0.0 q=-1.0 size=N/A time=00:00:06.16 bitrate=N/A dup=1 drframe= 7 fps=1.2 q=-0.0 q=-1.0 size=N/A time=00:00:06.79 bitrate=N/A dup=1 drframe= 8 fps=1.2 q=-0.0 q=-1.0 size=N/A time=00:00:07.29 bitrate=N/A dup=1 drframe= 8 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:07.79 bitrate=N/A dup=1 dr[alsa @ 0x23904f0] ALSA buffer xrun.
    frame= 9 fps=1.2 q=-0.0 q=-1.0 size=N/A time=00:00:08.16 bitrate=N/A dup=1 dr[mpeg @ 0x262a1c0] DTS discontinuity in stream 1: packet 6 with DTS 92886, packet 7 with DTS 95880
    frame= 9 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:08.38 bitrate=N/A dup=1 drframe= 10 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:09.19 bitrate=N/A dup=1 drframe= 10 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:09.96 bitrate=N/A dup=1 drframe= 11 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:10.39 bitrate=N/A dup=1 drframe= 11 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:10.96 bitrate=N/A dup=1 dr[alsa @ 0x23904f0] ALSA buffer xrun.
    frame= 12 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:11.40 bitrate=N/A dup=1 drframe= 12 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:12.06 bitrate=N/A dup=1 drframe= 13 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:12.56 bitrate=N/A dup=1 drframe= 13 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:13.06 bitrate=N/A dup=1 drframe= 14 fps=1.1 q=-0.0 q=-1.0 size=N/A time=00:00:13.56 bitrate=N/A dup=1 drframe= 14 fps=1.0 q=-0.0 q=-1.0 size=N/A time=00:00:14.06 bitrate=N/A dup=1 dr[alsa @ 0x23904f0] ALSA buffer xrun.
    [mpeg @ 0x262a1c0] decoding for stream 0 failed
    [mpeg @ 0x262a1c0] Could not find codec parameters for stream 0 (Audio: mp2, 0 channels, s16p): unspecified frame size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpeg, from 'pipe:':
    Duration: N/A, start: 0.500000, bitrate: N/A
    Stream #0:0[0x1c0]: Audio: mp2, 0 channels, s16p
    Stream #0:1[0x1e2]: Video: h264 (Constrained Baseline), yuvj420p(pc, progressive), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
    Stream mapping:
    Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
    Stream #0:0 -> #0:1 (mp2 (native) -> aac (native))
    [mp2 @ 0x262cde0] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    No pixel format specified, yuvj420p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x26417d0] using SAR=1/1
    [libx264 @ 0x26417d0] using cpu capabilities: ARMv6 NEON
    [libx264 @ 0x26417d0] profile High, level 3.1
    [libx264 @ 0x26417d0] 264 - core 150 r2833 df79067 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=6 lookahead_threads=1 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
    frame= 19 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 36 fps= 34 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 47 fps=9.5 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 52 fps=9.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 56 fps=9.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 60 fps=8.8 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 64 fps=8.6 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 69 fps=7.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 71 fps=7.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 73 fps=6.9 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 76 fps=6.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 80 fps=6.3 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 82 fps=5.8 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 85 fps=5.8 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 87 fps=5.7 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 89 fps=5.4 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 90 fps=5.3 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 93 fps=5.3 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 95 fps=5.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 97 fps=5.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 99 fps=5.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 102 fps=5.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 103 fps=4.9 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 105 fps=4.7 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 108 fps=4.7 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 110 fps=4.7 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 112 fps=4.6 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 114 fps=4.5 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 117 fps=4.5 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 120 fps=4.5 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 122 fps=4.4 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 123 fps=4.4 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 126 fps=4.3 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 128 fps=4.3 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 130 fps=4.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 132 fps=4.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 135 fps=4.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbframe= 138 fps=4.2 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbToo many packets buffered for output stream 0:0.
    [libx264 @ 0x26417d0] frame I:1 Avg QP:16.64 size: 29761
    [libx264 @ 0x26417d0] frame P:36 Avg QP:21.71 size: 9196
    [libx264 @ 0x26417d0] frame B:92 Avg QP:24.13 size: 4641
    [libx264 @ 0x26417d0] consecutive B-frames: 0.8% 0.0% 32.1% 67.2%
    [libx264 @ 0x26417d0] mb I I16..4: 24.3% 49.7% 25.9%
    [libx264 @ 0x26417d0] mb P I16..4: 11.2% 10.0% 0.2% P16..4: 41.0% 6.2% 3.7% 0.0% 0.0% skip:27.7%
    [libx264 @ 0x26417d0] mb B I16..4: 5.0% 5.5% 0.0% B16..8: 40.1% 3.0% 0.2% direct: 1.6% skip:44.6% L0:59.9% L1:38.4% BI: 1.7%
    [libx264 @ 0x26417d0] 8x8 transform intra:49.7% inter:79.4%
    [libx264 @ 0x26417d0] coded y,uvDC,uvAC intra: 10.0% 13.9% 0.3% inter: 8.6% 11.3% 0.0%
    [libx264 @ 0x26417d0] i16 v,h,dc,p: 43% 24% 16% 16%
    [libx264 @ 0x26417d0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 42% 18% 36% 1% 0% 0% 1% 0% 1%
    [libx264 @ 0x26417d0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 50% 19% 16% 3% 2% 2% 3% 3% 3%
    [libx264 @ 0x26417d0] i8c dc,h,v,p: 70% 14% 16% 0%
    [libx264 @ 0x26417d0] Weighted P-Frames: Y:2.8% UV:0.0%
    [libx264 @ 0x26417d0] ref P L0: 39.8% 7.3% 42.5% 10.4% 0.0%
    [libx264 @ 0x26417d0] ref B L0: 44.7% 41.0% 14.2%
    [libx264 @ 0x26417d0] ref B L1: 70.0% 30.0%
    [libx264 @ 0x26417d0] kb/s:1465.58
    Exiting normally, received signal 2.
  • Using ffmpeg for streaming video composition from Python : why the sound is cut only when streaming into a mp4 file ?

    4 décembre 2017, par redantlabs

    I am using ffmpeg within Python for automatizing some video compositions. To do so, I am using the subprocess module of Python and run a ffmpeg command with a pipe input. This allows me to stream frame by frame the video composition from my array of raw images (numpy matrices) into ffmpeg. In the following example, I reduced the video composition to a simple video of a duration of 12 seconds. The produced ffmpeg command is :

    ffmpeg -i stream_audio.mp3 -re -f rawvideo -vcodec rawvideo -s 1280x720 -pix_fmt rgb24 -r 25 -i - -map 0:a -map 1:v -y -strict -2 -f mp4 -pix_fmt yuv420p out.mp4

    The file stream_audio.mp3 is a well formed mp3 file corresponding to the audio output of the output mp4 file. However, the sound in the output file out.mp4 is cut 3 seconds before the end.

    If I am trying to output any other format (for example avi), I do not observe this problem. The following command produces a well formed avi file.

    ffmpeg -i ./stream_audio.mp3 -re -f rawvideo -vcodec rawvideo -s 1280x720 -pix_fmt rgb24 -r 25 -i - -map 0:a -map 1:v -y -b 4096k -f avi -pix_fmt yuv420p out.avi

    I tried to reproduce the bug with the most simple ffmpeg command without passing by Python, but did not succeed.The closest I have done is the following :

    Building a raw video file with the correct specifications

    ffmpeg -i samplevideo.mp4 -f rawvideo -vcodec rawvideo -acodec none -s 1280x720 -pix_fmt rgb24 -r 25 samplevideo.raw

    Streaming the raw video file into the ffmpeg command

    cat samplevideo.raw | ffmpeg -i /tmp/stream_audio.mp3 -re -f rawvideo -vcodec rawvideo -s 1280x720 -pix_fmt rgb24 -r 25 -i - -map 0:a -map 1:v
    -y -strict -2 -f mp4 -pix_fmt yuv420p  -ss 00:00:00 -t 00:00:12 out.mp4

    Here is the version of ffmpeg I am using :

    ffmpeg version 3.1.9 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 6.3.1 (GCC) 20161221 (Red Hat 6.3.1-1)
     configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Hyper fast Audio and Video encoder

    The file samplevideo.mp4 can be found here : sample videos, the stream_audio.mp3 file is a simple extraction of the audio track of the samplevideo.mp4 file :

    ffmpeg -i samplevideo.mp4 stream_audio.mp3

    Thanks for your help.

    p.s : Here are the different logs of the ffmpeg commands :

    Command generated by my Python script with mp4 :

    Input #0, mp3, from './stream_audio.mp3':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
     Duration: 00:00:29.59, start: 0.023021, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc57.48
    Input #1, rawvideo, from 'pipe:':
     Duration: N/A, start: 0.000000, bitrate: 552960 kb/s
       Stream #1:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x720, 552960 kb/s, 25 tbr, 25 tbn, 25 tbc
    [libx264 @ 0xf5cb748ac0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0xf5cb748ac0] profile High, level 3.1
    [libx264 @ 0xf5cb748ac0] 264 - core 148 r2708 86b7198 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=6 lookahead_threads=1 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
    [mp4 @ 0xf5cb7462a0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
       Last message repeated 1 times
    Output #0, mp4, to 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
       Stream #0:0: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc57.48.101 aac
       Stream #0:1: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 25 fps, 12800 tbn, 25 tbc
       Metadata:
         encoder         : Lavc57.48.101 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (mp3 (native) -> aac (native))
     Stream #1:0 -> #0:1 (rawvideo (native) -> h264 (libx264))
    [rawvideo @ 0xf5cb722860] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    frame=   14 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   27 fps= 27 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   40 fps= 26 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   52 fps= 26 q=28.0 size=     113kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   65 fps= 26 q=28.0 size=     188kB time=00:00:00.49 bitrate=3145.8kbits/s speed=0.194x    
    frame=   77 fps= 25 q=28.0 size=     320kB time=00:00:01.00 bitrate=2615.3kbits/s speed=0.331x    
    frame=   90 fps= 25 q=28.0 size=     450kB time=00:00:01.51 bitrate=2431.3kbits/s speed=0.428x    
    frame=  103 fps= 25 q=28.0 size=     592kB time=00:00:02.00 bitrate=2418.9kbits/s speed=0.496x    
    frame=  116 fps= 25 q=28.0 size=     731kB time=00:00:02.52 bitrate=2376.1kbits/s speed=0.554x    
    frame=  128 fps= 25 q=28.0 size=     849kB time=00:00:03.02 bitrate=2295.6kbits/s speed=0.599x    
    frame=  141 fps= 25 q=28.0 size=     931kB time=00:00:03.54 bitrate=2153.0kbits/s speed=0.637x    
    frame=  153 fps= 25 q=28.0 size=     983kB time=00:00:04.03 bitrate=1996.7kbits/s speed=0.665x    
    frame=  166 fps= 25 q=28.0 size=    1067kB time=00:00:04.56 bitrate=1914.5kbits/s speed=0.695x    
    frame=  179 fps= 25 q=28.0 size=    1123kB time=00:00:05.04 bitrate=1824.8kbits/s speed=0.712x    
    frame=  191 fps= 25 q=28.0 size=    1213kB time=00:00:05.54 bitrate=1791.0kbits/s speed=0.732x    
    frame=  204 fps= 25 q=28.0 size=    1271kB time=00:00:06.05 bitrate=1718.5kbits/s speed=0.749x    
    frame=  217 fps= 25 q=28.0 size=    1346kB time=00:00:06.57 bitrate=1678.1kbits/s speed=0.764x    
    frame=  230 fps= 25 q=28.0 size=    1452kB time=00:00:07.08 bitrate=1678.9kbits/s speed=0.778x    
    frame=  242 fps= 25 q=28.0 size=    1567kB time=00:00:07.59 bitrate=1690.3kbits/s speed=0.79x    
    frame=  255 fps= 25 q=28.0 size=    1660kB time=00:00:08.08 bitrate=1682.4kbits/s speed=0.799x    
    frame=  267 fps= 25 q=28.0 size=    1739kB time=00:00:08.59 bitrate=1657.1kbits/s speed=0.81x    
    frame=  280 fps= 25 q=28.0 size=    1751kB time=00:00:09.08 bitrate=1578.1kbits/s speed=0.817x    
    frame=  291 fps= 24 q=-1.0 Lsize=    1864kB time=00:00:11.52 bitrate=1325.7kbits/s speed=0.954x    
    video:1707kB audio:149kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.437266%
    [aac @ 0xf5cb747540] Qavg: 202.422
    [libx264 @ 0xf5cb748ac0] frame I:2     Avg QP:15.83  size: 78710
    [libx264 @ 0xf5cb748ac0] frame P:183   Avg QP:21.13  size:  7293
    [libx264 @ 0xf5cb748ac0] frame B:106   Avg QP:26.82  size:  2406
    [libx264 @ 0xf5cb748ac0] consecutive B-frames: 47.8% 10.3%  2.1% 39.9%
    [libx264 @ 0xf5cb748ac0] mb I  I16..4: 22.1% 32.5% 45.4%
    [libx264 @ 0xf5cb748ac0] mb P  I16..4:  0.8%  1.4%  0.2%  P16..4: 25.3%  6.3%  3.1%  0.0%  0.0%    skip:62.9%
    [libx264 @ 0xf5cb748ac0] mb B  I16..4:  0.1%  0.2%  0.0%  B16..8: 39.0%  1.7%  0.2%  direct: 0.4%  skip:58.5%  L0:47.3% L1:49.6% BI: 3.1%
    [libx264 @ 0xf5cb748ac0] 8x8 transform intra:50.3% inter:57.9%
    [libx264 @ 0xf5cb748ac0] coded y,uvDC,uvAC intra: 49.5% 65.3% 23.0% inter: 7.8% 10.2% 0.5%
    [libx264 @ 0xf5cb748ac0] i16 v,h,dc,p: 30% 32% 11% 27%
    [libx264 @ 0xf5cb748ac0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 23%  4%  5%  7%  5%  5%  5%
    [libx264 @ 0xf5cb748ac0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 15% 11%  8%  8%  9%  7% 12%  7%
    [libx264 @ 0xf5cb748ac0] i8c dc,h,v,p: 51% 20% 21%  8%
    [libx264 @ 0xf5cb748ac0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0xf5cb748ac0] ref P L0: 79.8% 11.4%  7.6%  1.2%
    [libx264 @ 0xf5cb748ac0] ref B L0: 96.9%  2.8%  0.4%
    [libx264 @ 0xf5cb748ac0] ref B L1: 97.7%  2.3%
    [libx264 @ 0xf5cb748ac0] kb/s:1200.72
    Exiting normally, received signal 15.

    Command generated by my Python script with avi :

    Input #0, mp3, from './stream_audio.mp3':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
     Duration: 00:00:29.59, start: 0.023021, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc57.48
    Input #1, rawvideo, from 'pipe:':
     Duration: N/A, start: 0.000000, bitrate: 552960 kb/s
       Stream #1:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x720, 552960 kb/s, 25 tbr, 25 tbn, 25 tbc
    Please use -b:a or -b:v, -b is ambiguous
    [avi @ 0x82147c30e0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
       Last message repeated 1 times
    Output #0, avi, to 'out.avi':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       ISFT            : Lavf57.41.100
       Stream #0:0: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p
       Metadata:
         encoder         : Lavc57.48.101 libmp3lame
       Stream #0:1: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720, q=2-31, 4096 kb/s, 25 fps, 25 tbn, 25 tbc
       Metadata:
         encoder         : Lavc57.48.101 mpeg4
       Side data:
         cpb: bitrate max/min/avg: 0/0/4096000 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
     Stream #1:0 -> #0:1 (rawvideo (native) -> mpeg4 (native))
    [rawvideo @ 0x821479f820] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    frame=   14 fps=0.0 q=2.6 size=     553kB time=00:00:00.56 bitrate=8082.6kbits/s speed= 1.1x    
    frame=   27 fps= 27 q=5.4 size=     858kB time=00:00:01.08 bitrate=6507.5kbits/s speed=1.06x    
    frame=   40 fps= 26 q=5.9 size=    1089kB time=00:00:01.60 bitrate=5574.9kbits/s speed=1.05x    
    frame=   52 fps= 26 q=5.5 size=    1332kB time=00:00:02.08 bitrate=5225.6kbits/s speed=1.03x    
    frame=   65 fps= 26 q=4.9 size=    1582kB time=00:00:02.60 bitrate=4985.6kbits/s speed=1.03x    
    frame=   78 fps= 26 q=4.3 size=    1816kB time=00:00:03.12 bitrate=4768.1kbits/s speed=1.03x    
    frame=   90 fps= 25 q=2.8 size=    2035kB time=00:00:03.60 bitrate=4631.7kbits/s speed=1.02x    
    frame=  103 fps= 25 q=2.3 size=    2288kB time=00:00:04.12 bitrate=4549.8kbits/s speed=1.02x    
    frame=  116 fps= 25 q=2.4 size=    2558kB time=00:00:04.64 bitrate=4516.3kbits/s speed=1.02x    
    frame=  128 fps= 25 q=2.3 size=    2835kB time=00:00:05.12 bitrate=4535.4kbits/s speed=1.01x    
    frame=  141 fps= 25 q=3.1 size=    3103kB time=00:00:05.64 bitrate=4506.6kbits/s speed=1.01x    
    frame=  154 fps= 25 q=2.8 size=    3381kB time=00:00:06.16 bitrate=4495.9kbits/s speed=1.01x    
    frame=  166 fps= 25 q=3.4 size=    3648kB time=00:00:06.64 bitrate=4494.9kbits/s speed=1.01x    
    frame=  179 fps= 25 q=3.3 size=    3894kB time=00:00:07.16 bitrate=4455.7kbits/s speed=1.01x    
    frame=  192 fps= 25 q=3.2 size=    4128kB time=00:00:07.68 bitrate=4402.9kbits/s speed=1.01x    
    frame=  204 fps= 25 q=3.4 size=    4404kB time=00:00:08.16 bitrate=4420.9kbits/s speed=1.01x    
    frame=  217 fps= 25 q=2.0 size=    4592kB time=00:00:08.68 bitrate=4334.0kbits/s speed=1.01x    
    frame=  230 fps= 25 q=2.0 size=    4657kB time=00:00:09.20 bitrate=4147.2kbits/s speed=1.01x    
    frame=  242 fps= 25 q=2.0 size=    4736kB time=00:00:09.68 bitrate=4007.9kbits/s speed=1.01x    
    frame=  255 fps= 25 q=2.0 size=    4830kB time=00:00:10.20 bitrate=3879.0kbits/s speed=1.01x    
    frame=  267 fps= 25 q=2.0 size=    4953kB time=00:00:10.68 bitrate=3799.5kbits/s speed=1.01x    
    frame=  280 fps= 25 q=2.0 size=    5093kB time=00:00:11.20 bitrate=3722.3kbits/s speed=1.01x    
    frame=  291 fps= 25 q=2.0 Lsize=    5209kB time=00:00:11.68 bitrate=3650.9kbits/s speed=1.01x    
    video:4998kB audio:183kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.542552%
    Exiting normally, received signal 15.

    Pure command line for mp4 format :

    Input #0, mp3, from './stream_audio.mp3':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
     Duration: 00:00:29.59, start: 0.023021, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc57.48
    Input #1, rawvideo, from 'pipe:':
     Duration: N/A, start: 0.000000, bitrate: 552960 kb/s
       Stream #1:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x720, 552960 kb/s, 25 tbr, 25 tbn, 25 tbc
    [libx264 @ 0x75fc583aa0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x75fc583aa0] profile High, level 3.1
    [libx264 @ 0x75fc583aa0] 264 - core 148 r2708 86b7198 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=6 lookahead_threads=1 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
    [mp4 @ 0x75fc581280] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
       Last message repeated 1 times
    Output #0, mp4, to 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
       Stream #0:0: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc57.48.101 aac
       Stream #0:1: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 25 fps, 12800 tbn, 25 tbc
       Metadata:
         encoder         : Lavc57.48.101 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (mp3 (native) -> aac (native))
     Stream #1:0 -> #0:1 (rawvideo (native) -> h264 (libx264))
    [rawvideo @ 0x75fc55d840] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    frame=   14 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   27 fps= 27 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   39 fps= 26 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   52 fps= 26 q=28.0 size=     113kB time=00:00:00.00 bitrate=N/A speed=   0x    
    frame=   65 fps= 26 q=28.0 size=     188kB time=00:00:00.48 bitrate=3209.4kbits/s speed=0.191x    
    frame=   77 fps= 26 q=28.0 size=     320kB time=00:00:01.00 bitrate=2615.3kbits/s speed=0.332x    
    frame=   90 fps= 26 q=28.0 size=     450kB time=00:00:01.51 bitrate=2431.3kbits/s speed=0.43x    
    frame=  102 fps= 25 q=28.0 size=     591kB time=00:00:01.98 bitrate=2442.1kbits/s speed=0.493x    
    frame=  115 fps= 25 q=28.0 size=     731kB time=00:00:02.51 bitrate=2377.6kbits/s speed=0.556x    
    frame=  128 fps= 25 q=28.0 size=     845kB time=00:00:03.00 bitrate=2307.7kbits/s speed=0.596x    
    frame=  140 fps= 25 q=28.0 size=     930kB time=00:00:03.52 bitrate=2164.6kbits/s speed=0.636x    
    frame=  153 fps= 25 q=28.0 size=     983kB time=00:00:04.03 bitrate=1996.7kbits/s speed=0.668x    
    frame=  165 fps= 25 q=28.0 size=    1063kB time=00:00:04.52 bitrate=1925.2kbits/s speed=0.691x    
    frame=  178 fps= 25 q=28.0 size=    1122kB time=00:00:05.03 bitrate=1826.2kbits/s speed=0.714x    
    frame=  191 fps= 25 q=28.0 size=    1203kB time=00:00:05.52 bitrate=1783.6kbits/s speed=0.732x    
    frame=  203 fps= 25 q=28.0 size=    1270kB time=00:00:06.03 bitrate=1723.7kbits/s speed=0.749x    
    frame=  216 fps= 25 q=28.0 size=    1339kB time=00:00:06.52 bitrate=1680.5kbits/s speed=0.763x    
    frame=  228 fps= 25 q=28.0 size=    1443kB time=00:00:07.06 bitrate=1674.1kbits/s speed=0.779x    
    frame=  241 fps= 25 q=28.0 size=    1558kB time=00:00:07.55 bitrate=1690.0kbits/s speed=0.789x    
    frame=  254 fps= 25 q=28.0 size=    1654kB time=00:00:08.04 bitrate=1685.0kbits/s speed=0.799x    
    frame=  266 fps= 25 q=28.0 size=    1738kB time=00:00:08.55 bitrate=1664.6kbits/s speed=0.809x    
    frame=  279 fps= 25 q=28.0 size=    1750kB time=00:00:09.06 bitrate=1581.2kbits/s speed=0.818x    
    frame=  291 fps= 25 q=28.0 size=    1765kB time=00:00:09.55 bitrate=1512.7kbits/s speed=0.825x    
    frame=  300 fps= 25 q=28.0 size=    1779kB time=00:00:11.73 bitrate=1242.1kbits/s speed=0.971x    
    frame=  300 fps= 24 q=-1.0 Lsize=    1917kB time=00:00:12.01 bitrate=1307.2kbits/s speed=0.955x    
    video:1720kB audio:188kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.488004%
    [aac @ 0x75fc582520] Qavg: 221.585
    [libx264 @ 0x75fc583aa0] frame I:2     Avg QP:15.83  size: 78710
    [libx264 @ 0x75fc583aa0] frame P:185   Avg QP:21.02  size:  7259
    [libx264 @ 0x75fc583aa0] frame B:113   Avg QP:26.59  size:  2298
    [libx264 @ 0x75fc583aa0] consecutive B-frames: 46.3% 10.0%  1.0% 42.7%
    [libx264 @ 0x75fc583aa0] mb I  I16..4: 22.1% 32.5% 45.4%
    [libx264 @ 0x75fc583aa0] mb P  I16..4:  0.8%  1.4%  0.2%  P16..4: 25.2%  6.3%  3.1%  0.0%  0.0%    skip:63.0%
    [libx264 @ 0x75fc583aa0] mb B  I16..4:  0.1%  0.2%  0.0%  B16..8: 37.3%  1.6%  0.2%  direct: 0.4%  skip:60.2%  L0:47.3% L1:49.6% BI: 3.0%
    [libx264 @ 0x75fc583aa0] 8x8 transform intra:50.5% inter:58.1%
    [libx264 @ 0x75fc583aa0] coded y,uvDC,uvAC intra: 49.4% 65.2% 22.9% inter: 7.7% 10.0% 0.5%
    [libx264 @ 0x75fc583aa0] i16 v,h,dc,p: 29% 32% 11% 28%
    [libx264 @ 0x75fc583aa0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 21% 23%  4%  5%  6%  5%  5%  5%
    [libx264 @ 0x75fc583aa0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 15% 11%  8%  8%  9%  7% 12%  7%
    [libx264 @ 0x75fc583aa0] i8c dc,h,v,p: 51% 20% 21%  8%
    [libx264 @ 0x75fc583aa0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x75fc583aa0] ref P L0: 79.7% 11.4%  7.7%  1.2%
    [libx264 @ 0x75fc583aa0] ref B L0: 96.8%  2.9%  0.4%
    [libx264 @ 0x75fc583aa0] ref B L1: 97.7%  2.3%
    [libx264 @ 0x75fc583aa0] kb/s:1173.39