Moviepy: fadeIn on a ImageClip

Created on 7 Feb 2021  路  1Comment  路  Source: Zulko/moviepy

from moviepy.editor import *

bg= ImageClip('back.jpg').set_duration(10).set_fps(24).set_audio(AudioFileClip("back.mp3"))

bg = bg.fadein(bg, 2.0) #error
bg.write_videofile("clip2.mp4")

error:
TypeError: '>=' not supported between instances of 'int' and 'ImageClip'

question

Most helpful comment

I believe your problem is in passing the wrong parameters into fadein.

bg = bg.fadein(bg, 2.0) #error

should be

bg = bg.fadein(2.0) # No error

You were passing bg as the self (first) parameter, and then passing it again as the first explicit parameter.

It fails for me with the original code, and works with the corrected code.

>All comments

I believe your problem is in passing the wrong parameters into fadein.

bg = bg.fadein(bg, 2.0) #error

should be

bg = bg.fadein(2.0) # No error

You were passing bg as the self (first) parameter, and then passing it again as the first explicit parameter.

It fails for me with the original code, and works with the corrected code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LaoYuanPython picture LaoYuanPython  路  3Comments

wayn picture wayn  路  4Comments

buddhashrestha picture buddhashrestha  路  3Comments

bobozar picture bobozar  路  4Comments

xjcl picture xjcl  路  3Comments