当前位置: 首页>>代码示例>>Python>>正文


Python VideoFileClip.write_videofile方法代码示例

本文整理汇总了Python中moviepy.editor.VideoFileClip.write_videofile方法的典型用法代码示例。如果您正苦于以下问题:Python VideoFileClip.write_videofile方法的具体用法?Python VideoFileClip.write_videofile怎么用?Python VideoFileClip.write_videofile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在moviepy.editor.VideoFileClip的用法示例。


在下文中一共展示了VideoFileClip.write_videofile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: convert_to_mp4_file

# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import write_videofile [as 别名]
def convert_to_mp4_file(src_path, dest_path,
                        video_codec=DEFAULT_VIDEO_CODEC,
                        audio_codec=DEFAULT_VIDEO_AUDIO_CODEC):
    """
    Takes an existing movie file and converts it to mp4

    src_path (str): full path to the video file to be copied/processed

    dest_path (str): full path to where the video file should be copied

    video_codec (str): optional string to specify a codec. Otherwise
        all copied videos will be mp4 regardless of extension

    returns: dest_path
    """
    movie = VideoFileClip(src_path)
    movie.write_videofile(dest_path, codec=video_codec, audio_codec=audio_codec)
    return dest_path
开发者ID:Ahome7490,项目名称:watson-word-watcher,代码行数:20,代码来源:audio_video.py

示例2: VideoFileClip

# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import write_videofile [as 别名]
from moviepy.editor import VideoFileClip, concatenate_videoclips

clip1 = VideoFileClip("partly_cloudy.mp4").subclip(747, 759)
clip1.fps = 15
clip1.write_videofile("partly_cloudy_short.mp4")
开发者ID:kevinkong91,项目名称:Skycast-Python,代码行数:7,代码来源:trim.py

示例3: combine

# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import write_videofile [as 别名]
def combine(video_file, audio_file):
    video_clip = VideoFileClip(video_file)
    video_clip.write_videofile(os.path.join("/Users/frederickli/Downloads", os.path.basename(video_file.replace("video_", ""))), audio=audio_file)
    os.remove(video_file)
    os.remove(audio_file)
    return
开发者ID:frederick623,项目名称:Helloworld,代码行数:8,代码来源:vimeo_dl.py

示例4: calibrate_camera

# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import write_videofile [as 别名]
    return blend_output


if __name__ == '__main__':

    # first things first: calibrate the camera
    ret, mtx, dist, rvecs, tvecs = calibrate_camera(calib_images_dir='camera_cal')

    mode = 'images'

    if mode == 'video':

        selector = 'project'
        clip = VideoFileClip('{}_video.mp4'.format(selector)).fl_image(process_pipeline)
        clip.write_videofile('out_{}_{}.mp4'.format(selector, time_window), audio=False)

    else:

        test_img_dir = 'test_images'
        for test_img in os.listdir(test_img_dir):

            frame = cv2.imread(os.path.join(test_img_dir, test_img))

            blend = process_pipeline(frame, keep_state=False)

            cv2.imwrite('output_images/{}'.format(test_img), blend)

            plt.imshow(cv2.cvtColor(blend, code=cv2.COLOR_BGR2RGB))
            plt.show()
开发者ID:Forrest-Z,项目名称:self-driving-car,代码行数:31,代码来源:main.py


注:本文中的moviepy.editor.VideoFileClip.write_videofile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。