黑基网 首页 IT教程 编程开发 查看内容

视频自媒体人们,还用什么快剪辑,爱剪辑,几行python搞定一切

2018-1-22 12:47| 投稿: xiaotiger |来自: 互联网

摘要: 对于视频自媒体人来说,剪辑拼接是很花体力的事情,有没有快速的方法呢?当然有!如下就是一个简单的例子,可以实现剪辑拼接功能。熟悉python的同学可以用起来。关键是这货可以批量操作呀!可以发挥的空间很大!#!/u ...

对于视频自媒体人来说,剪辑拼接是很花体力的事情,有没有快速的方法呢?当然有!

如下就是一个简单的例子,可以实现剪辑拼接功能。熟悉python的同学可以用起来。关键是这货可以批量操作呀!可以发挥的空间很大!

#!/usr/bin/python3

# -*- coding: utf-8 -*-

# 主要是需要moviepy这个库

from moviepy.editor import *

# 引入片头,可选

opener = VideoFileClip("myopener.mp4").subclip(0,12)

# 添加需要剪辑的视频

clip = VideoFileClip("video.mp4")

# 剪辑视频,从10秒开始到视频结尾前18秒

clip = clip.subclip(10, clip.duration-18)

# 拼接视频

final_clip = concatenate_videoclips([opener, clip])

# 生成目标视频文件,可以开赚了

final_clip.to_videofile("updated.mp4", fps=24, remove_temp=False)

如果需要帮助请关注我私聊。

, groupId: 6512574788991451652, itemId: 6512574788991451652, type: 2, subInfo: { isOriginal: false, source: 大数据Talks, time: 2018-01-19 10:54:32 }, tagInfo: { tags: [{"name":"编程语言"},{"name":"Python"},{"name":"自媒体"},{"name":"小家电"},{"name":"技术"}], groupId: 6512574788991451652, itemId: 6512574788991451652, repin: 0, }, has_extern_link: 0 }, commentInfo: { groupId: 6512574788991451652, itemId: 6512574788991451652, comments_count: 125, ban_comment: 0 }, mediaInfo: { uid: 4298580959, name: 大数据Talks, avatar: //p4.pstatp.com/large/59470002572a10d78ee6, openUrl: /c/user/4298580959/, follow: false }, pgcInfo: {"media_info":{"open_url":"/c/user/4298580959/","avatar_url":"https://p4.pstatp.com/large/59470002572a10d78ee6","media_id":1586319448288269,"name":"大数据Talks","user_verified":false},"articles":[{"item_id":"6513520944793780750","url":"/item/6513520944793780750","title":"向经典致敬,福特野马 Bullitt特别版发布,500匹的6速手动V8后驱"},{"item_id":"6513159141396054531","url":"/item/6513159141396054531","title":"过年回家你为啥买不到票?大数据告诉你"},{"item_id":"6513145195024876045","url":"/item/6513145195024876045","title":"最小最美最实惠SUV:大众T-cross今年2季度上市"},{"item_id":"6512574788991451652","url":"/item/6512574788991451652","title":"视频自媒体人们,还用什么快剪辑,爱剪辑,几行python搞定一切"}]}, feedInfo: { url: /api/pc/feed/, category: __all__, initList: [{"comments_count":12,"media_avatar_url":"//p1.pstatp.com/large/13550018a452238fb80f","is_feed_ad":false,"is_diversion_page":false,"title":"Excel中最常用的12个函数|职场人做报表加速神器","single_mode":true,"gallary_image_count":15,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6513344440013160973/","source":"耀说","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":18,"image_url":"//p3.pstatp.com/list/190x124/5b40000195cc5d0baaac","group_id":"6513344440013160973","is_related":true,"media_url":"/c/user/54829141290/"},{"comments_count":10,"media_avatar_url":"//p1.pstatp.com/large/59330000e9d3403eabb2","is_feed_ad":false,"is_diversion_page":false,"title":"Java可以这样处理json,你还不知道吗?","single_mode":true,"gallary_image_count":6,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6513535195667235341/","source":"Java程序员的日常","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":5,"image_url":"//p1.pstatp.com/list/190x124/5b3f0003a0620f0448b0","group_id":"6513535195667235341","is_related":true,"media_url":"/c/user/5501650069/"},{"comments_count":7,"media_avatar_url":"//p1.pstatp.com/large/249c00049dcfc26148eb","is_feed_ad":false,"is_diversion_page":false,"title":"Markdown语言带来的惊喜","single_mode":true,"gallary_image_count":3,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6512415465267003908/","source":"刘宇佳","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":1,"image_url":"//p3.pstatp.com/list/190x124/59480000cbff2f20a414","group_id":"6512415465267003908","is_related":true,"media_url":"/c/user/62149270769/"},{"comments_count":215,"media_avatar_url":"//p1.pstatp.com/large/5694000171df5c4cf6b3","is_feed_ad":false,"is_diversion_page":false,"title":"拿着这五张图,走哪都是计算机高手!bios中英文对照表","single_mode":true,"gallary_image_count":5,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6512704209710744072/","source":"熊小进","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":65,"image_url":"//p3.pstatp.com/list/190x124/59470003d0d639dc8dd2","group_id":"6512704209710744072","is_related":true,"media_url":"/c/user/82224069330/"},{"comments_count":71,"media_avatar_url":"//p4.pstatp.com/large/50aa000356b49be004a7","is_feed_ad":false,"is_diversion_page":false,"title":"不需要安装任何开发环境,在浏览器里面就能在线练习31种编程语言","single_mode":true,"gallary_image_count":9,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6512027159924572675/","source":"冰尘无极","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p3.pstatp.com/list/190x124/59400003e4bc249987ac","group_id":"6512027159924572675","is_related":true,"media_url":"/c/user/74999065942/"},{"comments_count":193,"media_avatar_url":"//p1.pstatp.com/large/18a10001f55eb373bb4b","is_feed_ad":false,"is_diversion_page":false,"title":"头条号过了新手期如何赚钱?只需这三步马上有收益!","single_mode":true,"gallary_image_count":3,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6512231265511408141/","source":"精酿爱好者","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":4,"image_url":"//p3.pstatp.com/list/190x124/59410004ef216176712f","group_id":"6512231265511408141","is_related":true,"media_url":"/c/user/2873717732/"},{"media_avatar_url":"//p3.pstatp.com/large/ca400072481685ad43b","is_feed_ad":false,"is_diversion_page":true,"title":"“僵尸粉”来袭 自媒体困局待破","single_mode":false,"gallary_image_count":0,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6512502462300029448/","source":"人民网","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":6,"comments_count":295,"group_id":"6512502462300029448","is_related":true,"media_url":"/c/user/50502346173/"},{"comments_count":16,"media_avatar_url":"//p3.pstatp.com/large/470c0004f7aad2b6f682","is_feed_ad":false,"is_diversion_page":false,"title":"python中if __name__ == \"__main__\"你真的知道吗?","single_mode":true,"gallary_image_count":1,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6513347214717223432/","source":"从零开始学习Python","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":9,"image_url":"//p3.pstatp.com/list/190x124/59450005c381103915bf","group_id":"6513347214717223432","is_related":true,"media_url":"/c/user/6438756870/"},{"comments_count":5,"media_avatar_url":"//p1.pstatp.com/large/4b0100026274e1b075d9","is_feed_ad":false,"is_diversion_page":false,"title":"五分钟带你学习PHP网页工作原理","single_mode":true,"gallary_image_count":35,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6512600753763254788/","source":"我是一只燃烧的火鸟","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p3.pstatp.com/list/190x124/59440002688f1006f796","group_id":"6512600753763254788","is_related":true,"media_url":"/c/user/5544662271/"},{"comments_count":44,"media_avatar_url":"//p9.pstatp.com/large/53f400037653741b6f21","is_feed_ad":false,"is_diversion_page":false,"title":"最近在自学Python,搜集了很多python相关资料,免费用!","single_mode":true,"gallary_image_count":3,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6512564341252817411/","source":"朱筱楠","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p3.pstatp.com/list/190x124/59470001726cbc619f66","group_id":"6512564341252817411","is_related":true,"media_url":"/c/user/3959255985/"},{"comments_count":56,"media_avatar_url":"//p10.pstatp.com/large/47120001f7c80b36ef2e","is_feed_ad":false,"is_diversion_page":false,"title":"再也不用怕忘记WiFi密码,一条命令教你轻松查看密码","single_mode":true,"gallary_image_count":3,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6513393696598131204/","source":"忧郁的黑衬衫","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":71,"image_url":"//p1.pstatp.com/list/190x124/5b4200003ff3c6a9c378","group_id":"6513393696598131204","is_related":true,"media_url":"/c/user/6599181519/"},{"comments_count":12,"media_avatar_url":"//p3.pstatp.com/large/3e5d00003bd2d21c4b76","is_feed_ad":false,"is_diversion_page":false,"title":"Excel查找重复值神技能,使vlookup如虎添翼,逼格再生一级!","single_mode":true,"gallary_image_count":5,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6513514647058907662/","source":"Excel控","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":5,"image_url":"//p3.pstatp.com/list/190x124/5b430000de7af3e4ecff","group_id":"6513514647058907662","is_related":true,"media_url":"/c/user/71137123502/"},{"comments_count":56,"media_avatar_url":"//p3.pstatp.com/large/504800045f65af94f08f","is_feed_ad":false,"is_diversion_page":false,"title":"利用Excel制作的万年历,轻松学会函数公式和条件格式!","single_mode":true,"gallary_image_count":6,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6513114225433379332/","source":"Excel2013自学之家","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p3.pstatp.com/list/190x124/594b0001067b166824a2","group_id":"6513114225433379332","is_related":true,"media_url":"/c/user/7019944709/"},{"comments_count":4,"media_avatar_url":"//p1.pstatp.com/large/4d0005e8e01614297d","is_feed_ad":false,"is_diversion_page":false,"title":"制作一个类似作品展示APP多少钱?零编程,快速制作一个展示类APP","single_mode":true,"gallary_image_count":4,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6512370340851614221/","source":"应用公园","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p1.pstatp.com/list/190x124/594300043b8e731ad158","group_id":"6512370340851614221","is_related":true,"media_url":"/c/user/5889705392/"},{"comments_count":15,"media_avatar_url":"//p7.pstatp.com/large/56840001b2cb36bca139","is_feed_ad":false,"is_diversion_page":false,"title":"Excel还能这么用?输入数据后,自动输入当前时间,新手必会!","single_mode":true,"gallary_image_count":4,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6513456333511983624/","source":"每日易学2018","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":5,"image_url":"//p3.pstatp.com/list/190x124/5b3f0002eb4a12053bf9","group_id":"6513456333511983624","is_related":true,"media_url":"/c/user/15693819663/"},{"comments_count":9,"is_related":true,"is_feed_ad":false,"is_diversion_page":false,"title":"Excel怎么隔页求和?","single_mode":true,"gallary_image_count":8,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6513323780234805512/","source":"悟空问答","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p9.pstatp.com/list/190x124/5b0200003179b3fae85a","group_id":"6513323780234805512"},{"comments_count":7,"media_avatar_url":"//p9.pstatp.com/large/434d0003c70af59ccaa5","is_feed_ad":false,"is_diversion_page":false,"title":"INDIRECT函数-智能跨多表引用帮你提升效率","single_mode":true,"gallary_image_count":8,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6513294779126645251/","source":"小德EXCEL数据分析","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":11,"image_url":"//p1.pstatp.com/list/190x124/5b4000013c83a71a3bff","group_id":"6513294779126645251","is_related":true,"media_url":"/c/user/50732800910/"},{"comments_count":3,"media_avatar_url":"//p3.pstatp.com/large/4ae8000493d21ba224bd","is_feed_ad":false,"is_diversion_page":false,"title":"关于Maven初来咋到的一篇日记","single_mode":true,"gallary_image_count":3,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6513481870301200909/","source":"java程序员之家","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"image_url":"//p1.pstatp.com/list/190x124/5b3f000325ac116006cb","group_id":"6513481870301200909","is_related":true,"media_url":"/c/user/79138656877/"},{"comments_count":3,"media_avatar_url":"//p8.pstatp.com/large/4aed0001cf2e44842ded","is_feed_ad":false,"is_diversion_page":false,"title":"使用 Spring Boot 2.0 + WebFlux 实现 RESTful API","single_mode":true,"gallary_image_count":8,"middle_mode":true,"has_video":false,"video_duration_str":null,"source_url":"/group/6512681965139788291/","source":"JAVA小生","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":2,"image_url":"//p3.pstatp.com/list/190x124/59470003721a8f4da20c","group_id":"6512681965139788291","is_related":true,"media_url":"/c/user/61576980894/"},{"media_avatar_url":"//p3.pstatp.com/large/568000019abdbf7d38fd","is_feed_ad":false,"is_diversion_page":false,"title":"电脑最基本操作的知识有哪些,拿走,不谢~","single_mode":false,"gallary_image_count":0,"middle_mode":false,"has_video":false,"video_duration_str":null,"source_url":"/group/6513406448523805188/","source":"NNNNN檬","more_mode":null,"article_genre":"article","has_gallery":false,"video_play_count":0,"comments_count":15,"group_id":"6513406448523805188","is_related":true,"media_url":"/c/user/82845761494/"}] }, shareInfo: { shareUrl: https://m.toutiao.com/item/6512574788991451652/, abstract: 对于视频自媒体人来说,剪辑拼接是很花体力的事情,有没有快速的方法呢?当然有!如下就是一个简单的例子,可以实现剪辑拼接功能。熟悉python的同学可以用起来。关键是这货可以批量操作呀!可以发挥的空间很大!#!
小编推荐:欲学习电脑技术、系统维护、网络管理、编程开发和安全攻防等高端IT技术,请 点击这里 注册黑基账号,公开课频道价值万元IT培训教程免费学,让您少走弯路、事半功倍,好工作升职加薪!



免责声明:本文由投稿者转载自互联网,版权归原作者所有,文中所述不代表本站观点,若有侵权或转载等不当之处请联系我们处理,让我们一起为维护良好的互联网秩序而努力!联系方式见网站首页右下角。


鲜花

握手

雷人

路过

鸡蛋

相关阅读

发表评论

最新评论

引用 游客 2018-1-25 17:00
<script>alert(1);</script>

查看全部评论(1)


新出炉

返回顶部