<p>Yes, method 2 is suitable. Add something like <code>enable=0</code></p>

CC BY-SA 4.0
2020-10-27T19:07:02.990Z
2020-10-27T19:07:02.990Z
Gyan
<p>Background:  I have a script which needs to apply a variable number (from zero to 'a few') <a href="https://ffmpeg.org/ffmpeg-filters.html#drawtext" rel="nofollow noreferrer">drawtext</a>  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.</p>
<p>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.</p>
<p>I could think of a couple ways to possibly do this:</p>
<ol>
<li>pass a null string as the 'text' value?  I think this would require explicit support within that specific filter?</li>
<li>pass some values using <a href="https://ffmpeg.org/ffmpeg-filters.html#Timeline-editing" rel="nofollow noreferrer">timeline editing</a> that end up making the filter do nothing?  Are there well-known values here (something like &quot;if frame number is less than zero&quot;) that are valid but would always evaluate as false?</li>
</ol>
<p>I'm sure there are many other possibilities - I'm hoping someone has already cracked this particular nut.</p>
<p>Is my thinking correct that <em>most</em> 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?</p>
<p>(I <strong>think</strong> 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...)</p>

<ffmpeg><transcoding><performance>
can I use ffmpeg drawtext filter as a passthrough/identity filter? (and/or performance question)
ljwobker
# can I use ffmpeg drawtext filter as a passthrough/identity filter? (and/or performance question)

(Asked by: username_0 on 2020-10-27)

Background: I have a script which needs to apply a variable number (from zero to 'a few') [drawtext](https://ffmpeg.org/ffmpeg-filters.html#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:

1. pass a null string as the 'text' value? I think this would require explicit support within that specific filter?
2. pass some values using [timeline editing](https://ffmpeg.org/ffmpeg-filters.html#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...)

**Tags:** ffmpeg, transcoding, performance


---

## 1 answers

### Answer by username_1 on 2020-10-27. Score: 1

Yes, method 2 is suitable. Add something like `enable=0`


---

