In my current directory I have a file.mp4.
Problem:
I want to search the name of that file and then put file.mp4 in the VideoFileClip('file.mp4')
.
How can I do that? I get an error when I run the code below, because VideoFileClip()
accepts only String. How can we put search function inside a function?
My code:
from glob import glob
from moviepy.editor import VideoFileClip
clip = VideoFileClip(glob("*.mp4"))
s = clip.duration
clip.close()
I also tried replacing:
clip = VideoFileClip( glob("*.mp4") )
with this alternative:
clip = VideoFileClip( str(glob("*.mp4")) )