Captain_Zaraki
Captain_Zaraki

Reputation: 17

error when scaling videos with xfade in ffmpeg

i am trying to use videos of different resolution and make a transition between them but i am unable to do so. the code i am using is posted below.

cmd = "ffmpeg -i {} -i {} -filter_complex '[0]scale=500:500[v0];[1]scale=500:500[v1];[0]settb=AVTB[v0];[1]settb=AVTB[v1];[v0][v1]xfade=transition=pixelize:duration=1:offset={},format=yuv420p' ".format(v_1,v_2,offset) + url2
os.system(cmd)

error i am getting.

Filter scale has an unconnected output

Upvotes: 1

Views: 295

Answers (1)

llogan
llogan

Reputation: 133713

cmd = "ffmpeg -i {} -i {} -filter_complex '[0]scale=500:500,settb=AVTB[v0];[1]scale=500:500,settb=AVTB[v1];[v0][v1]xfade=transition=pixelize:duration=1:offset={},format=yuv420p' ".format(v_1,v_2,offset) + url2
  • Connect linear filters with a comma (,).

  • Your command uses the same output labels ([v0] and [v1]) for multiple filter outputs. Half of them are consumed by xfade, but the others are orphaned/unconnected, so ffmpeg doesn't know what to do with them. Output labels should always be unique.

Upvotes: 1

Related Questions