SHA256
Refactor RenderManager
This commit is contained in:
1 file changed
+10
-16
+10
-16
@@ -392,22 +392,15 @@ namespace ADOFAIRenderer.Core
|
|||||||
|
|
||||||
var renderFPS = Configuration.RenderFPS;
|
var renderFPS = Configuration.RenderFPS;
|
||||||
var videoFPS = Configuration.VideoFPS;
|
var videoFPS = Configuration.VideoFPS;
|
||||||
var bitrateMode = Configuration.EncodingConfig!.RateControlMode;
|
|
||||||
var bitrate = Configuration.EncodingConfig!.Bitrate;
|
|
||||||
var maxBitrate = Configuration.EncodingConfig!.MaxBitrate;
|
|
||||||
var qp = Configuration.EncodingConfig!.QP;
|
|
||||||
|
|
||||||
var selectedCodec = Configuration.Codec;
|
var selectedCodec = Configuration.Codec;
|
||||||
|
|
||||||
var ext = ".mp4";
|
var ext = selectedCodec switch
|
||||||
if (selectedCodec == Codec.AV1 || selectedCodec == Codec.VP9)
|
|
||||||
{
|
{
|
||||||
ext = ".webm";
|
Codec.AV1 or Codec.VP9 => ".webm",
|
||||||
}
|
Codec.VVC => ".mkv",
|
||||||
else if (selectedCodec == Codec.VVC)
|
_ => ".mp4"
|
||||||
{
|
};
|
||||||
ext = ".mkv";
|
|
||||||
}
|
|
||||||
|
|
||||||
var startTime = DateTime.Now;
|
var startTime = DateTime.Now;
|
||||||
var fileName = startTime.ToString("yyyy-MM-dd HH-mm-ss") + ext;
|
var fileName = startTime.ToString("yyyy-MM-dd HH-mm-ss") + ext;
|
||||||
@@ -425,10 +418,11 @@ namespace ADOFAIRenderer.Core
|
|||||||
Height = Configuration.RenderHeight,
|
Height = Configuration.RenderHeight,
|
||||||
FPS = effectiveVideoFps,
|
FPS = effectiveVideoFps,
|
||||||
Codec = selectedCodec,
|
Codec = selectedCodec,
|
||||||
Mode = bitrateMode,
|
Mode = Configuration.EncodingConfig!.RateControlMode,
|
||||||
QualityValue = qp,
|
QualityValue = Configuration.EncodingConfig.QP,
|
||||||
TargetBitrate = bitrate,
|
TargetBitrate = Configuration.EncodingConfig.Bitrate,
|
||||||
MaxBitrate = maxBitrate
|
MaxBitrate = Configuration.EncodingConfig.MaxBitrate,
|
||||||
|
GopSize = Configuration.EncodingConfig.KeyframeInterval
|
||||||
};
|
};
|
||||||
|
|
||||||
videoFFmpeg = new FFmpegNativeEncoder(settings);
|
videoFFmpeg = new FFmpegNativeEncoder(settings);
|
||||||
|
|||||||
Reference in new issue
Block a user