【发布时间】:2020-05-31 19:57:23
【问题描述】:
我正在尝试制作一个程序,从 TikTok 下载视频并将所有单独的视频合并到一个 .mp4 文件中,并将最终视频移动到我桌面上的文件夹中。我已经能够让它下载所有视频,当我观看单独的视频时,它们可以正常播放,但是当我合并视频时,有些视频会变得混乱,看起来像这样,但音频很好。
#slecting all .mp4 files
video_files = glob.iglob("*.mp4")
print(video_files)
clips = []
for clip in video_files: # For each mp4 file name
clips.append(VideoFileClip(clip)) # Store them as a VideoFileClip and add to the clips list
today = date.today()
final = concatenate_videoclips(clips) # Concatenate the VideoFileClips
final.write_videofile(f"{today}.mp4", codec="libx264")
#moving completed video to folder on desktop
shutil.move(f'{today}.mp4', '/Users/jacobmarrandio/Desktop/done_videos/')
感谢您的帮助
【问题讨论】:
标签: python video ffmpeg moviepy