浩晨众云网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
前几天下载了几个视频,但是有两集是一个视频的,偶尔找到了ffmpeg处理视频的方法,它的功能非常强大。因此,分享一下,一起学习。
import subprocess,sys,os import re class CutSplicingVdeio(object): def __init__(self): pass #dercription CutSplicingVdeio this class function def instructions(self): dercription="vdeio and image transform,vdeio other opreation" return dercription def transcribeScreen(self,filePath): filePath=filePath.decode('utf-8') cmd=ffmpegPath + " -f gdigrab -framerate 60 -offset_x 0 -offset_y 0 -video_size 1366x768 -i desktop " + filePath cmd=cmd.encode(sys.getfilesystemencoding()) if "?" in cmd: cmd=cmd.replace("?","") print cmd subprocess.call(cmd , shell=True) vp=CutSplicingVdeio() vp.transcribeScreen(r"C:\Users\Administrator\Desktop\transcribe.avi") #according to give a video filepath (transcribe Screen)