简体   繁体   English

使用 moviepy 库将 2 个视频合并在一起 简单问题? 输出在哪里?

[英]Use moviepy library to merge 2 Videos together Simple Question! Where is the output?

I use https://github.com/Zulko/moviepy library to merge two videos with python我使用https://github.com/Zulko/moviepy库将两个视频与 python 合并

import moviepy
clip1 = VideoFileClip("C:/folder/1.mp4",audio=True)
clip2 = VideoFileClip("C:/folder/2.mp4",audio=True)
final_clip = concatenate_videoclips([clip1,clip2],method="compose")
final_clip.write_videofile("merged.mp4")

Where will I find the merged.mp4 file now?我现在在哪里可以找到merged.mp4 文件? Maybe this will help to https://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html Please help me.也许这将有助于https://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html请帮助我。

Or is there another way to merge two videos with py?还是有另一种方法可以将两个视频与 py 合并?

If you use it like that, in the current working directory where the script is called.如果你这样使用它,在调用脚本的当前工作目录中。 Ie if you're in C:\py and call: >python merge.py it will be in C:\py即如果你在C:\py并调用: >python merge.py它将在C:\py

You can set a full path if you wish, r"C:\Video\merged.mp4" etc.您可以根据需要设置完整路径, r"C:\Video\merged.mp4"等。

Also, if you want to only concatenate without effects or transitions, using method='chain' will be faster.此外,如果您只想在没有效果或过渡的情况下进行连接,使用method='chain'会更快。 See: MoviePy write_videofile taking hours请参阅: MoviePy write_videofile 耗时数小时

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM