namespace ytLive.Services.Encoder;
///
/// Everything the FFmpeg subprocess encoder needs for one go-live (TASK 4 ship
/// step 3). is the FULL ingestion URL — the reusable
/// stream's ingest address plus its stream key (rtmp://a.rtmp.youtube.com/live2/<key>).
/// Resolution/FPS/bitrate come from the active quality tier; audio (TASK 9)
/// streams from the mixer through the named pipe .
///
public sealed class EncoderOptions
{
/// The audio pipe the mixer streams into; the args reference the
/// same name for ffmpeg's -i.
public const string DefaultAudioPipeName = "ytllive_audio";
public string RtmpUrl { get; init; } = string.Empty;
public int Width { get; init; } = 1920;
public int Height { get; init; } = 1080;
public int Fps { get; init; } = 60;
public int BitrateKbps { get; init; } = 8000;
/// H.264 encoder name for -c:v; the encoder probes and prefers
/// nvenc → qsv → amf → libopenh264 when not forced.
public string? VideoEncoder { get; init; }
public int AudioSampleRate { get; init; } = 48000;
public int AudioChannels { get; init; } = 2;
/// Name of the mixer's audio pipe (default ).
public string AudioPipeName { get; init; } = DefaultAudioPipeName;
/// GOP in frames = Fps × 4s — the YouTube keyframe ≤ 4s compliance bound.
public int GopSize => Fps * 4;
}