You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def preprocess_args(fun,varnames):
""" Applies fun to variables in varnames before launching the function """
def wrapper(f, *a, **kw):
if hasattr(f, "func_code"):
func_code = f.func_code # Python 2
else:
func_code = f.__code__ # Python 3
names = func_code.co_varnames
new_a = [fun(arg) if (name in varnames) else arg
for (arg, name) in zip(a, names)]
new_kw = {k: fun(v) if k in varnames else v
for (k,v) in kw.items()}
# Add prints
print("a, names:", {name: arg for (arg, name) in zip(a, names)})
print("a:", a)
print("new_a:", new_a)
print("kw:", kw)
print("new_kw:", new_kw)
return f(*new_a, **new_kw)
return decorator.decorator(wrapper)
def convert_to_seconds(varnames):
"Converts the specified variables to seconds"
return preprocess_args(cvsecs, varnames)
Outputs
a, names: {'args': <moviepy.video.io.VideoFileClip.VideoFileClip object at 0x1429a3710>, 'kw': 0}
a: (<moviepy.video.io.VideoFileClip.VideoFileClip object at 0x1429a3710>, 0,60)
new_a: [<moviepy.video.io.VideoFileClip.VideoFileClip object at 0x1429a3710>, 0]
kw: {}
new_kw: {}
t_start: 0
t_end: None
Specifications
Python Version: 3.11.9
MoviePy Version: moviepy==1.0.3
Platform Name: OSX
Platform Version: 15.0
The text was updated successfully, but these errors were encountered:
Due to the
convert_to_seconds
decorator in subclip, it is ignoring thet_end
argument. I am using python 3.11.9Expected Behavior
Subclip should be 60 seconds long
Actual Behavior
Subclip is full video
Steps to Reproduce the Problem
Try to subclip a video clip and check the duration
Clip.py
decorators.py
Outputs
Specifications
The text was updated successfully, but these errors were encountered: