Body: <p>I've two files, a <code>mp4</code> and a <code>mp3</code> file. I want to add a <code>3</code> seconds intro screen with title <code>Welcome</code> and <code>black</code> background to the head of the video with the <code>mp3</code> as background. So here's what I wrote.</p>
  
  <pre><code>ffmpeg \
      -i input.mp4 \
      -i bgm.mp3 \
      -f lavfi -i color=c=black:s="1280"x"544":d=3.0 \
      -filter_complex \
          "[2:v]
    drawtext=
      fontsize=30
      :fontcolor=white
      :x=(w-text_w)/2
      :y=(h-text_h)/2
      :text='WELCOME'
  [introVideo];
  
  [1:a]
      atrim=0.0:3.0
  [introAudio];
  
  [introVideo][introAudio][0:v][0:a]concat=n=2:v=1:a=1" -preset superfast output.mp4
  </code></pre>
  
  <p>but am getting below error when I try to execute the command</p>
  
  <pre><code>[Parsed_concat_3 @ 0x55c02756fa00] Input link in1:v0 parameters (size 1280x544, SAR 1299:1280) do not match the corresponding output link in0:v0 parameters (1280x544, SAR 1:1)
  [Parsed_concat_3 @ 0x55c02756fa00] Failed to configure output pad on Parsed_concat_3
  Error reinitializing filters!
  Failed to inject frame into filter network: Invalid argument
  Error while processing the decoded data for stream #0:1
  Conversion failed!
  </code></pre>
  
  <p>Any help will be highly appreciated.</p>
  
  <p>PS: I am a beginner in video processing and <code>ffmpeg</code>.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T13:58:15.430Z
Comments.Text: See 2nd command in answer at duplicate link.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T18:12:04.657Z
Comments.Text: @Gyan: running concat with `unsafe` flag seems not recommended. Is it possible to set the aspect ratio of input video to `-f lavfi -i color...` ?
Comments.UserDisplayName: theapache64
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T18:33:49.800Z
Comments.Text: Insert `[0:v]setsar=1[0v];` before the concat filter, and use label `0v` in place of `0:v` in concat.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T18:41:38.133Z
Comments.Text: Oh my god, it worked. One more doubt @Gyan. What If I don't want to change `sar` of `input` but want to change `sar` of `[2:v]` to `sar` of  `0:v` ?
Comments.UserDisplayName: theapache64
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T18:48:45.397Z
Comments.Text: Then insert setsar for 2v after the final filter (geq).
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T18:52:38.397Z
Comments.Text: @Gyan `setsar` with value `1` ?
Comments.UserDisplayName: theapache64
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T18:53:35.897Z
Comments.Text: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/105059/discussion-between-theapache64-and-gyan).
Comments.UserDisplayName: theapache64
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T19:10:11.607Z
Comments.Text: No, with the SAR value for 0:v - 1299:1280
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-01T19:14:30.840Z
Comments.Text: I tried with `setsar=1299/1280`, but am getting same error. :( @Gyan
Comments.UserDisplayName: theapache64
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-02T05:03:13.403Z
Comments.Text: @Gyan Do you know why it's not working ?
Comments.UserDisplayName: theapache64
Tags: <ffmpeg>
Title: Input link in1:v0 parameters (size XXX, SAR XXX) do not match the corresponding output link in0:v0 parameters (XXX, SAR 1:1)
UserDisplayName: theapache64
ThreadText: # Input link in1:v0 parameters (size XXX, SAR XXX) do not match the corresponding output link in0:v0 parameters (XXX, SAR 1:1)
  
  (Asked by: username_0 on 2020-03-01)
  
  I've two files, a `mp4` and a `mp3` file. I want to add a `3` seconds intro screen with title `Welcome` and `black` background to the head of the video with the `mp3` as background. So here's what I wrote.
  
  ```
  ffmpeg \
      -i input.mp4 \
      -i bgm.mp3 \
      -f lavfi -i color=c=black:s="1280"x"544":d=3.0 \
      -filter_complex \
          "[2:v]
    drawtext=
      fontsize=30
      :fontcolor=white
      :x=(w-text_w)/2
      :y=(h-text_h)/2
      :text='WELCOME'
  [introVideo];
  
  [1:a]
      atrim=0.0:3.0
  [introAudio];
  
  [introVideo][introAudio][0:v][0:a]concat=n=2:v=1:a=1" -preset superfast output.mp4
  
  ```
  
  but am getting below error when I try to execute the command
  
  ```
  [Parsed_concat_3 @ 0x55c02756fa00] Input link in1:v0 parameters (size 1280x544, SAR 1299:1280) do not match the corresponding output link in0:v0 parameters (1280x544, SAR 1:1)
  [Parsed_concat_3 @ 0x55c02756fa00] Failed to configure output pad on Parsed_concat_3
  Error reinitializing filters!
  Failed to inject frame into filter network: Invalid argument
  Error while processing the decoded data for stream #0:1
  Conversion failed!
  
  ```
  
  Any help will be highly appreciated.
  
  PS: I am a beginner in video processing and `ffmpeg`.
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: See 2nd command in answer at duplicate link.  
  > **username_0**: @username_1: running concat with `unsafe` flag seems not recommended. Is it possible to set the aspect ratio of input video to `-f lavfi -i color...` ?  
  > **username_1**: Insert `[0:v]setsar=1[0v];` before the concat filter, and use label `0v` in place of `0:v` in concat.  
  > **username_0**: Oh my god, it worked. One more doubt @username_1. What If I don't want to change `sar` of `input` but want to change `sar` of `[2:v]` to `sar` of  `0:v` ?  
  > **username_1**: Then insert setsar for 2v after the final filter (geq).  
  > **username_0**: @username_1 `setsar` with value `1` ?  
  > **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/105059/discussion-between-username_0-and-username_1).  
  > **username_1**: No, with the SAR value for 0:v - 1299:1280  
  > **username_0**: I tried with `setsar=1299/1280`, but am getting same error. :( @username_1  
  > **username_0**: @username_1 Do you know why it's not working ?  
  
  ---
  
  ## 0 answers
  
  