From 06f5c319adfb63d31b5a0e6556fef2796eb6fc65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=91=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=8F=D0=BD=D1=86=D0=B5=D0=B2?= Date: Tue, 28 Apr 2020 22:36:03 +0300 Subject: [PATCH] Changed ForceFormatArgument and VideoCodecArgument to string arguments --- .../FFMPEG/Argument/Atoms/ForceFormatArgument.cs | 7 ++++--- FFMpegCore/FFMPEG/Argument/Atoms/VideoCodecArgument.cs | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/FFMpegCore/FFMPEG/Argument/Atoms/ForceFormatArgument.cs b/FFMpegCore/FFMPEG/Argument/Atoms/ForceFormatArgument.cs index 700d320..c2322e0 100644 --- a/FFMpegCore/FFMPEG/Argument/Atoms/ForceFormatArgument.cs +++ b/FFMpegCore/FFMPEG/Argument/Atoms/ForceFormatArgument.cs @@ -5,16 +5,17 @@ namespace FFMpegCore.FFMPEG.Argument /// /// Represents force format parameter /// - public class ForceFormatArgument : Argument + public class ForceFormatArgument : Argument { public ForceFormatArgument() { } + public ForceFormatArgument(string format) : base(format) { } - public ForceFormatArgument(VideoCodec value) : base(value) { } + public ForceFormatArgument(VideoCodec value) : base(value.ToString().ToLower()) { } /// public override string GetStringValue() { - return $"-f {Value.ToString().ToLower()}"; + return $"-f {Value}"; } } } diff --git a/FFMpegCore/FFMPEG/Argument/Atoms/VideoCodecArgument.cs b/FFMpegCore/FFMPEG/Argument/Atoms/VideoCodecArgument.cs index e8296ab..ac35f35 100644 --- a/FFMpegCore/FFMPEG/Argument/Atoms/VideoCodecArgument.cs +++ b/FFMpegCore/FFMPEG/Argument/Atoms/VideoCodecArgument.cs @@ -5,15 +5,17 @@ namespace FFMpegCore.FFMPEG.Argument /// /// Represents video codec parameter /// - public class VideoCodecArgument : Argument + public class VideoCodecArgument : Argument { public int Bitrate { get; protected set; } = 0; public VideoCodecArgument() { } - public VideoCodecArgument(VideoCodec value) : base(value) { } + public VideoCodecArgument(string codec) : base(codec) { } - public VideoCodecArgument(VideoCodec value, int bitrate) : base(value) + public VideoCodecArgument(VideoCodec value) : base(value.ToString().ToLower()) { } + + public VideoCodecArgument(VideoCodec value, int bitrate) : base(value.ToString().ToLower()) { Bitrate = bitrate; } @@ -21,7 +23,7 @@ public VideoCodecArgument(VideoCodec value, int bitrate) : base(value) /// public override string GetStringValue() { - var video = $"-c:v {Value.ToString().ToLower()} -pix_fmt yuv420p"; + var video = $"-c:v {Value} -pix_fmt yuv420p"; if (Bitrate != default) {