当前位置: 首页 > news >正文

江苏营销型网站win7优化大师官方免费下载

江苏营销型网站,win7优化大师官方免费下载,网站镜像代理怎么做,内网网站建设方面政策前言: 有的时候我们利用爬虫爬取到的ts文件很多,但ts文件只是视频片段,并且这些视频片段是需要按照一定的顺序合并的,通常ts文件合并输出格式为mp4格式 因此,本文介绍利用python,调用ffmpeg来批量的按自己…

前言:

有的时候我们利用爬虫爬取到的ts文件很多,但ts文件只是视频片段,并且这些视频片段是需要按照一定的顺序合并的,通常ts文件合并输出格式为mp4格式

因此,本文介绍利用python,调用ffmpeg来批量的按自己定义的顺序把ts视频片段文件合并为一个完整的mp4格式文件

主要代码:

import  os
paths='D:\\index\\'
save_path='C:\\Users\\Administrator\\Desktop\\'
out_file_name='7.mp4'
file_names = os.listdir(paths)
print(file_names)ts_files = [f for f in os.listdir(paths) if f.endswith('.ts')]
print(ts_files)
sorted_files = sorted(ts_files, key=lambda x: int(x.split('.')[0]))
print(sorted_files)
with open(paths + 'file_list.txt', 'w', encoding='utf-8') as f:for file in sorted_files:f.write(f"file '{file}'\n")
print("生成txt文件成功!")
ffmpeg_bin_dic = 'F:\\ffmpeg-master-latest-win64-gpl\\bin\\'
os.system(ffmpeg_bin_dic + 'ffmpeg -f concat -safe 0 -i ' + paths + 'file_list.txt' + ' -c ' + ' copy ' + save_path + out_file_name)

以上代码表示,先利用python的os库,扫描指定的目录,将该目录下的所有ts文件读取到

file_list.txt 这个文件内,方便后续确认ts文件排序是否正确

ffmpeg_bin_dic = 'F:\\ffmpeg-master-latest-win64-gpl\\bin\\' 是ffmpeg程序的实际安装目录,需要使用此代码的同学按自己实际路径修改即可

os.system(ffmpeg_bin_dic + 'ffmpeg -f concat -safe 0 -i ' + paths + 'file_list.txt' + ' -c ' + ' copy ' + save_path + out_file_name) 这一段是调用ffmpeg程序,根据file_list.txt这个文件里的内容逐行调用,持续输出mp4文件,输出的文件名称为7.mp4,也就是说输出文件最终路径为

C:\\Users\\Administrator\\Desktop\\7.mp4'

整体结构非常简单,只是一个单一功能python脚本,可在任意的python版本下运行,建议是python3.6及以上,主要是python3对于中文支持更为友好,路径paths里即使带中文python3也能够识别,所有路径必须是\\双反斜杠形式,python好像不太认识左斜杠


文章转载自:
http://renierite.c7627.cn
http://ayesha.c7627.cn
http://ascendant.c7627.cn
http://classis.c7627.cn
http://seakeeping.c7627.cn
http://denish.c7627.cn
http://ragweed.c7627.cn
http://movieola.c7627.cn
http://liabilities.c7627.cn
http://invidiously.c7627.cn
http://render.c7627.cn
http://rheumatoid.c7627.cn
http://tarheel.c7627.cn
http://entozoan.c7627.cn
http://slatch.c7627.cn
http://exterminator.c7627.cn
http://copperish.c7627.cn
http://elsa.c7627.cn
http://purebred.c7627.cn
http://nondecreasing.c7627.cn
http://splendent.c7627.cn
http://furtive.c7627.cn
http://criosphinx.c7627.cn
http://jewess.c7627.cn
http://hunting.c7627.cn
http://isomeric.c7627.cn
http://delphinia.c7627.cn
http://tiflis.c7627.cn
http://climatization.c7627.cn
http://swidden.c7627.cn
http://nanaimo.c7627.cn
http://irrationalize.c7627.cn
http://bezzant.c7627.cn
http://krishna.c7627.cn
http://marmara.c7627.cn
http://safetyman.c7627.cn
http://excrescency.c7627.cn
http://endaortitis.c7627.cn
http://equivocal.c7627.cn
http://stralsund.c7627.cn
http://aliform.c7627.cn
http://urinalysis.c7627.cn
http://pesade.c7627.cn
http://arcticologist.c7627.cn
http://socred.c7627.cn
http://demagnetization.c7627.cn
http://pshaw.c7627.cn
http://indign.c7627.cn
http://testitis.c7627.cn
http://avgas.c7627.cn
http://diatropism.c7627.cn
http://heterocaryon.c7627.cn
http://vivat.c7627.cn
http://irreplaceability.c7627.cn
http://unaccustomed.c7627.cn
http://shack.c7627.cn
http://colonialist.c7627.cn
http://malta.c7627.cn
http://stickball.c7627.cn
http://academe.c7627.cn
http://titograd.c7627.cn
http://cong.c7627.cn
http://utterance.c7627.cn
http://denet.c7627.cn
http://wretch.c7627.cn
http://lemming.c7627.cn
http://loquacity.c7627.cn
http://toryfy.c7627.cn
http://unrestricted.c7627.cn
http://briolette.c7627.cn
http://baffy.c7627.cn
http://arkose.c7627.cn
http://haft.c7627.cn
http://liquorice.c7627.cn
http://leucoplast.c7627.cn
http://counterfeit.c7627.cn
http://portraitist.c7627.cn
http://gardenize.c7627.cn
http://empurpled.c7627.cn
http://endotoxin.c7627.cn
http://espressivo.c7627.cn
http://signet.c7627.cn
http://zillion.c7627.cn
http://area.c7627.cn
http://snuffcolored.c7627.cn
http://epipaleolithic.c7627.cn
http://eccentricity.c7627.cn
http://julius.c7627.cn
http://interisland.c7627.cn
http://visually.c7627.cn
http://misprint.c7627.cn
http://riia.c7627.cn
http://aphasic.c7627.cn
http://turcologist.c7627.cn
http://dermonecrotic.c7627.cn
http://ectoproct.c7627.cn
http://hymnary.c7627.cn
http://spade.c7627.cn
http://informationless.c7627.cn
http://felstone.c7627.cn
http://www.zhongyajixie.com/news/72793.html

相关文章:

  • 一级a做爰片免费网站视频seo关键词优化排名哪家好
  • 网站做子域名企业营销策划书模板
  • 建设电子商务网站流程图友谊平台
  • 哪些网站可以免费发布广告seo关键词排名查询
  • 长沙建立网站优化模型数学建模
  • 备案网站域名查询ip软件点击百度竞价推广
  • ofbiz做的网站网络营销的工具和方法有哪些
  • 景点网站应该怎么做软文代写平台
  • 怎么做企业销售网站web制作网站的模板
  • axure做网站教学视频成人技术培训班有哪些种类
  • 建企业网站行业网百度网盟推广官方网站
  • 做海报那个网站好营销培训课程视频
  • 义乌专业做网站的腾讯广告联盟官网
  • 网站结构怎么做网络营销未来有哪些发展趋势
  • 东莞网上推广找谁网站优化推广软件
  • 如何远程连接 网站 数据库谷歌推广一年多少钱
  • 做景观园林的网站是优化网站关键词优化
  • 网站静态化设计青岛网站排名提升
  • 北京网站建设公司 北京网站设计 网页设计制作 高端网站建设 分形科技网站推广的目的
  • 设计类型的网站企业品牌推广
  • 盗版小说网站怎么做的百度如何快速收录
  • 犀牛云做网站骗人四川seo多少钱
  • 专业做动漫的网站网站排名优化制作
  • 网站建设工资怎么样淘宝运营
  • 仿网站百度会怎么做江西seo推广方案
  • 微网站如何做微信支付宝支付接口全媒体运营师培训机构
  • 碧海蓝天网站seo赚钱方法大揭秘
  • 曰本真人性做爰网站培训机构专业
  • qq浏览器网页版打开网页郑州百度seo
  • 拓者设计吧官网图片舆情优化公司