SHA256
forked from ADOFAIEditorForum/ADOFAIRenderer
Add CBR, VBR, and CQP Bitrate Control Options and Dynamic UI Generation
This commit is contained in:
1 parent
d7ca416980
commit
c6356a28f0
7 files changed
+222
-33
No files matched your search
+25
-3
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Buffers;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using ADOFAIRenderer.UI;
|
||||
using ADOFAIRenderer.Util;
|
||||
using ADOFAIRenderer.Util.FFmpeg;
|
||||
@@ -52,6 +53,14 @@ namespace ADOFAIRenderer.Core
|
||||
public int throttleCount;
|
||||
public bool isThrottling;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum BitrateControlMode
|
||||
{
|
||||
CBR,
|
||||
VBR,
|
||||
CQP
|
||||
}
|
||||
|
||||
public struct RenderSettings
|
||||
{
|
||||
public double TargetFPS;
|
||||
@@ -60,13 +69,19 @@ namespace ADOFAIRenderer.Core
|
||||
public int RenderWidth;
|
||||
public int RenderHeight;
|
||||
|
||||
public BitrateControlMode BitrateMode;
|
||||
public int Bitrate;
|
||||
public int MaxBitrate;
|
||||
public int QP;
|
||||
|
||||
public string Codec;
|
||||
public double EndWaitTime;
|
||||
public bool ShowHitText;
|
||||
public int? RandomSeed;
|
||||
|
||||
public RenderSettings(double targetFPS, double videoFPS, int renderWidth, int renderHeight, int bitrate, string codec, double endWaitTime, bool showHitText, int? randomSeed)
|
||||
public RenderSettings(double targetFPS, double videoFPS, int renderWidth, int renderHeight,
|
||||
BitrateControlMode bitrateMode, int bitrate, int maxBitrate, int qp,
|
||||
string codec, double endWaitTime, bool showHitText, int? randomSeed)
|
||||
{
|
||||
TargetFPS = targetFPS;
|
||||
VideoFPS = videoFPS;
|
||||
@@ -74,7 +89,11 @@ namespace ADOFAIRenderer.Core
|
||||
RenderWidth = renderWidth;
|
||||
RenderHeight = renderHeight;
|
||||
|
||||
BitrateMode = bitrateMode;
|
||||
Bitrate = bitrate;
|
||||
MaxBitrate = maxBitrate;
|
||||
QP = qp;
|
||||
|
||||
Codec = codec;
|
||||
EndWaitTime = endWaitTime;
|
||||
ShowHitText = showHitText;
|
||||
@@ -440,7 +459,10 @@ namespace ADOFAIRenderer.Core
|
||||
|
||||
var targetFps = Configuration.TargetFPS;
|
||||
var videoFps = Configuration.VideoFPS;
|
||||
float bitrate = Configuration.Bitrate;
|
||||
var bitrateMode = Configuration.BitrateMode;
|
||||
var bitrate = Configuration.Bitrate;
|
||||
var maxBitrate = Configuration.MaxBitrate;
|
||||
var qp = Configuration.QP;
|
||||
var codecStr = Configuration.Codec;
|
||||
|
||||
var selectedCodec = VideoFFmpeg.Codec.H264_Default;
|
||||
@@ -478,7 +500,7 @@ namespace ADOFAIRenderer.Core
|
||||
{
|
||||
_allVideoFFmpegInstances.Add(videoFFmpeg);
|
||||
}
|
||||
videoFFmpeg.Start(_currentOutPath, bitrate);
|
||||
videoFFmpeg.Start(_currentOutPath, bitrateMode, bitrate, maxBitrate, qp);
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user