0
from os import environ
environ["IMAGEIO_FFMPEG_EXE"] = "/Users/ezryroukema/Downloads/discord-downloader/ffmpeg/bin"
from moviepy.editor import *
#editor

#creating varubles to title how many days its been posting (ex. day 5 of posting memes)
from datetime import date
d0 = date(2023, 7, 11)
d1 = date.today()
d = d1 - d0

#adding name varuable for title for easier publishing and sorting
title = ("day", d, "of posting memes to the goofy algorithm #shorts #short #viral #meme #memes")

#setting files paths for importing and exporting videos
from pathlib import Path
from os import listdir
input = Path('/Users/ezryroukema/Downloads/discord-downloader/inout')
output = Path(input)

#making process_video function for later in the script, this crops and exports the file but is not run till the bottom few lines
def process_video(input, output):
    clip = VideoFileClip(input)
    clip1 = clip.crop(width=1080,height=1920)
    clip1.write_videofile(title,output,codec='libx264')

#making output list function to check weather the files were properly exported
def outputlist():
    outputlist = listdir(output)
    outputlist = []
    outputlist.append(outputlist)
    print(outputlist)
    print("finished")

#appending a list of video files so the moviepy function can apply to all files
#def get_video_paths(input):
namelist = listdir(input)
nameslist = []  
namelist.append(namelist)
print(namelist)

for names in namelist:
    process_video

outputlist  
    

code prints input file names but has empty output and files do not export at all

I have tried removing the def and replacing with non def and other solutions such as using different pip alternative but nothing seems to work, I am somewhat new to python but am trying to learn more, thank you in advance :)

0 Answers0