示例#1
0
 /// <inheritdoc />
 public IConversion SetVideoSyncMethod(VideoSyncMethod method)
 {
     if (method == VideoSyncMethod.auto)
     {
         _vsyncMode = $"-vsync -1 ";
     }
     else
     {
         _vsyncMode = $"-vsync {method} ";
     }
     return(this);
 }
示例#2
0
 /// <inheritdoc />
 public IConversion SetVideoSyncMethod(VideoSyncMethod method)
 {
     if (method == VideoSyncMethod.auto)
     {
         _parameters.Add(new ConversionParameter($"-vsync -1", ParameterPosition.PostInput));
     }
     else
     {
         _parameters.Add(new ConversionParameter($"-vsync {method}", ParameterPosition.PostInput));
     }
     return(this);
 }
示例#3
0
        public async Task AddVsync_CorrectValues_VsyncMethodIsSet(VideoSyncMethod vsyncMethod)
        {
            string     output = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + FileExtensions.Mp4);
            IMediaInfo info   = await FFmpeg.GetMediaInfo(Resources.MkvWithAudio);

            IConversionResult conversionResult = await FFmpeg.Conversions.New()
                                                 .AddStream(info.VideoStreams.First().SetCodec(VideoCodec.copy))
                                                 .SetVideoSyncMethod(vsyncMethod)
                                                 .SetOutput(output)
                                                 .Start();

            Assert.Contains($"-vsync {vsyncMethod}", conversionResult.Arguments);
        }