Changed ForceFormatArgument and VideoCodecArgument to string arguments

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

View file

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

View file

@ -5,15 +5,17 @@ namespace FFMpegCore.FFMPEG.Argument
/// <summary> /// <summary>
/// Represents video codec parameter /// Represents video codec parameter
/// </summary> /// </summary>
public class VideoCodecArgument : Argument<VideoCodec> public class VideoCodecArgument : Argument<string>
{ {
public int Bitrate { get; protected set; } = 0; public int Bitrate { get; protected set; } = 0;
public VideoCodecArgument() { } 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; Bitrate = bitrate;
} }
@ -21,7 +23,7 @@ public VideoCodecArgument(VideoCodec value, int bitrate) : base(value)
/// <inheritdoc/> /// <inheritdoc/>
public override string GetStringValue() 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) if (Bitrate != default)
{ {