Concat filter with more than 1 audio stream -- How?
Here: https://trac.ffmpeg.org/wiki/Concatenate I see this: ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy output.ts so I tried it! WHAT WORKED: ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy n:\output.ts But there's only 1 audio stream. According to this: https://ffmpeg.org/ffmpeg-filters.html#concat I need to specify options 'n' 'v' & 'a'. But the examples don't look anything like WHAT WORKED. How do I integrate 'n' 'v' & 'a' into WHAT WORKED? Warm Regards, Mark.
Am Mo., 24. Feb. 2020 um 00:42 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@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.)
This is the documentation of a filter, you are using a protocol above. Carl Eugen
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@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.
I'm just trying to find WHAT WORKS. In this case, WHAT WORKS is the above. I tried making the output 'n:\output.mkv' but ffmpeg complained. Eventually I want to convert the TS container to MKV, but first, I need to get all the audio tracks into the TS container.
(You are missing -map 0 but this is not the best solution for your issue.)
?
This is the documentation of a filter, you are using a protocol above.
Do you have any idea how I can specify 'n' 'v' & 'a' in this case?
Am Mo., 24. Feb. 2020 um 01:45 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
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@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.
I'm just trying to find WHAT WORKS.
If you want to concatenate mpeg streams, use "cat" (or "copy /b" on windows)
In this case, WHAT WORKS is the above.
Sorry, I was under the impression you posted here because you expect us to know more about it than you do. Please ignore my answers if I misunderstood.
I tried making the output 'n:\output.mkv' but ffmpeg complained. Eventually I want to convert the TS container to MKV, but first, I need to get all the audio tracks into the TS container.
(You are missing -map 0 but this is not the best solution for your issue.)
?
You are missing -map 0 but if you want to concatenate (and not re-encode) than you should not use FFmpeg.
This is the documentation of a filter, you are using a protocol above.
Do you have any idea how I can specify 'n' 'v' & 'a' in this case?
You cannot because the documentation is for a filter but you are using a protocol (they - fortunately! - share a name, as does a demuxer). Note that I am not suggesting you use the filter, for mpeg streams, you should use the protocol, it is (much) simpler. Carl Eugen
On 02/24/2020 05:50 AM, Carl Eugen Hoyos wrote:
Am Mo., 24. Feb. 2020 um 01:45 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
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@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.
I'm just trying to find WHAT WORKS.
If you want to concatenate mpeg streams, use "cat" (or "copy /b" on windows)
If I understand correctly, you think I should do this: copy /b i:\VIDEO_TS\VTS_02_1.VOB+i:\VIDEO_TS\VTS_02_2.VOB+i:\VIDEO_TS\VTS_02_3.VOB+i:\VIDEO_TS\VTS_02_4.VOB+i:\VIDEO_TS\VTS_02_5.VOB What would the output be? How could I ever insert chapters & subtitles into it? I need to eventually get an MKV, I think.
In this case, WHAT WORKS is the above.
Sorry, I was under the impression you posted here because you expect us to know more about it than you do.
By "WHAT WORKS is the above", I refer to this: ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy output.ts which is from the wiki, not from me. I tested it and it works, however, output.ts has only 1 audio stream while the inputs have 4 audio streams. That's why I ask "Concat filter with more than 1 audio stream -- How?" You tell me that I'm trying to use a concat protocol. How would I know that?
Please ignore my answers if I misunderstood.
I would never ignore your answers. But sometimes, I have difficulty understanding them. ...my fault, I'm sure.
I tried making the output 'n:\output.mkv' but ffmpeg complained. Eventually I want to convert the TS container to MKV, but first, I need to get all the audio tracks into the TS container.
(You are missing -map 0 but this is not the best solution for your issue.)
?
You are missing -map 0 but if you want to concatenate (and not re-encode) than you should not use FFmpeg.
I give... What do you mean? I should not use ffmpeg?
Note that I am not suggesting you use the filter, for mpeg streams, you should use the protocol, it is (much) simpler.
I should not use ffmpeg, but I should use the protocol? Now I'm totally mystified.
Am Mo., 24. Feb. 2020 um 12:22 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
If I understand correctly, you think I should do this:
copy /b i:\VIDEO_TS\VTS_02_1.VOB+i:\VIDEO_TS\VTS_02_2.VOB+i:\VIDEO_TS\VTS_02_3.VOB+i:\VIDEO_TS\VTS_02_4.VOB+i:\VIDEO_TS\VTS_02_5.VOB
You should use "copy /b" if you want to concatenate mpeg streams. (This is what the command line you provided indicated. If you don't want to concatenate mpeg streams but produce mkv files, then above is of course irrelevant for you.) If you need an mkv file, use ffmpeg -i concat:... ....mkv (Or as an alternative mkvmerge) I am not sure if you already read the wiki article about concatenation in FFmpeg. There are three ways, all three should be described in the wiki, all three have advantages and disadvantages, options for one of the concatenation methods will not work for the other two methods. If your input is mpeg streams, you can (and should) use the concat protocol. For most file types, the concat protocol will not work, you can use the concat demuxer or the concat filter in these cases. (Options defined and described for one of them will not work for the other one.) Carl Eugen
On 02/24/2020 06:46 AM, Carl Eugen Hoyos wrote:
Am Mo., 24. Feb. 2020 um 12:22 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
If I understand correctly, you think I should do this:
copy /b i:\VIDEO_TS\VTS_02_1.VOB+i:\VIDEO_TS\VTS_02_2.VOB+i:\VIDEO_TS\VTS_02_3.VOB+i:\VIDEO_TS\VTS_02_4.VOB+i:\VIDEO_TS\VTS_02_5.VOB
You should use "copy /b" if you want to concatenate mpeg streams. (This is what the command line you provided indicated. If you don't want to concatenate mpeg streams but produce mkv files, then above is of course irrelevant for you.)
If you need an mkv file, use ffmpeg -i concat:... ....mkv
Okay, you want me to try that form of concat. EXAMPLE (from the wiki): ffmpeg -i "concat:[_input_#1_]|[_input_#2_]|[_input_#3_]" -c copy output.ts THIS WORKS FOR ME: ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy n:\output.ts But I want an MKV, so I'll ignore that the '.ts' above has only 1 audio stream (which is the Isolated Score track) and I'll change'.ts' to '.mkv' as you recommend. C:\CMD & tiny apps\ffmpeg>ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy 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 'concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB': Duration: 01:43:54.21, start: 0.041500, bitrate: 6105 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 File 'n:\output.mkv' already exists. Overwrite ? [y/N] y Output #0, matroska, to 'n:\output.mkv': Metadata: encoder : Lavf58.31.104 Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 90k tbc Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:2 -> #0:1 (copy) Press [q] to stop, [?] for help [matroska @ 000001df5ecb00c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly [matroska @ 000001df5ecb00c0] Can't write packet with unknown timestamp av_interleaved_write_frame(): Invalid argument frame= 2 fps=0.0 q=-1.0 Lsize= 10kB time=00:00:00.00 bitrate=83856.0kbits/s speed=1.02x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed!
I am not sure if you already read the wiki article about concatenation in FFmpeg.
That's where I got the EXAMPLE.
Am Mo., 24. Feb. 2020 um 13:50 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>: [...] Please stop shouting here. Carl Eugen
On 02/24/2020 06:46 AM, Carl Eugen Hoyos wrote:
Am Mo., 24. Feb. 2020 um 12:22 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
If I understand correctly, you think I should do this:
copy /b
i:\VIDEO_TS\VTS_02_1.VOB+i:\VIDEO_TS\VTS_02_2.VOB+i:\VIDEO_TS\VTS_02_3.VOB+i:\VIDEO_TS\VTS_02_4.VOB+i:\VIDEO_TS\VTS_02_5.VOB
You should use "copy /b" if you want to concatenate mpeg streams. (This is what the command line you provided indicated. If you don't want to concatenate mpeg streams but produce mkv files, then above is of course irrelevant for you.)
If you need an mkv file, use ffmpeg -i concat:... ....mkv
Okay, you want me to try that form of concat. ===== Example ===== (from the wiki): ffmpeg -i "concat:[_input_#1_]|[_input_#2_]|[_input_#3_]" -c copy output.ts ===== This works for me ===== ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy n:\output.ts But I want an MKV, so I'll ignore that the '.ts' above has only 1 audio stream (which is the Isolated Score track) and I'll change'.ts' to '.mkv' as you recommend. C:\CMD & tiny apps\ffmpeg>ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy 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 'concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB': Duration: 01:43:54.21, start: 0.041500, bitrate: 6105 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 File 'n:\output.mkv' already exists. Overwrite ? [y/N] y Output #0, matroska, to 'n:\output.mkv': Metadata: encoder : Lavf58.31.104 Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 90k tbc Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:2 -> #0:1 (copy) Press [q] to stop, [?] for help [matroska @ 000001df5ecb00c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly [matroska @ 000001df5ecb00c0] Can't write packet with unknown timestamp av_interleaved_write_frame(): Invalid argument frame= 2 fps=0.0 q=-1.0 Lsize= 10kB time=00:00:00.00 bitrate=83856.0kbits/s speed=1.02x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed!
I am not sure if you already read the wiki article about concatenation in FFmpeg.
That's where I got the EXAMPLE.
Am Mo., 24. Feb. 2020 um 13:56 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
On 02/24/2020 06:46 AM, Carl Eugen Hoyos wrote:
Am Mo., 24. Feb. 2020 um 12:22 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
If I understand correctly, you think I should do this:
copy /b
i:\VIDEO_TS\VTS_02_1.VOB+i:\VIDEO_TS\VTS_02_2.VOB+i:\VIDEO_TS\VTS_02_3.VOB+i:\VIDEO_TS\VTS_02_4.VOB+i:\VIDEO_TS\VTS_02_5.VOB
You should use "copy /b" if you want to concatenate mpeg streams. (This is what the command line you provided indicated. If you don't want to concatenate mpeg streams but produce mkv files, then above is of course irrelevant for you.)
If you need an mkv file, use ffmpeg -i concat:... ....mkv
Okay, you want me to try that form of concat.
===== Example ===== (from the wiki): ffmpeg -i "concat:[_input_#1_]|[_input_#2_]|[_input_#3_]" -c copy output.ts
===== This works for me ===== ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy n:\output.ts
But I want an MKV, so I'll ignore that the '.ts' above has only 1 audio stream (which is the Isolated Score track) and I'll change'.ts' to '.mkv' as you recommend.
C:\CMD & tiny apps\ffmpeg>ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy 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 'concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB': Duration: 01:43:54.21, start: 0.041500, bitrate: 6105 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 File 'n:\output.mkv' already exists. Overwrite ? [y/N] y Output #0, matroska, to 'n:\output.mkv': Metadata: encoder : Lavf58.31.104 Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 90k tbc Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:2 -> #0:1 (copy) Press [q] to stop, [?] for help [matroska @ 000001df5ecb00c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly [matroska @ 000001df5ecb00c0] Can't write packet with unknown timestamp av_interleaved_write_frame(): Invalid argument frame= 2 fps=0.0 q=-1.0 Lsize= 10kB time=00:00:00.00 bitrate=83856.0kbits/s speed=1.02x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed!
I am not sure if you already read the wiki article about concatenation in FFmpeg.
That's where I got the EXAMPLE.
Above email does not contain a question afaict. Instead it still contains shouting. (And please remove the ridiculous section breaks, this is not a thesis.) If I should guess: mpeg2video remuxing should work with -fflags +genpts (untested) and you are still missing -map 0 Carl Eugen
On 02/24/2020 04:28 PM, Carl Eugen Hoyos wrote:
Am Mo., 24. Feb. 2020 um 13:56 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
On 02/24/2020 06:46 AM, Carl Eugen Hoyos wrote:
Am Mo., 24. Feb. 2020 um 12:22 Uhr schrieb Mark Filipak <markfilipak.windows+ffmpeg@gmail.com>:
If I understand correctly, you think I should do this:
copy /b
i:\VIDEO_TS\VTS_02_1.VOB+i:\VIDEO_TS\VTS_02_2.VOB+i:\VIDEO_TS\VTS_02_3.VOB+i:\VIDEO_TS\VTS_02_4.VOB+i:\VIDEO_TS\VTS_02_5.VOB
You should use "copy /b" if you want to concatenate mpeg streams. (This is what the command line you provided indicated. If you don't want to concatenate mpeg streams but produce mkv files, then above is of course irrelevant for you.)
If you need an mkv file, use ffmpeg -i concat:... ....mkv
Okay, you want me to try that form of concat.
===== Example ===== (from the wiki): ffmpeg -i "concat:[_input_#1_]|[_input_#2_]|[_input_#3_]" -c copy output.ts
===== This works for me ===== ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy n:\output.ts
But I want an MKV, so I'll ignore that the '.ts' above has only 1 audio stream (which is the Isolated Score track) and I'll change'.ts' to '.mkv' as you recommend.
C:\CMD & tiny apps\ffmpeg>ffmpeg -i "concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB" -c copy 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 'concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB|i:\VIDEO_TS\VTS_02_3.VOB|i:\VIDEO_TS\VTS_02_4.VOB|i:\VIDEO_TS\VTS_02_5.VOB': Duration: 01:43:54.21, start: 0.041500, bitrate: 6105 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 File 'n:\output.mkv' already exists. Overwrite ? [y/N] y Output #0, matroska, to 'n:\output.mkv': Metadata: encoder : Lavf58.31.104 Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 90k tbc Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:2 -> #0:1 (copy) Press [q] to stop, [?] for help [matroska @ 000001df5ecb00c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly [matroska @ 000001df5ecb00c0] Can't write packet with unknown timestamp av_interleaved_write_frame(): Invalid argument frame= 2 fps=0.0 q=-1.0 Lsize= 10kB time=00:00:00.00 bitrate=83856.0kbits/s speed=1.02x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed!
I am not sure if you already read the wiki article about concatenation in FFmpeg.
That's where I got the EXAMPLE.
Above email does not contain a question afaict.
Concat filter with more than 1 audio stream -- How? Carl, I think the best thing to do is to retire this thread. It's gotten seriously off-topic. I've posted a new thread: "concat protocol - 3 objectives" that has objectives that have better wording. Thanks, Mark.
Carl Eugen Hoyos (12020-02-24):
If you want to concatenate mpeg streams
But they are not MPEG streams:
"concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB
They are fragments of a DVD-Video filesystem. They should not be read directly. FFmpeg has no support for them. Regards, -- Nicolas George
On 2/24/20, Nicolas George <george@nsup.org> wrote:
Carl Eugen Hoyos (12020-02-24):
If you want to concatenate mpeg streams
But they are not MPEG streams:
"concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB
They are fragments of a DVD-Video filesystem. They should not be read directly. FFmpeg has no support for them.
How so they are not supported? What support is missing?
Regards,
-- Nicolas George
On Mon, Feb 24, 2020 at 16:59:27 +0100, Paul B Mahol wrote:
On 2/24/20, Nicolas George <george@nsup.org> wrote:
Carl Eugen Hoyos (12020-02-24):
If you want to concatenate mpeg streams
But they are not MPEG streams:
"concat:i:\VIDEO_TS\VTS_02_1.VOB|i:\VIDEO_TS\VTS_02_2.VOB
They are fragments of a DVD-Video filesystem. They should not be read directly. FFmpeg has no support for them.
How so they are not supported? What support is missing?
I believe reading the structures and indices, and skipping e.g. titles, menus, and notably junk, is missing. ffmpeg's own tools/dvd2concat is made to assist with that, with the help of lsdvd. ffmpeg itself would probably require a proper DVD structure aware demuxer[*]. Moritz [*] Or perhaps a layer on top of a demuxer, to expose the MPEG-PS. A pseudo-protocol? Not sure, but those are technicalities.
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@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.)
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?
On Sun, Feb 23, 2020 at 20:06:41 -0500, Mark Filipak wrote:
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
Note the leading 0, 1, 2 to denote ffmpeg's three inputs.
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
Note that you are using only leading '0's, so only the first input file will be used.
[AVFilterGraph @ 0000016ac31b6cc0] No such filter: '[0:1]'
I have no idea where that would come from. Could you use "-loglevel debug" to show how ffmpeg evaluates the command line? Thanks, Moritz
participants (5)
-
Carl Eugen Hoyos -
Mark Filipak -
Moritz Barsnick -
Nicolas George -
Paul B Mahol