Changed ForceFormatArgument and VideoCodecArgument to string arguments

Former-commit-id: 06f5c319ad
This commit is contained in:
Максим Багрянцев 2020-04-28 22:36:03 +03:00
parent b5361b69b0
commit d94065d4b3
2 changed files with 10 additions and 7 deletions

View file

@ -5,16 +5,17 @@ namespace FFMpegCore.FFMPEG.Argument
/// <summary>
/// Represents force format parameter
/// </summary>
public class ForceFormatArgument : Argument<VideoCodec>
public class ForceFormatArgument : Argument<string>
{
public ForceFormatArgument() { }
public ForceFormatArgument(string format) : base(format) { }
public ForceFormatArgument(VideoCodec value) : base(value) { }
public ForceFormatArgument(VideoCodec value) : base(value.ToString().ToLower()) { }
/// <inheritdoc/>
public override string GetStringValue()
{
return $"-f {Value.ToString().ToLower()}";
return $"-f {Value}";
}
}
}

View file

@ -5,15 +5,17 @@ namespace FFMpegCore.FFMPEG.Argument
/// <summary>
/// Represents video codec parameter
/// </summary>
public class VideoCodecArgument : Argument<VideoCodec>
public class VideoCodecArgument : Argument<string>
{
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)
/// <inheritdoc/>
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)
{