TypeError: 'float' object is not callable #1 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: TypeError: 'float' object is not callable #1 (/thread-39250.html) |
TypeError: 'float' object is not callable #1 - isdito2001 - Jan-20-2023 Good evening, can you help me and tell me what I am doing wrong because it tells me that it is not callable. reggards # Import Pmw from this directory tree. #!/usr/local/bin/python # -*- coding: UTF-8 -*- from moviepy.editor import CompositeVideoClip, VideoFileClip, TextClip, concatenate_videoclips,vfx import time import math clip2 = VideoFileClip("F:/ave-maria-mosca.mp4") tiem=0.0 print ("eee") tiempo_ralentizado=4 #4 segundos lugar_ralentizado=5 #En el segundo 5 Framerate=50 arco_ralen=tiempo_ralentizado*Framerate def tiempo(tiem,tiempo_ralentizado,lugar_ralentizado,Framerate,arco_ralen): gek=tiem punto_entrada=lugar_ralentizado -( tiempo_ralentizado /2 ) print (gek, abs(math.sin(gek/arco_ralen)), punto_entrada) donde=[2] calcular=abs(math.sin(gek/4)*2) return gek+1- calcular clip2 = clip2.fl_time( tiempo(tiem,tiempo_ralentizado,lugar_ralentizado,Framerate,arco_ralen) ).set_duration(40)give me this error
RE: TypeError: 'float' object is not callable #1 - Yoriz - Jan-21-2023 https://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html#moviepy.video.io.VideoFileClip.VideoFileClip.fl_time Wrote:fl_time(self, t_func, apply_to=None, keep_duration=False)The method fl_time of VideoFileClip states that the parameter it receives is a function.your line clip2 = clip2.fl_time( tiempo(tiem,tiempo_ralentizado,lugar_ralentizado,Framerate,arco_ralen) ).set_duration(40)is passing the result of a function, not an actual function itself. |