Files
ersatztv/ErsatzTV.FFmpeg/Encoder/VideoToolbox/EncoderH264VideoToolbox.cs
T
Jason DoveandGitHub c1d6ddcc57 add h264 profile option to ffmpeg profile (#1686)
* add video profile for nvenc/software h264 encoders

* add h264 profile for all other encoders

* update changelog
2024-04-22 22:03:18 -05:00

33 lines
865 B
C#

using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.FFmpeg.Encoder.VideoToolbox;
public class EncoderH264VideoToolbox(Option<string> maybeVideoProfile) : EncoderBase
{
public override string Name => "h264_videotoolbox";
public override StreamKind Kind => StreamKind.Video;
public override string[] OutputOptions
{
get
{
foreach (string videoProfile in maybeVideoProfile)
{
return
[
"-c:v", Name,
"-profile:v", videoProfile.ToLowerInvariant(),
];
}
return base.OutputOptions;
}
}
public override FrameState NextState(FrameState currentState) => currentState with
{
VideoFormat = VideoFormat.H264,
FrameDataLocation = FrameDataLocation.Hardware
};
}