我正在尝试使用 ffmpeg 的 C# 包装器类将音频和视频加速到 4 倍。
这是它的样子。
var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
ConvertSettings convertSettings = new ConvertSettings
{
CustomOutputArgs = "-filter_complex \"[0:v]setpts = 0.25 * PTS[v];[0:a] atempo=2.0[a],atempo=2.0[a] \" -map \"[v]\" -map \"[a]\""
};
string inputpath = tempvideolocation + "/tempvideo.mp4";
string outputpath = tempvideolocation + "/convertedvideo.mp4";
ffMpeg.ConvertMedia(inputpath, Format.mp4, outputpath, Format.mp4, convertSettings);
但我收到“错误 - 无法在过滤器 Parsed_atempo_2(退出代码:1)上找到未标记输入板 0 的匹配流”
最佳答案
线性过滤器不需要中间标签所以改变:
atempo=2.0[a],atempo=2.0[a]
到:
atempo=2.0,atempo=2.0[a]
关于c# - 如何在 FFmpeg 中加速音频和视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47917403/