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

时间:2017-12-12 01:34:10

标签: c# ffmpeg

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

这是我基本上要做的事情。

1 个答案:

答案 0 :(得分:0)

我通过使用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();
相关问题