Answers.Body: <p>In this part of your filtergraph</p>
  <pre><code>[video_1][1:v][video_1]concat=n=3:v=1:a=0[v_concat];
  </code></pre>
  <p>you used the link label <code>[video_1]</code> twice. The first occurrence of it “consumes” the previously defined output pad <code>[video_1]</code> output, so the second one has no chance to connect to it.</p>
  <hr />
  <p><em>Solution:</em></p>
  <p>You may append the <code>split</code> filter to your first filterchain (i.e. just before the <code>[video_1]</code> output pad label)</p>
  <pre><code>...,setsar=1,split[video_1][video_2];
  </code></pre>
  <p>to create 2 identical video outputs, and then replace the second occurrence of <code>[video_1]</code> with <code>[video_2]</code> in your <code>concat</code> filter:</p>
  <pre><code>[video_1][1:v][video_2]concat=n=3:v=1:a=0[v_concat];
  </code></pre>
  <hr />
  <p><em>Note:</em></p>
  <p>You have to perform a similar procedure for your <code>[audio_1]</code> label – you used it twice as input label, too.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-26T22:32:31.030Z
Answers.LastActivityDate: 2023-07-27T00:00:12.943Z
Answers.LastEditDate: 2023-07-27T00:00:12.943Z
Answers.UserDisplayName: MarianD
Body: <p>I'm trying to program an automation process to add a message at the beginning and end of an input video in Windows. I have a png being looped into a mp4 with a silent audio stream added on. This is the filter complex that I'm using:</p>
  <pre><code>    ffmpeg -i messageWithSilence.mp4 -i gif.mp4 -filter_complex &quot;[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,format=yuv420p,pad=1920:1080:-1:-1,setsar=1[video_1]; 
      [0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[audio_1]; 
      [1:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[audio_2];
      [video_1][1:v][video_1]concat=n=3:v=1:a=0[v_concat]; 
      [audio_1][audio_2][audio_1]concat=n=3:v=0:a=1[a_concat]&quot; -map &quot;[v_concat]&quot; -map &quot;[a_concat]&quot; -c:v libx264 -c:a aac -r 30 -shortest &quot;%output_name%.mp4&quot;
  </code></pre>
  <p>Any ideas as to why I would be getting the error</p>
  <blockquote>
  <pre><code>Stream specifier 'video_1' in filtergraph description matches no streams
  </code></pre>
  </blockquote>
  <p>?</p>
  
Tags: <ffmpeg>
Title: Simple FFMPEG Concatenation
UserDisplayName: Morinehtar
ThreadText: # Simple FFMPEG Concatenation
  
  (Asked by: username_0 on 2023-07-26)
  
  I'm trying to program an automation process to add a message at the beginning and end of an input video in Windows. I have a png being looped into a mp4 with a silent audio stream added on. This is the filter complex that I'm using:
  
  ```
      ffmpeg -i messageWithSilence.mp4 -i gif.mp4 -filter_complex "[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,format=yuv420p,pad=1920:1080:-1:-1,setsar=1[video_1]; 
      [0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[audio_1]; 
      [1:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[audio_2];
      [video_1][1:v][video_1]concat=n=3:v=1:a=0[v_concat]; 
      [audio_1][audio_2][audio_1]concat=n=3:v=0:a=1[a_concat]" -map "[v_concat]" -map "[a_concat]" -c:v libx264 -c:a aac -r 30 -shortest "%output_name%.mp4"
  
  ```
  
  Any ideas as to why I would be getting the error
  
  > ```
  > Stream specifier 'video_1' in filtergraph description matches no streams
  >
  > ```
  
  ?
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-07-26. Score: 0 | Accepted answer
  
  In this part of your filtergraph
  
  ```
  [video_1][1:v][video_1]concat=n=3:v=1:a=0[v_concat];
  
  ```
  
  you used the link label `[video_1]` twice. The first occurrence of it “consumes” the previously defined output pad `[video_1]` output, so the second one has no chance to connect to it.
  
  ---
  
  *Solution:*
  
  You may append the `split` filter to your first filterchain (i.e. just before the `[video_1]` output pad label)
  
  ```
  ...,setsar=1,split[video_1][video_2];
  
  ```
  
  to create 2 identical video outputs, and then replace the second occurrence of `[video_1]` with `[video_2]` in your `concat` filter:
  
  ```
  [video_1][1:v][video_2]concat=n=3:v=1:a=0[v_concat];
  
  ```
  
  ---
  
  *Note:*
  
  You have to perform a similar procedure for your `[audio_1]` label – you used it twice as input label, too.
  
  
  ---
  
  