concat protocol - 3 objectives
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 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
The concat protocol command at the end of this message works, but with limits. Since the concat protocol basically works, it seems logical to me to simply expand its capability. To that end, I now have 3 objectives. Objective 1: Expand it to include all 4 audio streams, not just the first 5.1 channel stream encountered (which happens to be the isolated score). Objective 2: Output it as an MKV, not as a TS. Objective 3: Include subtitles. Regarding Objective 1: I tried to apply '-filter_complex' but couldn't figure out how to form a working command line and had to gave up. Regarding Objective 2: Simply specifying 'n:\output.mkv' fails [matroska @ 0000016de19500c0] 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=0.0594x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed! Regarding Objective 3: Though a subtitle stream is not reported, the 5 concatenated sources do have subtitles. However, I think I have to get a matroska container working before attempting to include the subtitles, so this objective will have to wait. Note that from ffprobe, I can see that the video & audio stream numbers change from one VOB to another. But ffmpeg apparently can track them automatically -- I write that with confidence because, when I play 'output.ts', the single audio stream that gets into 'output.ts' (i.e., the isolated score) is constant and doesn't suddenly become dialog in the middle. Can anyone suggest how I can meet any of my objectives? Warm Regards, Mark. 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 Output #0, mpegts, to 'n:\output.ts': Metadata: encoder : Lavf58.31.104 Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc Stream #0:1: Audio: ac3, 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 [mpegts @ 0000023c737c00c0] 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 [mpeg @ 0000023c731a9000] New subtitle stream 0:6 at pos:116221966 and DTS:120.328speed=12.9x frame=159684 fps=2310 q=-1.0 Lsize= 4048589kB time=01:43:54.17 bitrate=5320.0kbits/s speed=90.2x video:3573203kB audio:340933kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.435060%
On 02/24/2020 07:29 PM, Mark Filipak wrote:
The concat protocol command at the end of this message works, but with limits. Since the concat protocol basically works, it seems logical to me to simply expand its capability. To that end, I now have 3 objectives.
Objective 1: Expand it to include all 4 audio streams, not just the first 5.1 channel stream encountered (which happens to be the isolated score).
Done.
Objective 2: Output it as an MKV, not as a TS. > Objective 3: Include subtitles.
Regarding Objective 2: Simply specifying 'n:\output.mkv' fails
[matroska @ 0000016de19500c0] 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=0.0594x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed!
Regarding Objective 3: Though a subtitle stream is not reported, the 5 concatenated sources do have subtitles. However, I think I have to get a matroska container working before attempting to include the subtitles, so this objective will have to wait.
Note that from ffprobe, I can see that the video & audio stream numbers change from one VOB to another. But ffmpeg apparently can track them automatically -- I write that with confidence because, when I play 'output.ts', the single audio stream that gets into 'output.ts' (i.e., the isolated score) is constant and doesn't suddenly become dialog in the middle.
Can anyone suggest how I can meet any of my objectives?
Warm Regards, Mark.
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 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 Output #0, mpegts, to 'n:\output.ts': Metadata: encoder : Lavf58.31.104 Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc Stream #0:1: Audio: ac3, 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 [mpegts @ 0000023c737c00c0] 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 [mpeg @ 0000023c731a9000] New subtitle stream 0:6 at pos:116221966 and DTS:120.328speed=12.9x frame=159684 fps=2310 q=-1.0 Lsize= 4048589kB time=01:43:54.17 bitrate=5320.0kbits/s speed=90.2x video:3573203kB audio:340933kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.435060%
On 2/24/2020 4:29 PM, Mark Filipak wrote:
Regarding Objective 3: Though a subtitle stream is not reported, the 5 concatenated sources do have subtitles. However, I think I have to get a matroska container working before attempting to include the subtitles, so this objective will have to wait.
Just confirming- You're aware that dvd subtitles are actually overlay images, not encoded text? Also, consider adding a long -analyzeduration and -probesize, unless the subtitle stream start quickly, the default values won't find it/them. (I've had movies where the subs started at least 60-80 seconds into the content.) I'd start with at least 500M, and if that doesn't immediately turn up the subs stream, double until it does. I'm curious about this- [mpeg @ 0000023c731a9000] New subtitle stream 0:6 at pos:116221966 and DTS:120.328speed=12.9x frame=159684 fps=2310 q=-1.0 Lsize= 4048589kB time=01:43:54.17 that says the subtitles didn't start very well into the content, probably into file 3 or 4 (?). Is it possible that not all streams were copied when the vob files were collected? FWIW, I've had very good luck ripping dvds with "dvddecrypter"; it's still available on the 'net and will output a single file with all streams if that's what you want. Later, z!
On 02/24/2020 11:59 PM, Carl Zwanzig wrote:
On 2/24/2020 4:29 PM, Mark Filipak wrote:
Regarding Objective 3: Though a subtitle stream is not reported, the 5 concatenated sources do have subtitles. However, I think I have to get a matroska container working before attempting to include the subtitles, so this objective will have to wait.
Just confirming-
You're aware that dvd subtitles are actually overlay images, not encoded text?
Yes, and I've yet to find a sub-extractor that works well. If I can extract to SUP, then I can use bdsup2sub++ to convert to SUB and not have to deal with text recognition. I like the results of bdsup2sub++, but extracting to SUP is ...problematic. It seems you have a good handle on the issue. Do you have any suggestions? I've tried SubRip and DVDSubEdit but each has shortcomings.
Also, consider adding a long -analyzeduration and -probesize, unless the subtitle stream start quickly, the default values won't find it/them. (I've had movies where the subs started at least 60-80 seconds into the content.) I'd start with at least 500M, and if that doesn't immediately turn up the subs stream, double until it does.
Thank you for that great tip. My test title has closed captions that start right away -- intro/credits song lyrics -- but actual subtitles don't begin until over 2 minutes running time.
I'm curious about this- [mpeg @ 0000023c731a9000] New subtitle stream 0:6 at pos:116221966 and DTS:120.328speed=12.9x frame=159684 fps=2310 q=-1.0 Lsize= 4048589kB time=01:43:54.17
I noticed that too, but didn't know what to make of it.
that says the subtitles didn't start very well into the content, probably into file 3 or 4 (?). Is it possible that not all streams were copied when the vob files were collected?
I'm working with an mounted ISO. The ISO was made via AnyDVD HD. I have a lot of faith in that program.
FWIW, I've had very good luck ripping dvds with "dvddecrypter"; it's still available on the 'net and will output a single file with all streams if that's what you want.
Thanks! I'll give it a look.
Later,
z!
Cheers, Mark.
I'll pitch in on this, even though you marked one item as "done", and Carl answered another. On Mon, Feb 24, 2020 at 19:29:34 -0500, Mark Filipak wrote:
Objective 1: Expand it to include all 4 audio streams, not just the first 5.1 channel stream encountered (which happens to be the isolated score).
By default (i.e. if not told to do differently, ffmpeg *one* each of video, audio, and subtitle streams from its inputs. This is very well described here: https://ffmpeg.org/ffmpeg.html#Automatic-stream-selection and also here: https://trac.ffmpeg.org/wiki/Map In order to let ffmpeg map *all* input streams, without having to mention e.g. each individual audio and data track, use "-map 0". Note that ffmpeg will still skip unknown data tracks. For the (data) copy codec, this behavior can be changed with "-copy_unknown".
Objective 2: Output it as an MKV, not as a TS.
As already mentioned: Just make the output Matroska. The issue you are seeing is specific to your inputs.
Objective 3: Include subtitles.
Amending or rephrasing what Carl wrote: MPEG Transport streams (MPEG-TS) and MPEG Program streams (MPEG-PS, as also found in DVD/BLu Ray VOBs) have the property of allowing streams to appear at a later time/position. (I'll gladly take note of other formats where this applies, do please tell me.) ffmpeg only probes a certain depth into the container to understand what can be found. If you are missing streams you know to be there, you must increase the "-analyzeduration" and "-probesize". (In my experience, you may need to actually increase both.) You cannot select a stream which was not discovered by ffmpeg. Quoting Carl's observation
[mpeg @ 0000023c731a9000] New subtitle stream 0:6 at pos:116221966
This tells you how many bytes into the overall container this stream was discovered by ffmpeg.
Regarding Objective 1: I tried to apply '-filter_complex' but couldn't figure out how to form a working command line and had to gave up.
As I wrote in the other thread yesterday, I have no explanation for this:
[AVFilterGraph @ 0000016ac31b6cc0] No such filter: '[0:1]'
And recommend you to use "-loglevel debug" to debug ffmpeg's command line parsing.
Regarding Objective 2: Simply specifying 'n:\output.mkv' fails
[matroska @ 0000016de19500c0] 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=0.0594x video:8kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.697883% Conversion failed!
As Nicolas mentioned, you may have the representation of a file system from a DVD here. VOBs contain not only streams, but also indexes, menus, copy protection junk, and perhaps more. ffmpeg cannot handle this complexity of such VOBs. You need other tools to unmangle them, I believe a Windows tool was mentioned already.
Regarding Objective 3: Though a subtitle stream is not reported, the 5 concatenated sources do have subtitles. However, I think I have to get a matroska container working before attempting to include the subtitles, so this objective will have to wait.
Especially since DVD subtitles are most likely codec "dvdsub", which are not easily muxed into other containers. Matroska may work though, and VLC might even be able to play the rip. Just saying: You may encounter more difficulties. Cheers, Moritz
Moritz Barsnick (12020-02-25):
Matroska may work though,
Probably not, alas: the Matroska spec requires subtitles packets to have a duration, but the duration of DVD subtitles is not encoded in the MPEG packets but in their bitstream. The generated Matroska files will be invalid; they may work with some players, though. Regards, -- Nicolas George
Mark Filipak (12020-02-24):
Since the concat protocol basically works
No, it doesn't. Not for that:
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"
As I said earlier, to read these files, you need a library that is aware of the structure of DVD-Video. FFmpeg doesn't have it. Regards, -- Nicolas George
On 02/25/2020 03:48 AM, Nicolas George wrote:
Mark Filipak (12020-02-24):
Since the concat protocol basically works
No, it doesn't. Not for that:
Thank you, Nicolas, It does work. I'm watching it via MPV right now. The full line is: 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" -map 0 -c copy n:\output.ts
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"
As I said earlier, to read these files, you need a library that is aware of the structure of DVD-Video. FFmpeg doesn't have it.
Sure ff* is aware of VOB containers. I believe the demuxer is mpegts but I may be wrong.
Regards,
Thanks again, Mark.
participants (4)
-
Carl Zwanzig -
Mark Filipak -
Moritz Barsnick -
Nicolas George