c# - 如何在 FFmpeg 中加速音频和视频

标签 c# video ffmpeg

我正在尝试使用 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/

相关文章:

c# - 测试中无法连接网络

c# - 无法将类型 'string' 隐式转换为 'System.Windows.Forms.TextBox'

c# - 如何连续监视一组线程,然后在它们结束后执行某些操作?

css - 缩放 HTML5 视频并维护中心?

ios - iOS:AVCaptureSession录制的音频不会超过11秒

python - 使用opencv将模拟视频抓取到python中

video - 如何从 TS 视频中裁剪最后 N 秒

c# - 从 RSS 提要中提取新项目

ffmpeg 失败,出现 : Unable to find a suitable output format for 'pipe:'

awk - FFMPEG 使用 MSVC 在 Windows 上构建 - 制作失败