/// <inheritdoc /> public IConversion SetVideoSyncMethod(VideoSyncMethod method) { if (method == VideoSyncMethod.auto) { _vsyncMode = $"-vsync -1 "; } else { _vsyncMode = $"-vsync {method} "; } return(this); }
/// <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); }
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); }