[FFmpeg-user] concat protocol - 3 objectives

Moritz Barsnick barsnick at gmx.net
Tue Feb 25 10:47:17 EET 2020


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


More information about the ffmpeg-user mailing list