Background: I have a script which needs to apply a variable number (from zero to 'a few') drawtext filters to a base stream, and I'm trying to balance performance and coding/maintenance concerns. The coding concern here is that I want to be able to use the same base code for each possible filter even though some of them won't be enabled for a given execution of the program.
So... the question: is there an explicit identity or passthrough option for the drawtext filter? In an ideal world, there would be some option to leave the filter as part of the graph, but tell the code that this particular instance of the drawtext filter should just be an identity filter: said another this is a 'do nothing' or 'passthrough' filter with minimal performance impact.
I could think of a couple ways to possibly do this:
- pass a null string as the 'text' value? I think this would require explicit support within that specific filter?
- pass some values using timeline editing that end up making the filter do nothing? Are there well-known values here (something like "if frame number is less than zero") that are valid but would always evaluate as false?
I'm sure there are many other possibilities - I'm hoping someone has already cracked this particular nut.
Is my thinking correct that most of the compute effort ends up being in the actual filtering and the subsequent encoding, rather than the act of passing the frames into and out of the filter?
(I think this should be here rather that a different stackoverflow sub-site, but if this is better suited for some other place, feel free to either move it or let me know and I'll move it...)