I have a folder of videos which I want to fast forward using multiple threads using moviePy. How do I Fetch the videos from the folder dynamically instead of giving their paths statically? Here is my code :
from moviepy.editor import *
import os
from natsort import natsorted
from threading import Thread
def fast(path,thread_name):
if os.path.splitext(path)[1] == '.mp4': #print(os.path.splitext(path)) clip = (VideoFileClip(path).fx(vfx.speedx, 5)) #print(clip) clip.to_videofile('G:/Ocsid Technologies/Video_1/'+thread_name + '.mp4', codec='libx264')
t1 = Thread(target=fast, args=("G:/Ocsid Technologies/Video_1/sample1.mp4", 't1')).start()
t2 =Thread(target=fast, args=("G:/Ocsid Technologies/Video_1/sample2.mp4", 't2')).start()
t3 =Thread(target=fast, args=("G:/Ocsid Technologies/Video_1/sample3.mp4",'t3' )).start()
t4 =Thread(target=fast, args=("G:/Ocsid Technologies/Video_1/sample4.mp4",'t4' )).start()