more tweaks

This commit is contained in:
fwastring 2026-03-29 15:28:46 +02:00
parent b1552fe3de
commit 03e5a47910

View file

@ -211,11 +211,11 @@ in
"-rc_mode CQP -qp ${toString streamCfg.vaapiQp}"; "-rc_mode CQP -qp ${toString streamCfg.vaapiQp}";
videoCodecArgs = videoCodecArgs =
if streamCfg.useVaapi then if streamCfg.useVaapi then
"-vaapi_device ${streamCfg.vaapiDevice} -vf format=nv12,hwupload -c:v h264_vaapi ${vaapiRateControlArgs} -g ${ "-vaapi_device ${streamCfg.vaapiDevice} -vf format=nv12,hwupload -c:v h264_vaapi -profile:v main -level:v 4.1 ${vaapiRateControlArgs} -g ${
toString (streamCfg.framerate * 2) toString (streamCfg.framerate * 2)
} -bf 0" } -bf 0"
else else
"-vcodec libx264 -tune zerolatency -preset ${streamCfg.preset} ${x264RateControlArgs} -g ${ "-vcodec libx264 -pix_fmt yuv420p -profile:v main -level:v 4.1 -tune zerolatency -preset ${streamCfg.preset} ${x264RateControlArgs} -g ${
toString (streamCfg.framerate * 2) toString (streamCfg.framerate * 2)
} -bf 0"; } -bf 0";
in in
@ -230,7 +230,7 @@ in
Restart = "always"; Restart = "always";
RestartSec = "2"; RestartSec = "2";
Environment = optional (streamCfg.vaapiDriver != null) "LIBVA_DRIVER_NAME=${streamCfg.vaapiDriver}"; Environment = optional (streamCfg.vaapiDriver != null) "LIBVA_DRIVER_NAME=${streamCfg.vaapiDriver}";
ExecStart = "${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel warning -f v4l2 -framerate ${toString streamCfg.framerate} -video_size ${streamCfg.videoSize} -i ${streamCfg.device} ${videoCodecArgs} -f rtsp ${streamCfg.rtspUrl}"; ExecStart = "${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel warning -f v4l2 -framerate ${toString streamCfg.framerate} -video_size ${streamCfg.videoSize} -i ${streamCfg.device} ${videoCodecArgs} -f rtsp -rtsp_transport tcp ${streamCfg.rtspUrl}";
}; };
} }
) effectiveStreams; ) effectiveStreams;