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
Hello, new to moviepy! I ran into an issue when trying to concatenate some mp4 files.
My code:
dir = '.'
files = glob.glob(os.path.join(dir, '*.mp4'))
clips = [VideoFileClip(f) for f in files]
final_clip = concatenate_videoclips(clips)
final_clip.write_videofile("my_concatenation.mp4")
Error:
Traceback (most recent call last):
File "autocomp.py", line 38, in
final_clip.write_videofile("my_concatenation.mp4")
File "", line 2, in write_videofile
File "/Users/brianlee/Envs/autocompenv/lib/python3.5/site-packages/moviepy/decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "", line 2, in write_videofile
File "/Users/brianlee/Envs/autocompenv/lib/python3.5/site-packages/moviepy/decorators.py", line 133, in use_clip_fps_by_default
for (arg, name) in zip(a, names)]
File "/Users/brianlee/Envs/autocompenv/lib/python3.5/site-packages/moviepy/decorators.py", line 133, in
for (arg, name) in zip(a, names)]
File "/Users/brianlee/Envs/autocompenv/lib/python3.5/site-packages/moviepy/decorators.py", line 122, in fun
" the clip's fps with clip.fps=24"%f.name)
AttributeError: No 'fps' (frames per second) attribute specified for function write_videofile and the clip has no 'fps' attribute. Either provide e.g. fps=24 in the arguments of the function, or define the clip's fps with clip.fps=24
It looks like each clip in [clips] has an fps attribute (I can print them with)...
But when I tried to access the final_clip's fps attribute, it does not have one.
I have to write final_clip.fps = 30
before calling final_clip.write_videofile("my_concatenation.mp4")
in order to make it work. Is this a bug?
The text was updated successfully, but these errors were encountered:
concatenate will only attribute a fps to the final clip if all clips in the concatenation have the same fps, otherwise it's considered an ambiguous case and the user has to provide the fps. That's implemented in this line.
I see two possible actions: either document this behavior in concatenate's docstring, or make the default fps the largest fps in the list (I can't remember why I didnt do that at the time).
Hello, new to moviepy! I ran into an issue when trying to concatenate some mp4 files.
My code:
Error:
It looks like each clip in [clips] has an fps attribute (I can print them with)...
But when I tried to access the final_clip's fps attribute, it does not have one.
I have to write
final_clip.fps = 30
before calling
final_clip.write_videofile("my_concatenation.mp4")
in order to make it work. Is this a bug?
The text was updated successfully, but these errors were encountered: