RopeySim
RopeySim

Reputation: 511

In FFmpeg, can -filter_complex do everything that -filter can? (i.e., is it a direct replacement)

This may seem like a strange question but... is it possible to do everything -filter can do using only -filter_complex filters? That is, is there anything that -filter can do, that is not possible with -filter_complex?

Upvotes: 2

Views: 1291

Answers (2)

Arnon Weinberg
Arnon Weinberg

Reputation: 901

No, -filter_complex is not a substitute for -filter. Specifically:

The point of -filter_complex is that there is no 1:1 map between input and output. Therefore there is no map to decide which metadata to copy.

Moreover, there is no simple workaround to this limitation. To preserve per-stream metadata, use -filter whenever possible. With -filter_complex, stream metadata would have to be mapped manually for all streams in the output file (using 1 -map_metadata:s per stream).

Upvotes: 2

Gyan
Gyan

Reputation: 93319

Yes. -filter and -filter_complex / -lavfi both set up a filtergraph. The difference is that the latter can be fed with multiple inputs and can supply multiple outputs. -filter is limited to one input and one output stream. There is a hack to introduce additional inputs in -filter using source filters but that is not advised. All filters that can be used in -filter can be used in -filter_complex.

Note that if you specify filtering for a conditionally mapped stream (-map 0:a:1?), and that stream does not exist, the command will proceed with -filter but not with -filter_complex.

Upvotes: 3

Related Questions