mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 01:55:45 +00:00
28 lines
683 B
C#
28 lines
683 B
C#
using FFMpegCore.Enums;
|
|
using FFMpegCore.Exceptions;
|
|
|
|
namespace FFMpegCore.Arguments
|
|
{
|
|
/// <summary>
|
|
/// Represents video codec parameter
|
|
/// </summary>
|
|
public class VideoCodecArgument : IArgument
|
|
{
|
|
public readonly string Codec;
|
|
|
|
public VideoCodecArgument(string codec)
|
|
{
|
|
Codec = codec;
|
|
}
|
|
|
|
public VideoCodecArgument(Codec value)
|
|
{
|
|
if (value.Type != CodecType.Video)
|
|
throw new FFMpegException(FFMpegExceptionType.Operation, $"Codec \"{value.Name}\" is not a video codec");
|
|
|
|
Codec = value.Name;
|
|
}
|
|
|
|
public string Text => $"-c:v {Codec}";
|
|
}
|
|
}
|