0

So I'm walking a directory that has clips that need to be concatenated.
I'm having a problem where my output (final_clip) is being written to the directory where the script is stored. How can I change this?
I looked in the documentation but couldn't find anything.

for count, file in enumerate(os.listdir(r"Z:/channel/clips to use/")):
    clip1 = VideoFileClip(r"Z:/channel/resources/comp1.avi")
    clip2 = VideoFileClip(r"Z:/channel/clips to use/"+file)
    final_clip = concatenate_videoclips([clip1,clip2])
    final_clip.write_videofile("done"+file)
Frank Fiumara
  • 120
  • 1
  • 15

1 Answers1

1

use os.chdir(path) to navigate to the desired directory and then perform write operation or you can use os.path.join to concatenate path

hack3r-0m
  • 700
  • 6
  • 20