1

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: enter image description here

How can I solve this issue?

1 Answer 1

1

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
4
  • I carried out above command, and the terminal was stuck。 @Gyan
    – gs z
    Oct 31, 2018 at 14:59
  • Run command with -report added and share report. Kill ffmpeg after a minute if it doesn't exit.
    – Gyan
    Oct 31, 2018 at 15:20
  • 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
    Oct 31, 2018 at 15:26
  • Use the 2nd command.
    – Gyan
    Oct 31, 2018 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.