
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (14984)
-
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 redantlabsI 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.mp4Here 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 encoderThe 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 -
How to combine multiple images and multiple audio files into one video with ffmpeg ?
14 mars, par nachocabI have two images
image1.png
andimage2.png
, they both have the same dimensions. I also have two audio filesaudio1.wav
andaudio2.wav
they each have different lengths. I want to make a video that showsimage1.png
duringaudio1.wav
and thenimage2.png
overaudio2.wav
.


I've tried two methods, but they don't work. The images show correctly, but the durations are not synced with the audio.



Method 1 : create videos separately and combine them :



image1 => video1



ffmpeg -loop 1 \
 -y \
 -i "image1.png" \
 -i "audio1.wav" \
 -c:v libx264 -tune stillimage -pix_fmt yuv420p \
 -c:a aac -b:a 192k \
 -shortest \
 "video1.mp4"

ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
 built with Apple LLVM version 8.0.0 (clang-800.0.38)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-frei0r --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.2.0/include/openjpeg-2.2 --enable-nonfree --enable-vda
 libavutil 55. 58.100 / 55. 58.100
 libavcodec 57. 89.100 / 57. 89.100
 libavformat 57. 71.100 / 57. 71.100
 libavdevice 57. 6.100 / 57. 6.100
 libavfilter 6. 82.100 / 6. 82.100
 libavresample 3. 5. 0 / 3. 5. 0
 libswscale 4. 6.100 / 4. 6.100
 libswresample 2. 7.100 / 2. 7.100
 libpostproc 54. 5.100 / 54. 5.100
Input #0, png_pipe, from 'image1.png':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: png, rgba(pc), 800x800, 25 fps, 25 tbr, 25 tbn, 25 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'audio1.wav':
 Metadata:
 title : untitled
 track : 1
 Duration: 00:00:03.70, bitrate: 1411 kb/s
 Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
 Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fead980bc00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fead980bc00] profile High, level 3.1
[libx264 @ 0x7fead980bc00] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:-3:-3 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=2.00:0.70 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-4 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.20
Output #0, mp4, to 'video1.mp4':
 Metadata:
 encoder : Lavf57.71.100
 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p(progressive), 800x800, q=-1--1, 25 fps, 12800 tbn, 25 tbc
 Metadata:
 encoder : Lavc57.89.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 192 kb/s
 Metadata:
 encoder : Lavc57.89.100 aac
frame= 151 fps=0.0 q=-1.0 Lsize= 106kB time=00:00:05.92 bitrate= 146.6kbits/s speed=6.73x
video:13kB audio:87kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.016360%
[libx264 @ 0x7fead980bc00] frame I:1 Avg QP:14.87 size: 5746
[libx264 @ 0x7fead980bc00] frame P:38 Avg QP:12.15 size: 51
[libx264 @ 0x7fead980bc00] frame B:112 Avg QP:16.81 size: 48
[libx264 @ 0x7fead980bc00] consecutive B-frames: 0.7% 1.3% 0.0% 98.0%
[libx264 @ 0x7fead980bc00] mb I I16..4: 46.9% 44.7% 8.4%
[libx264 @ 0x7fead980bc00] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:99.9%
[libx264 @ 0x7fead980bc00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.7% L0:63.5% L1:36.5% BI: 0.0%
[libx264 @ 0x7fead980bc00] 8x8 transform intra:40.7% inter:20.0%
[libx264 @ 0x7fead980bc00] coded y,uvDC,uvAC intra: 4.9% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7fead980bc00] i16 v,h,dc,p: 82% 13% 4% 0%
[libx264 @ 0x7fead980bc00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 74% 2% 24% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x7fead980bc00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 24% 32% 2% 2% 2% 2% 1% 2%
[libx264 @ 0x7fead980bc00] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0x7fead980bc00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fead980bc00] ref B L0: 48.0% 52.0%
[libx264 @ 0x7fead980bc00] ref B L1: 99.5% 0.5%
[libx264 @ 0x7fead980bc00] kb/s:17.36
[aac @ 0x7fead981b400] Qavg: 535.938




image2 => video2



ffmpeg -loop 1 \
 -y \
 -i "image2.png" \
 -i "audio2.wav" \
 -c:v libx264 -tune stillimage -pix_fmt yuv420p \
 -c:a aac -b:a 192k \
 -shortest \
 "video2.mp4"

ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
 built with Apple LLVM version 8.0.0 (clang-800.0.38)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-frei0r --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.2.0/include/openjpeg-2.2 --enable-nonfree --enable-vda
 libavutil 55. 58.100 / 55. 58.100
 libavcodec 57. 89.100 / 57. 89.100
 libavformat 57. 71.100 / 57. 71.100
 libavdevice 57. 6.100 / 57. 6.100
 libavfilter 6. 82.100 / 6. 82.100
 libavresample 3. 5. 0 / 3. 5. 0
 libswscale 4. 6.100 / 4. 6.100
 libswresample 2. 7.100 / 2. 7.100
 libpostproc 54. 5.100 / 54. 5.100
Input #0, png_pipe, from 'image2.png':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: png, rgba(pc), 800x800, 25 fps, 25 tbr, 25 tbn, 25 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'audio2.wav':
 Metadata:
 title : untitled
 track : 2
 Duration: 00:00:05.49, bitrate: 1411 kb/s
 Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
 Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fa0e201ce00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fa0e201ce00] profile High, level 3.1
[libx264 @ 0x7fa0e201ce00] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:-3:-3 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=2.00:0.70 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-4 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.20
Output #0, mp4, to 'video2.mp4':
 Metadata:
 encoder : Lavf57.71.100
 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p(progressive), 800x800, q=-1--1, 25 fps, 12800 tbn, 25 tbc
 Metadata:
 encoder : Lavc57.89.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 192 kb/s
 Metadata:
 encoder : Lavc57.89.100 aac
frame= 195 fps=177 q=-1.0 Lsize= 150kB time=00:00:07.68 bitrate= 160.2kbits/s speed=6.96x
video:14kB audio:129kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.516541%
[libx264 @ 0x7fa0e201ce00] frame I:1 Avg QP: 9.03 size: 6402
[libx264 @ 0x7fa0e201ce00] frame P:49 Avg QP: 6.59 size: 41
[libx264 @ 0x7fa0e201ce00] frame B:145 Avg QP: 9.67 size: 39
[libx264 @ 0x7fa0e201ce00] consecutive B-frames: 0.5% 1.0% 0.0% 98.5%
[libx264 @ 0x7fa0e201ce00] mb I I16..4: 54.7% 36.0% 9.3%
[libx264 @ 0x7fa0e201ce00] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:100.0%
[libx264 @ 0x7fa0e201ce00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:70.1% L1:29.9% BI: 0.0%
[libx264 @ 0x7fa0e201ce00] 8x8 transform intra:36.0% inter:14.3%
[libx264 @ 0x7fa0e201ce00] coded y,uvDC,uvAC intra: 4.3% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7fa0e201ce00] i16 v,h,dc,p: 91% 5% 4% 0%
[libx264 @ 0x7fa0e201ce00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 72% 8% 20% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x7fa0e201ce00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 23% 25% 4% 3% 3% 3% 2% 2%
[libx264 @ 0x7fa0e201ce00] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0x7fa0e201ce00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fa0e201ce00] ref P L0: 83.3% 8.3% 8.3%
[libx264 @ 0x7fa0e201ce00] ref B L0: 40.1% 59.9%
[libx264 @ 0x7fa0e201ce00] kb/s:14.38
[aac @ 0x7fa0e201e600] Qavg: 595.040




When I import these into Final Cut I can see that both videos get around 2:30 seconds of added silence (not present in the audio) :






concatenating video1 and video2



ffmpeg -i "video1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "video2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc "video_combined.mp4"

ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
 built with Apple LLVM version 8.0.0 (clang-800.0.38)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-frei0r --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.2.0/include/openjpeg-2.2 --enable-nonfree --enable-vda
 libavutil 55. 58.100 / 55. 58.100
 libavcodec 57. 89.100 / 57. 89.100
 libavformat 57. 71.100 / 57. 71.100
 libavdevice 57. 6.100 / 57. 6.100
 libavfilter 6. 82.100 / 6. 82.100
 libavresample 3. 5. 0 / 3. 5. 0
 libswscale 4. 6.100 / 4. 6.100
 libswresample 2. 7.100 / 2. 7.100
 libpostproc 54. 5.100 / 54. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf57.71.100
 Duration: 00:00:06.04, start: 0.000000, bitrate: 143 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x800, 18 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 handler_name : SoundHandler
Output #0, mpegts, to 'intermediate1.ts':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf57.71.100
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x800, q=2-31, 18 kb/s, 25 fps, 25 tbr, 90k tbn, 12800 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 handler_name : SoundHandler
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 151 fps=0.0 q=-1.0 Lsize= 135kB time=00:00:05.92 bitrate= 187.5kbits/s speed=2.43e+03x
video:14kB audio:87kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 34.259724%
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
 built with Apple LLVM version 8.0.0 (clang-800.0.38)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-frei0r --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.2.0/include/openjpeg-2.2 --enable-nonfree --enable-vda
 libavutil 55. 58.100 / 55. 58.100
 libavcodec 57. 89.100 / 57. 89.100
 libavformat 57. 71.100 / 57. 71.100
 libavdevice 57. 6.100 / 57. 6.100
 libavfilter 6. 82.100 / 6. 82.100
 libavresample 3. 5. 0 / 3. 5. 0
 libswscale 4. 6.100 / 4. 6.100
 libswresample 2. 7.100 / 2. 7.100
 libpostproc 54. 5.100 / 54. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video2.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf57.71.100
 Duration: 00:00:07.80, start: 0.000000, bitrate: 157 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x800, 15 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 handler_name : SoundHandler
Output #0, mpegts, to 'intermediate2.ts':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf57.71.100
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x800, q=2-31, 15 kb/s, 25 fps, 25 tbr, 90k tbn, 12800 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 handler_name : SoundHandler
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 195 fps=0.0 q=-1.0 Lsize= 192kB time=00:00:07.68 bitrate= 204.8kbits/s speed=2.6e+03x
video:14kB audio:129kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 33.605099%
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
 built with Apple LLVM version 8.0.0 (clang-800.0.38)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-frei0r --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.2.0/include/openjpeg-2.2 --enable-nonfree --enable-vda
 libavutil 55. 58.100 / 55. 58.100
 libavcodec 57. 89.100 / 57. 89.100
 libavformat 57. 71.100 / 57. 71.100
 libavdevice 57. 6.100 / 57. 6.100
 libavfilter 6. 82.100 / 6. 82.100
 libavresample 3. 5. 0 / 3. 5. 0
 libswscale 4. 6.100 / 4. 6.100
 libswresample 2. 7.100 / 2. 7.100
 libpostproc 54. 5.100 / 54. 5.100
Input #0, mpegts, from 'concat:intermediate1.ts|intermediate2.ts':
 Duration: 00:00:07.82, start: 1.456778, bitrate: 342 kb/s
 Program 1
 Metadata:
 service_name : Service01
 service_provider: FFmpeg
 Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 800x800, 25 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0:1[0x101](und): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 169 kb/s
Output #0, mp4, to 'video_combined.mp4':
 Metadata:
 encoder : Lavf57.71.100
 Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(progressive), 800x800, q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
 Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 169 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 346 fps=0.0 q=-1.0 Lsize= 257kB time=00:00:13.74 bitrate= 153.3kbits/s speed=1.54e+03x
video:30kB audio:217kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 4.243830%




The output of the combined video contains the extra silences, but the second audio doesn't combine properly :






Method 2 : Create combined video directly



ffmpeg -f concat -i input.txt -map 0 \
 -vcodec libx264 \
 -aprofile aac_low -acodec aac -strict experimental -cutoff 15000 -b:a 32k 
 "video_combined.mp4"




Any ideas ?


-
Cutting with ffmpeg a video (recorded with Kodi) gives no image
1er octobre 2017, par LaureI am trying to cut videos I get from a IPTV add-on in Kodi. The original video can be watched with VLC, Mplayer, xine, etc, but after being copied there is no image. According to mediainfo there is a video stream but nothing can be seen. The command I use is :
ffmpeg -y -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg
I suppose there is something wrong with the original videos recorded by Kodi, but they give no problem with any player. A short example video is this one :
https://drive.google.com/open?id=0B0WC80aT-4WrSDNENzhxRUxkOXc
The output with the -report option is this one :
ffmpeg started on 2017-09-10 at 02:27:38
Report written to "ffmpeg-20170910-022738.log"
Command line:
ffmpeg -y -report -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enabl libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input url with argument 'test-1.mpeg'.
Reading option '-scodec' ... matched as option 'scodec' (force subtitle codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '00:00:10.000'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:00:10.000'.
Reading option 'test-1-cut.mpeg' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url test-1.mpeg.
Successfully parsed a group of options.
Opening an input file: test-1.mpeg.
[mpegts @ 0x8292960] Format mpegts probed with size=2048 and score=100
[mpegts @ 0x8292960] stream=0 stream_type=1b pid=65 prog_reg_desc=
[mpegts @ 0x8292960] stream=1 stream_type=3 pid=c9 prog_reg_desc=
[mpegts @ 0x8292960] stream=2 stream_type=3 pid=ca prog_reg_desc=
[mpegts @ 0x8292960] stream=3 stream_type=6 pid=191 prog_reg_desc=
[mpegts @ 0x8292960] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 14
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 14
[h264 @ 0x8296880] Frame num gap 190 185
[h264 @ 0x8296880] Frame num gap 190 186
[h264 @ 0x8296880] Frame num gap 190 187
[h264 @ 0x8296880] Frame num gap 190 188
[h264 @ 0x8296880] mmco: unref short failure
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] Increasing reorder buffer to 2
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] Increasing reorder buffer to 3
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] no picture ooo
[h264 @ 0x8296880] no picture
[h264 @ 0x8296880] mmco: unref short failure
[h264 @ 0x8296880] no picture
[h264 @ 0x8296880] no picture
[mpegts @ 0x8292960] max_analyze_duration 5000000 reached at 5000000 microseconds st:0
[NULL @ 0x8298500] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x8292960] PES packet size mismatch
[mpegts @ 0x8292960] After avformat_find_stream_info() pos: 0 bytes read:4378768 seeks:2 frames:529
Input #0, mpegts, from 'test-1.mpeg':
Duration: 00:01:21.19, start: 74380.458944, bitrate: 6510 kb/s
Program 3102
Stream #0:0[0x65], 127, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0xc9](esp), 204, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
Stream #0:2[0xca](vo), 198, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s (clean effects)
Stream #0:3[0x191](esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Successfully opened the file.
Parsing a group of options: output url test-1-cut.mpeg.
Applying option scodec (force subtitle codec ('copy' to copy stream)) with argument copy.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
Applying option c:a (codec name) with argument copy.
Applying option map (set input stream mapping) with argument 0.
Applying option ss (set the start time offset) with argument 00:00:10.000.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:00:10.000.
Successfully parsed a group of options.
Opening an output file: test-1-cut.mpeg.
Successfully opened the file.
[mpeg @ 0x829a0e0] 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 #0, mpeg, to 'test-1-cut.mpeg':
Metadata:
encoder : Lavf56.40.101
Stream #0:0, 0, 1/90000: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1(esp), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 192 kb/s (clean effects)
Stream #0:2(vo), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 128 kb/s (clean effects)
Stream #0:3(esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Stream #0:3 -> #0:3 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 14
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 14
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 1 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 1 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 1
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 1
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 5 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 5 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 5
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 5
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 10 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 10 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 10
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 10
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 5 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 5 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 5
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 5
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 1 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 1 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 1
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 1
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 3 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 3 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 3
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 3
frame= 231 fps=0.0 q=-1.0 size= 0kB time=00:00:10.03 bitrate= 0.0kbits/s
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 13 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 13 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 13
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 13
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 0 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 0 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 0
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 0
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 10 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 9 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 9
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 10
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 6 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 6 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 6
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 6
frame= 231 fps=231 q=-1.0 size= 0kB time=00:00:10.03 bitrate= 0.0kbits/s
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 0 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 0 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 0
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 0
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 2 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 1 got 7
[mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 1
[mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 2
[mpegts @ 0x8292960] PES packet size mismatch
No more output streams to write to, finishing.
[mpeg @ 0x829a0e0] First SCR: 0 First DTS: 45000
frame= 231 fps=149 q=-1.0 Lsize= 7344kB time=00:00:10.03 bitrate=5995.5kbits/s
video:6918kB audio:391kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.483494%
Input file #0 (test-1.mpeg):
Input stream #0:0 (video): 2016 packets read (60807549 bytes);
Input stream #0:1 (audio): 3360 packets read (1935360 bytes);
Input stream #0:2 (audio): 3363 packets read (1291096 bytes);
Input stream #0:3 (subtitle): 0 packets read (0 bytes);
Total: 8739 packets (64034005 bytes) demuxed
Output file #0 (test-1-cut.mpeg):
Output stream #0:0 (video): 231 packets muxed (7083751 bytes);
Output stream #0:1 (audio): 417 packets muxed (240192 bytes);
Output stream #0:2 (audio): 417 packets muxed (160128 bytes);
Output stream #0:3 (subtitle): 0 packets muxed (0 bytes);
Total: 1065 packets (7484071 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x82f9860] Statistics: 0 seeks, 3672 writeouts
[AVIOContext @ 0x829b1a0] Statistics: 70457008 bytes read, 2 seeksFollowing a suggestion from a comment, I have tried a static build of the last version of ffmpeg. The resulting file again has a video stream but the player cannot play it. The log is the following :
ffmpeg started on 2017-09-18 at 00:14:22
Report written to "ffmpeg-20170918-001422.log"
Command line:
./ffmpeg -y -report -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg
ffmpeg version N-87286-g6ce4a635ed-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.4.0 (Debian 6.4.0-4) 20170820
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.105.100 / 57.105.100
libavformat 57. 82.100 / 57. 82.100
libavdevice 57. 8.100 / 57. 8.100
libavfilter 6.105.100 / 6.105.100
libswscale 4. 7.103 / 4. 7.103
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input url with argument 'test-1.mpeg'.
Reading option '-scodec' ... matched as option 'scodec' (force subtitle codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '00:00:10.000'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:00:10.000'.
Reading option 'test-1-cut.mpeg' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url test-1.mpeg.
Successfully parsed a group of options.
Opening an input file: test-1.mpeg.
[NULL @ 0x4e6d900] Opening 'test-1.mpeg' for reading
[file @ 0x4e6e1a0] Setting default whitelist 'file,crypto'
[mpegts @ 0x4e6d900] Format mpegts probed with size=2048 and score=50
[mpegts @ 0x4e6d900] stream=0 stream_type=1b pid=65 prog_reg_desc=
[mpegts @ 0x4e6d900] stream=1 stream_type=3 pid=c9 prog_reg_desc=
[mpegts @ 0x4e6d900] stream=2 stream_type=3 pid=ca prog_reg_desc=
[mpegts @ 0x4e6d900] stream=3 stream_type=6 pid=191 prog_reg_desc=
[mpegts @ 0x4e6d900] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:4
[mpegts @ 0x4e6d900] Continuity check failed for pid 0 expected 8 got 14
[mpegts @ 0x4e6d900] Continuity check failed for pid 100 expected 8 got 14
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[AVBSFContext @ 0x4f23c80] nal_unit_type: 9, nal_ref_idc: 0
[AVBSFContext @ 0x4f23c80] nal_unit_type: 7, nal_ref_idc: 3
[AVBSFContext @ 0x4f23c80] nal_unit_type: 8, nal_ref_idc: 3
[AVBSFContext @ 0x4f23c80] nal_unit_type: 6, nal_ref_idc: 0
[AVBSFContext @ 0x4f23c80] nal_unit_type: 1, nal_ref_idc: 2
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0x4e72500] Frame num gap 190 185
[h264 @ 0x4e72500] Frame num gap 190 186
[h264 @ 0x4e72500] Frame num gap 190 187
[h264 @ 0x4e72500] Frame num gap 190 188
[h264 @ 0x4e72500] mmco: unref short failure
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] no picture ooo
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] Increasing reorder buffer to 2
[h264 @ 0x4e72500] no picture ooo
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] Increasing reorder buffer to 3
[h264 @ 0x4e72500] no picture ooo
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] no picture ooo
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
................. a lot of similar lines .......................
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
.......... a lot of similar lines...........
[h264 @ 0x4e72500] ct_type:0 pic_struct:3
[mpegts @ 0x4e6d900] max_analyze_duration 5000000 reached at 5000000 microseconds st:0
[mpegts @ 0x4e6d900] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x4e6d900] PES packet size mismatch
[mpegts @ 0x4e6d900] After avformat_find_stream_info() pos: 0 bytes read:4378768 seeks:2 frames:529
Input #0, mpegts, from 'test-1.mpeg':
Duration: 00:01:21.19, start: 74380.458944, bitrate: 6510 kb/s
Program 3102
Stream #0:0[0x65], 127, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0xc9](esp), 204, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
Stream #0:2[0xca](vo), 198, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s (clean effects)
Stream #0:3[0x191](esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Successfully opened the file.
Parsing a group of options: output url test-1-cut.mpeg.
Applying option scodec (force subtitle codec ('copy' to copy stream)) with argument copy.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
Applying option c:a (codec name) with argument copy.
Applying option map (set input stream mapping) with argument 0.
Applying option ss (set the start time offset) with argument 00:00:10.000.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:00:10.000.
Successfully parsed a group of options.
Opening an output file: test-1-cut.mpeg.
[file @ 0x4eb6020] Setting default whitelist 'file,crypto'
Successfully opened the file.
[mpeg @ 0x4ea6560] 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 #0, mpeg, to 'test-1-cut.mpeg':
Metadata:
encoder : Lavf57.82.100
Stream #0:0, 0, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1(esp), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
Stream #0:2(vo), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s (clean effects)
Stream #0:3(esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Stream #0:3 -> #0:3 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[NULL @ 0x4e72500] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
[mpegts @ 0x4e6d900] Continuity check failed for pid 0 expected 8 got 14
[mpegts @ 0x4e6d900] Continuity check failed for pid 100 expected 8 got 14
[NULL @ 0x4e72500] ct_type:0 pic_struct:3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[NULL @ 0x4e72500] ct_type:0 pic_struct:3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
........... a lot of similar lines .............
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[NULL @ 0x4e72500] ct_type:0 pic_struct:3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mpegts @ 0x4e6d900] PES packet size mismatch
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[NULL @ 0x4e72500] ct_type:0 pic_struct:3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
No more output streams to write to, finishing.
[mpeg @ 0x4ea6560] First SCR: 0 First DTS: 45000
frame= 231 fps=0.0 q=-1.0 Lsize= 7344kB time=00:00:09.99 bitrate=6019.5kbits/s speed=42.1x
video:6918kB audio:391kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.483494%
Input file #0 (test-1.mpeg):
Input stream #0:0 (video): 2016 packets read (60807549 bytes);
Input stream #0:1 (audio): 3360 packets read (1935360 bytes);
Input stream #0:2 (audio): 3363 packets read (1291096 bytes);
Input stream #0:3 (subtitle): 0 packets read (0 bytes);
Total: 8739 packets (64034005 bytes) demuxed
Output file #0 (test-1-cut.mpeg):
Output stream #0:0 (video): 231 packets muxed (7083751 bytes);
Output stream #0:1 (audio): 417 packets muxed (240192 bytes);
Output stream #0:2 (audio): 417 packets muxed (160128 bytes);
Output stream #0:3 (subtitle): 0 packets muxed (0 bytes);
Total: 1065 packets (7484071 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x4ef6300] Statistics: 0 seeks, 3672 writeouts
[AVIOContext @ 0x4e6e040] Statistics: 70457008 bytes read, 2 seeks