Answers.Body: <p>It looks like an intermediary stream, as produced by the color filter, cannot be reused more than once, so we have to use the split filter on it:</p>
  
  <pre><code>color=c=Chartreuse:s=1920x1080:d=8640.059,setpts=PTS-STARTPTS[t];
  [t] split=2 [s0][s1];
  [1:v] trim=start=114.149:end=125.149,setpts=PTS-STARTPTS [v0];
  [s0][v0]overlay=0:0:enable='between(t,0,11)' [o0];
  [2:v] trim=start=115.629:end=123.629,setpts=PTS-STARTPTS [v1];
  [s1][v1]overlay=0:0:enable='between(t,11,19)' [o1];
  [o0][o1]concat=n=2:v=1:a=0 [vout]
  </code></pre>
  
  <p>I couldn't find any explicit documentation on that limitation, altough I'm sure it exists somewhere.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-06T16:43:22.297Z
Answers.Text: Workaround is to generate it as an input stream alongside other file inputs: `-i file -i file -f lavfi -i "color=c=Chartreuse...` and then ingest it repeatedly like other files `[2:v]...`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-06T16:32:41.663Z
Answers.LastActivityDate: 2018-04-06T16:32:41.663Z
Answers.UserDisplayName: Simon Labrecque
Answers.Body: <p>For future reference:</p>
  
  <p>as specified, you cannot reuse an intermediate stream more than once so you have 2 options:</p>
  
  <ol>
  <li>either save it, input the saved file and reuse it as many times you need in your filter;</li>
  </ol>
  
  <blockquote>
    <p><code>ffmpeg -i file1 -i file2 -i savedStream -filter_complex "..."</code></p>
  </blockquote>
  
  <ol start="2">
  <li>use the <a href="https://ffmpeg.org/ffmpeg-filters.html#split_002c-asplit" rel="noreferrer">split</a> filter and create as many outputs you need; default value for split is 2 outputs so:</li>
  </ol>
  
  <blockquote>
    <p><code>[o0]split[split1][split2]</code></p>
  </blockquote>
  
  <p>would be your case.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-27T12:11:40.880Z
Answers.LastActivityDate: 2018-10-27T12:11:40.880Z
Answers.UserDisplayName: thvs86
Body: <p>In ffmpeg, I have the following filter_complex:</p>
  
  <pre><code>color=c=Chartreuse:s=1920x1080:d=8640.059,setpts=PTS-STARTPTS[t];
  [1:v] trim=start=114.149:end=124.149,setpts=PTS-STARTPTS [v0];
  [t][v0]overlay=0:0:enable='between(t,0,10)' [o0];
  [2:v] trim=start=118.112:end=135.112,setpts=PTS-STARTPTS [v1];
  [o0][v1]overlay=0:0:enable='between(t,10,27)' [o1];
  [o0][o1]concat=n=2:v=1:a=0 [vout]
  </code></pre>
  
  <p>But when I run the command with 3 inputs (the first one is an audio file), I get:</p>
  
  <blockquote>
    <p>Stream specifier 'o0' in filtergraph description
    color=c=Chartreuse:s=1920x1080:d=8640.059,setpts=PTS-STARTPTS[t];
    [1:v] trim=start=114.149:end=124.149,setpts=PTS-STARTPTS [v0];
    [t][v0]overlay=0:0:enable='between(t,0,10)' [o0]; [2:v]
    trim=start=118.112:end=135.112,setpts=PTS-STARTPTS [v1];
    [o0][v1]overlay=0:0:enable='between(t,10,27)' [o1];
    [o0][o1]concat=n=2:v=1:a=0 [vout]  matches no streams.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>Using a git version from ~1 week ago.</p>
  
Tags: <ffmpeg>
Title: ffmpeg "Stream specifier matches no streams", but it exists
UserDisplayName: Simon Labrecque
ThreadText: # ffmpeg "Stream specifier matches no streams", but it exists
  
  (Asked by: username_0 on 2018-04-06)
  
  In ffmpeg, I have the following filter\_complex:
  
  ```
  color=c=Chartreuse:s=1920x1080:d=8640.059,setpts=PTS-STARTPTS[t];
  [1:v] trim=start=114.149:end=124.149,setpts=PTS-STARTPTS [v0];
  [t][v0]overlay=0:0:enable='between(t,0,10)' [o0];
  [2:v] trim=start=118.112:end=135.112,setpts=PTS-STARTPTS [v1];
  [o0][v1]overlay=0:0:enable='between(t,10,27)' [o1];
  [o0][o1]concat=n=2:v=1:a=0 [vout]
  
  ```
  
  But when I run the command with 3 inputs (the first one is an audio file), I get:
  
  > Stream specifier 'o0' in filtergraph description
  > color=c=Chartreuse:s=1920x1080:d=8640.059,setpts=PTS-STARTPTS[t];
  > [1:v] trim=start=114.149:end=124.149,setpts=PTS-STARTPTS [v0];
  > [t][v0]overlay=0:0:enable='between(t,0,10)' [o0]; [2:v]
  > trim=start=118.112:end=135.112,setpts=PTS-STARTPTS [v1];
  > [o0][v1]overlay=0:0:enable='between(t,10,27)' [o1];
  > [o0][o1]concat=n=2:v=1:a=0 [vout] matches no streams.
  
  What am I doing wrong?
  
  Using a git version from ~1 week ago.
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-10-27. Score: 6 | Accepted answer
  
  For future reference:
  
  as specified, you cannot reuse an intermediate stream more than once so you have 2 options:
  
  1. either save it, input the saved file and reuse it as many times you need in your filter;
  
  > `ffmpeg -i file1 -i file2 -i savedStream -filter_complex "..."`
  
  2. use the [split](https://ffmpeg.org/ffmpeg-filters.html#split_002c-asplit) filter and create as many outputs you need; default value for split is 2 outputs so:
  
  > `[o0]split[split1][split2]`
  
  would be your case.
  
  
  ---
  
  ### Answer by username_0 on 2018-04-06. Score: 2
  
  It looks like an intermediary stream, as produced by the color filter, cannot be reused more than once, so we have to use the split filter on it:
  
  ```
  color=c=Chartreuse:s=1920x1080:d=8640.059,setpts=PTS-STARTPTS[t];
  [t] split=2 [s0][s1];
  [1:v] trim=start=114.149:end=125.149,setpts=PTS-STARTPTS [v0];
  [s0][v0]overlay=0:0:enable='between(t,0,11)' [o0];
  [2:v] trim=start=115.629:end=123.629,setpts=PTS-STARTPTS [v1];
  [s1][v1]overlay=0:0:enable='between(t,11,19)' [o1];
  [o0][o1]concat=n=2:v=1:a=0 [vout]
  
  ```
  
  I couldn't find any explicit documentation on that limitation, altough I'm sure it exists somewhere.
  
  > **Comments:**
  > **username_1**: Workaround is to generate it as an input stream alongside other file inputs: `-i file -i file -f lavfi -i "color=c=Chartreuse...` and then ingest it repeatedly like other files `[2:v]...`  
  
  ---
  
  