[FFmpeg-user] How to copy all of 5 audio streams to mp4 file

Ulf Zibis Ulf.Zibis at gmx.de
Mon Feb 18 19:52:19 EET 2019


Hi Moritz,

thanks for your additional hints.

Am 18.02.19 um 17:06 schrieb Moritz Barsnick:
> ffmpeg needs to detect them *before* demuxing. That's why I told you to
> use large values for "-probesize" and "-analyzeduration". They tell
> ffmpeg to look deeply into the video before deciding which input
> streams are available. Then "-map 0" would pick them up for the
> output, or you could select them with "-map 0:s:N".
>
> (Possibly, you can derive useful values for "-probesize" and "-analyzeduration"
> from "pos:26746894" and "DTS:31.2s", but I'm not sure. For unknown
> input VOBs, you may need to specify the maximum possible values, which
> would be 9223372036854775807.)

I got the same results with that. Does it matter at which position I put
these arguments and does it last to use only one of the two?

$ ffmpeg -i
"concat:002-C001/VLuN-001.vob|002-C002/VLuN-001.vob|002-C003/VLuN-001.vob|002-C004/VLuN-001.vob|002-C005/VLuN-001.vob|002-C006/VLuN-001.vob|002-C007/VLuN-001.vob|002-C008/VLuN-001.vob|002-C009/VLuN-001.vob|002-C010/VLuN-001.vob|002-C011/VLuN-001.vob|002-C012/VLuN-001.vob|002-C013/VLuN-001.vob|002-C014/VLuN-001.vob|002-C015/VLuN-001.vob|002-C016/VLuN-001.vob"
-probesize 9223372036854775807 -analyzeduration 7000000000 -map 0 -vf
crop=720:552 -c:v libx264 -c:a copy -t 06:00 -movflags +faststart
/media/Sicherung/Filme/VLuN/ffmpeg/002/VLuN_6m.mp4
ffmpeg version 4.1-static https://johnvansickle.com/ffmpeg/  Copyright
(c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  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-libaom --enable-libfribidi
--enable-libass --enable-libvmaf --enable-libfreetype
--enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus
--enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzimg
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mpeg, from
'concat:002-C001/VLuN-001.vob|002-C002/VLuN-001.vob|002-C003/VLuN-001.vob|002-C004/VLuN-001.vob|002-C005/VLuN-001.vob|002-C006/VLuN-001.vob|002-C007/VLuN-001.vob|002-C008/VLuN-001.vob|002-C009/VLuN-001.vob|002-C010/VLuN-001.vob|002-C011/VLuN-001.vob|002-C012/VLuN-001.vob|002-C013/VLuN-001.vob|002-C014/VLuN-001.vob|002-C015/VLuN-001.vob|002-C016/VLuN-001.vob':
  Duration: 01:46:25.22, start: 0.280000, bitrate: 7663 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top
first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:4[0x83]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:5[0x84]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
File '/media/Sicherung/Filme/VLuN/ffmpeg/002/VLuN_6m.mp4' already
exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
  Stream #0:5 -> #0:5 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x5cd1cc0] using SAR=64/45
[libx264 @ 0x5cd1cc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1
Cache64
[libx264 @ 0x5cd1cc0] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x5cd1cc0] 264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - 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=3
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 @ 0x5cd0dc0] track 1: codec frame size is not set
[mp4 @ 0x5cd0dc0] track 2: codec frame size is not set
[mp4 @ 0x5cd0dc0] track 3: codec frame size is not set
[mp4 @ 0x5cd0dc0] track 4: codec frame size is not set
[mp4 @ 0x5cd0dc0] track 5: codec frame size is not set
Output #0, mp4, to '/media/Sicherung/Filme/VLuN/ffmpeg/002/VLuN_6m.mp4':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
720x552 [SAR 64:45 DAR 128:69], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp,
192 kb/s
    Stream #0:2: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp,
192 kb/s
    Stream #0:3: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp,
192 kb/s
    Stream #0:4: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp,
192 kb/s
    Stream #0:5: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp,
192 kb/s
frame=   98 fps=0.0 q=28.0 size=       0kB time=00:00:03.84 bitrate=  
0.1kbits/frame=  128 fps=126 q=28.0 size=     256kB time=00:00:04.89
bitrate= 428.4kbits/frame=  150 fps= 99 q=28.0 size=     512kB
time=00:00:05.82 bitrate= 720.2kbits/frame=  175 fps= 87 q=28.0
size=     768kB time=00:00:06.84 bitrate= 918.8kbits/frame=  199 fps= 79
q=28.0 size=     768kB time=00:00:07.80 bitrate= 805.8kbits/frame=  227
fps= 75 q=28.0 size=    1024kB time=00:00:08.86 bitrate=
946.4kbits/frame=  253 fps= 71 q=28.0 size=    1280kB time=00:00:09.88
bitrate=1060.5kbits/frame=  281 fps= 68 q=28.0 size=    1536kB
time=00:00:11.07 bitrate=1136.5kbits/frame=  316 fps= 68 q=28.0 size=   
1536kB time=00:00:12.51 bitrate=1005.7kbits/frame=  335 fps= 65 q=28.0
size=    1792kB time=00:00:13.24 bitrate=1108.1kbits/frame=  358 fps= 63
q=28.0 size=    1792kB time=00:00:14.04 bitrate=1045.0kbits/frame=  377
fps= 61 q=28.0 size=    2048kB time=00:00:14.94
bitrate=1122.7kbits/frame=  397 fps= 59 q=28.0 size=    2048kB
time=00:00:15.77 bitrate=1063.5kbits/frame=  416 fps= 58 q=28.0 size=   
2304kB time=00:00:16.44 bitrate=1147.5kbits/frame=  436 fps= 57 q=28.0
size=    2304kB time=00:00:17.24 bitrate=1094.3kbits/frame=  454 fps= 55
q=28.0 size=    2560kB time=00:00:17.92 bitrate=1170.3kbits/frame=  473
fps= 54 q=28.0 size=    2560kB time=00:00:18.75
bitrate=1118.4kbits/frame=  490 fps= 53 q=28.0 size=    2816kB
time=00:00:19.39 bitrate=1189.6kbits/frame=  507 fps= 52 q=28.0 size=   
2816kB time=00:00:20.09 bitrate=1147.9kbits/frame=  526 fps= 51 q=28.0
size=    2816kB time=00:00:20.80 bitrate=1109.1kbits/frame=  545 fps= 50
q=28.0 size=    3072kB time=00:00:21.66 bitrate=1161.7kbits/frame=  562
fps= 50 q=28.0 size=    3072kB time=00:00:22.33
bitrate=1126.7kbits/frame=  583 fps= 49 q=28.0 size=    3328kB
time=00:00:23.04 bitrate=1183.3kbits/frame=  604 fps= 49 q=28.0 size=   
3584kB time=00:00:23.96 bitrate=1225.0kbits/frame=  677 fps= 53 q=28.0
size=    3840kB time=00:00:26.84 bitrate=1171.7kbits/[mpeg @ 0x5c7dc40]
New subtitle stream 0:6 at pos:26595342 and DTS:31.08s
[mpeg @ 0x5c7dc40] New subtitle stream 0:7 at pos:26603534 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:8 at pos:26607630 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:9 at pos:26611726 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:10 at pos:26615822 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:11 at pos:26619918 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:12 at pos:26624014 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:13 at pos:26669070 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:14 at pos:26673166 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:15 at pos:26677262 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:16 at pos:26685454 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:17 at pos:26695694 and DTS:31.16s
[mpeg @ 0x5c7dc40] New subtitle stream 0:18 at pos:26746894 and DTS:31.2s
frame=  778 fps= 58 q=28.0 size=    4352kB time=00:00:30.88
bitrate=1154.5kbits/
[.....]
frame= 8992 fps= 29 q=28.0 size=   94464kB time=00:05:59.48
bitrate=2152.6kbits/[mp4 @ 0x5cd0dc0] Starting second pass: moving the
moov atom to the beginning of the file
frame= 9000 fps= 28 q=-1.0 Lsize=   95835kB time=00:05:59.96
bitrate=2181.0kbits/s speed=1.13x   
video:53286kB audio:42188kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.378327%
[libx264 @ 0x5cd1cc0] frame I:86    Avg QP:20.07  size: 43752
[libx264 @ 0x5cd1cc0] frame P:2517  Avg QP:22.67  size: 12540
[libx264 @ 0x5cd1cc0] frame B:6397  Avg QP:26.19  size:  3007
[libx264 @ 0x5cd1cc0] consecutive B-frames:  2.7%  5.0%  8.1% 84.2%
[libx264 @ 0x5cd1cc0] mb I  I16..4: 13.2% 62.7% 24.0%
[libx264 @ 0x5cd1cc0] mb P  I16..4:  0.9%  8.0%  1.9%  P16..4: 32.1%
18.3% 11.7%  0.0%  0.0%    skip:27.2%
[libx264 @ 0x5cd1cc0] mb B  I16..4:  0.1%  0.9%  0.2%  B16..8: 38.4% 
6.1%  1.4%  direct: 2.4%  skip:50.5%  L0:40.1% L1:46.3% BI:13.5%
[libx264 @ 0x5cd1cc0] 8x8 transform intra:71.9% inter:67.7%
[libx264 @ 0x5cd1cc0] coded y,uvDC,uvAC intra: 77.0% 68.0% 24.1% inter:
19.3% 12.9% 0.3%
[libx264 @ 0x5cd1cc0] i16 v,h,dc,p: 55% 13%  5% 27%
[libx264 @ 0x5cd1cc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 10% 15%  7%  8%
11%  7% 12%  7%
[libx264 @ 0x5cd1cc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29%  9% 11%  7%  9%
13%  6% 10%  5%
[libx264 @ 0x5cd1cc0] i8c dc,h,v,p: 54% 13% 26%  7%
[libx264 @ 0x5cd1cc0] Weighted P-Frames: Y:19.0% UV:4.4%
[libx264 @ 0x5cd1cc0] ref P L0: 54.5% 20.5% 17.4%  6.7%  0.8%
[libx264 @ 0x5cd1cc0] ref B L0: 90.5%  7.6%  1.9%
[libx264 @ 0x5cd1cc0] ref B L1: 96.5%  3.5%
[libx264 @ 0x5cd1cc0] kb/s:1212.55



More information about the ffmpeg-user mailing list