FFMPEG的基本命令
用FFMPEG来解密合并转化TS文件,网上有好多种写法,比如:
ffmpeg -protocol_whitelist “file,http,crypto,tcp” -i index.m3u8 -c copy out.ts
ffmpeg -allowed_extensions ALL -i index.m3u8 -c copy new.mp4
ffmpeg -allowed_extensions ALL -i index1.m3u8 -c copy -bsf:a aac_adtstoasc index.mp4
等。我直接用的中间这个就可以了。
String m3u8file = textBox5.Text;
var tool = @“ffmepg.exe”;
var command = " -allowed_extensions ALL -i " + m3u8file + " -c copy " + textBox8.Text + “\out.mp4 -y”;
using (var p = new Process())
{
RedirectExcuteProcess(p, tool, command, (s, e) => ShowDecodeInfo(m3u8file, e.Data));
}
遇到过的奇怪问题
在命令行调用FFMPEG时,出现错误
Unrecognized option ‘copy’.
Error splitting the argument list: Option not found