python使用ffmpeg提取mkv视频的字幕srt
import subprocess
infile = 'data/1.mkv'
outfile = 'data/subs.srt'
cmd = "ffmpeg" + ' -i ' + infile + ' -map 0:s:0 ' + outfile
subprocess.call(cmd, shell=True)
需要事先将ffmpeg的安装文件放在与该脚本文件放在同一个目录下面。
python使用ffmpeg提取mkv视频的字幕srt
import subprocess
infile = 'data/1.mkv'
outfile = 'data/subs.srt'
cmd = "ffmpeg" + ' -i ' + infile + ' -map 0:s:0 ' + outfile
subprocess.call(cmd, shell=True)
需要事先将ffmpeg的安装文件放在与该脚本文件放在同一个目录下面。