Stream custom live channels using your own media
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
804 B

using ErsatzTV.FFmpeg.Capabilities;
using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.FFmpeg.Encoder.Nvenc;
public class EncoderHevcNvenc : EncoderBase
{
private readonly bool _bFrames;
public EncoderHevcNvenc(IHardwareCapabilities hardwareCapabilities)
{
if (hardwareCapabilities is NvidiaHardwareCapabilities nvidia)
{
_bFrames = nvidia.HevcBFrames;
}
}
public override string Name => "hevc_nvenc";
public override StreamKind Kind => StreamKind.Video;
public override string[] OutputOptions =>
new[] { "-c:v", "hevc_nvenc", "-tag:v", "hvc1", "-b_ref_mode", _bFrames ? "1" : "0" };
public override FrameState NextState(FrameState currentState) => currentState with
{
VideoFormat = VideoFormat.Hevc
};
}