gpt4 book ai didi

c# - 在 C# 中提高视频的速度?

转载 作者:行者123 更新时间:2023-12-04 23:25:58 24 4
gpt4 key购买 nike

我正在尝试使用 NReco.VideoConverter.FFMpegConverter 提高视频的速度

这是我尝试过的。

  var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
string inputfile = @"C:\Users\Alan\Desktop\Video.flv";
string outputfile = @"C:\Users\Alan\Desktop\converted.mp4";


ConvertSettings convertSettings = new ConvertSettings
{
MaxDuration = 10,
VideoFrameRate = 12
//VideoFrameCount = 10

};

ffMpeg.ConvertMedia(inputfile,Format.flv, outputfile,Format.mp4,convertSettings);

我想要的是像这个例子中增加播放的视频 - https://www.youtube.com/watch?v=6tQ1ewhGiwk

这就是我基本上想要做的。

最佳答案

我通过使用 CustomOutputArgs 创建自定义转换设置解决了这个问题。

ConvertSettings convertSettings = new ConvertSettings {

CustomOutputArgs = "-filter_complex \"[0:v]setpts = 0.5 * PTS[v];[0:a] atempo=2.0[a]\" -map \"[v]\" -map \"[a]\""

};

ConvertLiveMediaTask s = ffMpeg.ConvertLiveMedia(videostream, Format.mp4, outputfile, Format.mp4, convertSettings);

s.Start();
s.Wait();

关于c# - 在 C# 中提高视频的速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47764080/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com