I have a directory full of clips currently there are about 40. I'm trying to merge them into one long video its about 6 minutes long when the merge is complete
def merge_videos(video_paths, output_path):
success = False
try:
videos = []
for video in video_paths:
videos.append(VideoFileClip(video))
# Concatenate the video clips
final_clip = concatenate_videoclips(videos)
# Write the final clip to a file
final_clip.write_videofile(output_path, codec='libx264', audio_codec='aac')
success = True
except Exception as e:
# Handle any errors
print("Error merging videos:", e)
return False
finally:
# Close the clips
final_clip.close()
for video in videos:
video.close()
return success
The problem is some of the clips are getting the audio doubled. so its like its just looping the audio in the clip. Its not all of the clips that get their audio tracks looped its just some of them and i cant figure out what the issue could be.
To be clear the videos arnt doubling its just the audio track within some of the videos. I even checked to be sure im not sending the same video more then once.
I have a directory full of clips currently there are about 40. I'm trying to merge them into one long video its about 6 minutes long when the merge is complete
The problem is some of the clips are getting the audio doubled. so its like its just looping the audio in the clip. Its not all of the clips that get their audio tracks looped its just some of them and i cant figure out what the issue could be.
To be clear the videos arnt doubling its just the audio track within some of the videos. I even checked to be sure im not sending the same video more then once.