目录
ffmpeg切割视频
ffmpeg -i video.mp4 -ss 00:00:00 -t 00:00:08 output3.mp4
python 调用ffmpeg转html5支持的mp4
# coding: utf-8
import sys, os
import threading
def convert_avi(input_file, output_file, ffmpeg_exec="ffmpeg"):
ffmpeg = '{ffmpeg} -y -i "{infile}" -c:v libx264 -strict -2 "{outfile}"'.format(ffmpeg=ffmpeg_exec, infile=input_file,outfile=output_file
)
f = os.popen(ffmpeg)
ffmpegresult = f.readline()
#s = os.stat(output_file)
#fsize = s.st_size
return ffmpegresult
def convert