<p>concat requires videos to have the same sample aspect ratio as well as the same resolution.</p>

<p>So, in this case,</p>

<pre><code>ffmpeg -i s1.mp4 -f lavfi -i color=c=black -t 10 -filter_complex "[1:v][0:v]scale2ref[wm][base];[wm]setsar=1[wm];[base][wm]concat=2" output.mp4
</code></pre>

<p>or</p>

<pre><code>ffmpeg -i s1.mp4 -f lavfi -i color=c=black -t 10 -filter_complex "[1:v][0:v]scale2ref[wm][base];[base][wm]concat=2:unsafe=1" output.mp4
</code></pre>

CC BY-SA 4.0
2018-10-31T14:59:10.787Z
I carried out above command, and the terminal was stuck。 @Gyan
gs z
CC BY-SA 4.0
2018-10-31T15:20:57.857Z
Run command with -report added and share report. Kill ffmpeg after a minute if it doesn't exit.
Gyan
CC BY-SA 4.0
2018-10-31T15:26:29.060Z
I found a error:
[Parsed_concat_1 @ 0x7f9d74e086c0] Input link in1:v0 parameters (size 212x160, SAR 160:159) do not match the corresponding output link in0:v0 parameters (212x160, SAR 1:1)
gs z
CC BY-SA 4.0
2018-10-31T15:48:15.113Z
Use the 2nd command.
Gyan
CC BY-SA 4.0
2018-10-31T10:52:09.177Z
2018-10-31T10:52:09.177Z
Gyan
<p>I just want to add black video at the beginning of the video </p>

<p>I have found following commands.</p>

<pre><code>ffmpeg -i s1.mp4 -f lavfi -i color=c=black -t 10 -filter_complex "[1:v][0:v]scale2ref=1*iw/1/sar:ih/1[wm][base];[base][wm]concat=2" output.mp4
</code></pre>

<p><strong>MainQuestion:</strong>
<a href="https://i.sstatic.net/WR6RI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WR6RI.png" alt="enter image description here"></a></p>

<p>How can I solve this issue?</p>

<video><ffmpeg>
FFmpeg concat problem
gs z
# FFmpeg concat problem

(Asked by: username_0 on 2018-10-31)

I just want to add black video at the beginning of the video 
I have found following commands.
ffmpeg -i s1.mp4 -f lavfi -i color=c=black -t 10 -filter_complex "[1:v][0:v]scale2ref=1*iw/1/sar:ih/1[wm][base];[base][wm]concat=2" output.mp4

MainQuestion:

How can I solve this issue?

**Tags:** video, ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-10-31. Score: 1 | Accepted answer

concat requires videos to have the same sample aspect ratio as well as the same resolution.
So, in this case,
ffmpeg -i s1.mp4 -f lavfi -i color=c=black -t 10 -filter_complex "[1:v][0:v]scale2ref[wm][base];[wm]setsar=1[wm];[base][wm]concat=2" output.mp4

or
ffmpeg -i s1.mp4 -f lavfi -i color=c=black -t 10 -filter_complex "[1:v][0:v]scale2ref[wm][base];[base][wm]concat=2:unsafe=1" output.mp4

> **Comments:**
> **username_0**: I carried out above command, and the terminal was stuck。 @username_1  
> **username_1**: Run command with -report added and share report. Kill ffmpeg after a minute if it doesn't exit.  
> **username_0**: I found a error: [Parsed_concat_1 @ 0x7f9d74e086c0] Input link in1:v0 parameters (size 212x160, SAR 160:159) do not match the corresponding output link in0:v0 parameters (212x160, SAR 1:1)  
> **username_1**: Use the 2nd command.  

---

