【问题标题】:moviepy ruining video after combining them组合它们后moviepy破坏视频
【发布时间】: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


    【解决方案1】:

    您希望在连接之前确保所有视频的大小相同。或者,您可以通过进行此更改来填充空间来修改较小的剪辑以具有黑色边距:

    final = concatenate_videoclips(clips, method='compose') 
    

    【讨论】:

      猜你喜欢
      • 2021-09-04
      • 1970-01-01
      • 2022-07-21
      • 1970-01-01
      • 1970-01-01
      • 2018-11-29
      • 2023-01-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多