[FFmpeg-user] Concat filter with more than 1 audio stream -- How?
Mark Filipak
markfilipak.windows+ffmpeg at gmail.com
Mon Feb 24 03:06:41 EET 2020
On 02/23/2020 07:05 PM, Carl Eugen Hoyos wrote:
> Am Mo., 24. Feb. 2020 um 00:42 Uhr schrieb Mark Filipak
> <markfilipak.windows+ffmpeg at gmail.com>:
>
>> Here:
>> https://trac.ffmpeg.org/wiki/Concatenate
>> I see this:
>> ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy output.ts
>
> Better use "cat" to concatenate transport streams if you don't
> want to re-encode.
>
> (You are missing -map 0 but this is not the best solution for
> your issue.)
>
>> https://ffmpeg.org/ffmpeg-filters.html#concat
>
> This is the documentation of a filter, you are using a protocol above.
>
> Carl Eugen
Using this:
ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex
'[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
concat=n=3:v=1:a=2 [v] [a1] [a2]' -map '[v]' -map '[a1]' -map '[a2]'
output.mkv
as a template, I wrote this:
ffmpeg -i i:\VIDEO_TS\VTS_02_1.VOB -i i:\VIDEO_TS\VTS_02_2.VOB -i
i:\VIDEO_TS\VTS_02_3.VOB -i i:\VIDEO_TS\VTS_02_4.VOB -i
i:\VIDEO_TS\VTS_02_5.VOB -filter_complex '[0:1] [0:2] [0:3] [0:4] [0:5]
concat=n=5:v=1:a=4 [v] [a1] [a2] [a3] [a4]' -map '[v]' -map '[a1]' -map
'[a2]' -map '[a3]' -map '[a4]' n:\output.mkv
and I got this:
C:\CMD & tiny apps\ffmpeg>ffmpeg -i i:\VIDEO_TS\VTS_02_1.VOB -i
i:\VIDEO_TS\VTS_02_2.VOB -i i:\VIDEO_TS\VTS_02_3.VOB -i
i:\VIDEO_TS\VTS_02_4.VOB -i i:\VIDEO_TS\VTS_02_5.VOB -filter_complex
'[0:1] [0:2] [0:3] [0:4] [0:5] concat=n=5:v=1:a=4 [v] [a1] [a2] [a3]
[a4]' -map '[v]' -map '[a1]' -map '[a2]' -map '[a3]' -map '[a4]'
n:\output.mkv
ffmpeg version N-94664-g0821bc4eee Copyright (c) 2000-2019 the FFmpeg
developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libdav1d --enable-libbluray --enable-libfreetype
--enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora
--enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
--enable-lzma --enable-zlib --enable-gmp --enable-libvidstab
--enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
--enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
--enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va
--enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.101 / 58. 55.101
libavformat 58. 31.104 / 58. 31.104
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.101 / 7. 58.101
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpeg, from 'i:\VIDEO_TS\VTS_02_1.VOB':
Duration: 00:19:19.04, start: 0.041500, bitrate: 7411 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top
first), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps, 29.97
tbr, 90k tbn, 59.94 tbc
Stream #0:2[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:3[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:5[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
[mpeg2video @ 0000016ac2ccac40] Invalid frame dimensions 0x0.
Last message repeated 2 times
Input #1, mpeg, from 'i:\VIDEO_TS\VTS_02_2.VOB':
Duration: 00:24:02.08, start: 1159.049500, bitrate: 5956 kb/s
Stream #1:0[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #1:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top
first), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps, 29.97
tbr, 90k tbn, 59.94 tbc
Stream #1:2[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #1:3[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #1:4[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #1:5[0x1bf]: Data: dvd_nav_packet
Input #2, mpeg, from 'i:\VIDEO_TS\VTS_02_3.VOB':
Duration: 00:26:05.34, start: 2601.161500, bitrate: 5487 kb/s
Stream #2:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps,
59.94 tbr, 90k tbn, 59.94 tbc
Stream #2:1[0x1bf]: Data: dvd_nav_packet
Stream #2:2[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #2:3[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #2:4[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #2:5[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #2:6[0x20]: Subtitle: dvd_subtitle
[mpeg2video @ 0000016ac36721c0] Invalid frame dimensions 0x0.
Last message repeated 5 times
Input #3, mpeg, from 'i:\VIDEO_TS\VTS_02_4.VOB':
Duration: 00:23:46.91, start: 4166.505500, bitrate: 6019 kb/s
Stream #3:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps,
59.94 tbr, 90k tbn, 59.94 tbc
Stream #3:1[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #3:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #3:3[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #3:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #3:5[0x1bf]: Data: dvd_nav_packet
Stream #3:6[0x20]: Subtitle: dvd_subtitle
[mpeg2video @ 0000016ac2cc2940] Invalid frame dimensions 0x0.
Last message repeated 4 times
Input #4, mpeg, from 'i:\VIDEO_TS\VTS_02_5.VOB':
Duration: 00:10:40.83, start: 5593.417500, bitrate: 5775 kb/s
Stream #4:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps,
59.94 tbr, 90k tbn, 59.94 tbc
Stream #4:1[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #4:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #4:3[0x83]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #4:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #4:5[0x1bf]: Data: dvd_nav_packet
[AVFilterGraph @ 0000016ac31b6cc0] No such filter: '[0:1]'
Error initializing complex filters.
Invalid argument
Sigh! What's going wrong?
More information about the ffmpeg-user
mailing list