ffmpeg
e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i e://python/music/a.m4a e://python/music/a.mp3 e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i e://a.mp3 e://a.wav import os s="e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i E://python/picture/cat/*.jpg e://a.gif" os.system(s) for %%a in ("*.ts") do ffmpeg -i "%%a" -f mp4 -codec copy "\%%~na.mp4 pause for %%a in ("*.jpg") do ffmpeg -i "%%a" -f mp4 -codec copy "\%%~na.gif
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
# -*- coding: utf-8 -*- """ Created on Sun Apr 12 11:31:56 2020 @author: Administrator """ #分解图 import os path="e://python/picture/cat/" s="e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i "+path +"gaoxiao.mp4" + " " + path+"gaoxiao/"+"img_%d.jpg" s="e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i "+path +"img_%d.jpg"+ " " + "e://a.gif" s="e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i \"concat:e://wu/1.ts|e://wu/2.ts|e://wu3.ts|\" -c copy e://output.mp4" print(s) os.system(s) #视频ts跟ts合并 #mp4好像文件大了就不能执行了 #不可以混着合并 #先转化为ts再合并 e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i "concat:1.ts|2.ts|3.ts|" -c copy e://output.mp4 s="e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i \"concat:" for i in range(1,5): s=s+str(i)+".ts|" s=s+"\" -c copy e://ceshi.ts" import os f=open("e://wu.txt","w") f.write(s) f.close() import os file=open("e://wu.txt","r") print(file.read()) os.system("E://") os.system("cd 西红柿首富") os.system(file.read()) file.close() import os for i in range(1,2000): if i!=1: s="file "+"\'e://linshiMV/"+str(i-1)+".ts\'" s=s+"\nfile "+"\'e://xihongshi/"+str(i)+".ts\'" else: s="" s=s+"\nfile "+"\'e://xihongshi/"+str(i)+".ts\'" import os f=open("e://wu.txt","w") f.write(s) f.close() import os s="e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -f concat -safe 0 -i e://wu.txt -c copy e://linshiMV/"+str(i)+".ts" os.system(s) if i!=1: os.remove("e://linshiMV/"+str(i-1)+".ts") else: pass e://python/ffmpeg-20200403-52523b6-win64-static/bin/ffmpeg -i e://倚天屠龙记之魔教教主.mp4 e://s.ts
-----------------------------------------------------------------------------------------------------------------------------------------