1
ffmpeg -threads 1 -loop 1 -t 5 -i p1.jpg -loop 1 -t 5 -i p2.jpg  -filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,xfade=transition=fade:duration=0.5:offset=4.5[v0];[1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,xfade=transition=fade:duration=0.5:offset=9[v1]; [v0][v1]concat=n=2:v=1:a=0,format=yuv420p[v]" -map "[v]" -y out.mp4

I am trying using scale the picture and adding xfade into it. Error:

Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_xfade_5

It works fine when I remove the xfade filter.

llogan
  • 121,796
  • 28
  • 232
  • 243

1 Answers1

2
ffmpeg -y -loop 1 -t 5 -i p1.jpg -loop 1 -t 5 -i p2.jpg -filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2[img0];[1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2[img1];[img0][img1]xfade=transition=fade:duration=0.5:offset=4.5,format=yuv420p[v]" -map "[v]" out.mp4
  • xfade requires 2 inputs, but you're only providing 1 input.
  • You only need 1 xfade.
  • I removed the concat filter because xfade is basically concatenating the two images.
llogan
  • 121,796
  • 28
  • 232
  • 243