Add Custom Extension in Advanced Config

This commit is contained in:
copecone committed 2026-08-18 11:02:08 +09:00
1 parent bdc8b4abb0
commit c3de49fff5
3 files changed
+35 -24

No files matched your search

+9 -18
View File
@@ -500,12 +500,9 @@ namespace ADOFAIRenderer.Core
var renderFPS = Configuration.RenderFPS;
var videoFPS = Configuration.VideoFPS;
var selectedCodec = Configuration.VideoConfig.Codec;
var ext = GetOutputExtension(selectedCodec);
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") + $".{Configuration.AdvancedConfig.Extension}";
_currentOutPath = Path.Combine(MelonEnvironment.GameRootDirectory, "Render", fileName);
if (RenderContext.OutputPath != null) _currentOutPath = RenderContext.OutputPath;
@@ -520,7 +517,7 @@ namespace ADOFAIRenderer.Core
Width = Configuration.RenderWidth,
Height = Configuration.RenderHeight,
FPS = effectiveVideoFps,
Codec = selectedCodec,
Codec = Configuration.VideoConfig.Codec,
Mode = Configuration.VideoConfig.RateControlMode,
QualityValue = Configuration.VideoConfig.QP,
TargetBitrate = Configuration.VideoConfig.Bitrate,
@@ -832,19 +829,13 @@ namespace ADOFAIRenderer.Core
Cursor.visible = true;
}
private string GetOutputExtension(Codec codec)
private static readonly Dictionary<Codec, AVCodecID> AudioCodecMatch = new()
{
return codec switch
{
Codec.AV1 or Codec.VP9 => ".webm",
Codec.VVC => ".mkv",
_ => ".mp4"
};
}
private AVCodecID GetAudioCodecId(string ext)
{
return ext == ".mp4" ? AVCodecID.AV_CODEC_ID_AAC : AVCodecID.AV_CODEC_ID_OPUS;
}
[Codec.H264] = AVCodecID.AV_CODEC_ID_AAC,
[Codec.H265] = AVCodecID.AV_CODEC_ID_AAC,
[Codec.VP9] = AVCodecID.AV_CODEC_ID_OPUS,
[Codec.AV1] = AVCodecID.AV_CODEC_ID_OPUS,
[Codec.VVC] = AVCodecID.AV_CODEC_ID_OPUS
};
}
}