Body: <p>Suppose I import three videos:</p>
  <pre><code>-i 'video0.mov'
  -i 'video1.mov'
  -i 'video2.mov'
  </code></pre>
  <p>Then I open a filter_complex. I can send the videos filters by referring to their number, which ffmpeg documentation calls &quot;file_index&quot;: <code>[0]</code>, <code>[1]</code>, and <code>[2]</code>.</p>
  <p>This is fine, but suppose I come back later and remove everything related to video1.mov and the line that imports it. Now <code>[1]</code> refers to video3.mov and there is no <code>[2]</code> at all.</p>
  <p>In the filtergraph I can apply a label by sending the video to a labeled output, ie:</p>
  <pre><code>[0] copy [video0]
  </code></pre>
  <p>but I have to be able to address the original file_index first.</p>
  <p>I'm trying to do irritatingly complicated things with scripts, which include things like &quot;import a png and overlay it, or not, based on a boolean setting&quot;. Once you have more than one import line that may or may not happen, labeling becomes an issue.</p>
  <p>Is there any way to apply a label to an input at the time of import, so I never have to use file_index and won't break anything if the number or order of imports changes?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-06T04:27:07.393Z
Comments.Text: Not possible. Feel free to open an enhancement ticket at trac.ffmpeg.org. See 'Submitting a bug report'
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-06T07:31:26.393Z
Comments.Text: @Gyan Will do, thank you.
Comments.UserDisplayName: Robert
Tags: <ffmpeg><script>
Title: Can I label streams during import in ffmpeg?
UserDisplayName: Robert
ThreadText: # Can I label streams during import in ffmpeg?
  
  (Asked by: username_0 on 2022-08-05)
  
  Suppose I import three videos:
  
  ```
  -i 'video0.mov'
  -i 'video1.mov'
  -i 'video2.mov'
  
  ```
  
  Then I open a filter\_complex. I can send the videos filters by referring to their number, which ffmpeg documentation calls "file\_index": `[0]`, `[1]`, and `[2]`.
  
  This is fine, but suppose I come back later and remove everything related to video1.mov and the line that imports it. Now `[1]` refers to video3.mov and there is no `[2]` at all.
  
  In the filtergraph I can apply a label by sending the video to a labeled output, ie:
  
  ```
  [0] copy [video0]
  
  ```
  
  but I have to be able to address the original file\_index first.
  
  I'm trying to do irritatingly complicated things with scripts, which include things like "import a png and overlay it, or not, based on a boolean setting". Once you have more than one import line that may or may not happen, labeling becomes an issue.
  
  Is there any way to apply a label to an input at the time of import, so I never have to use file\_index and won't break anything if the number or order of imports changes?
  
  **Tags:** ffmpeg, script
  
  > **Comments:**
  > **username_1**: Not possible. Feel free to open an enhancement ticket at trac.ffmpeg.org. See 'Submitting a bug report'  
  > **username_0**: @username_1 Will do, thank you.  
  
  ---
  
  ## 0 answers
  
  