commit
2d9f782ecb
1
OBS.rc
1
OBS.rc
@ -399,6 +399,7 @@ BEGIN
|
|||||||
COMBOBOX IDC_X264PROFILE,170,106,82,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_X264PROFILE,170,106,82,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
RTEXT "Settings.Advanced.NVENCPreset",IDC_NVENCPRESET_LABEL,7,94,160,8
|
RTEXT "Settings.Advanced.NVENCPreset",IDC_NVENCPRESET_LABEL,7,94,160,8
|
||||||
COMBOBOX IDC_NVENCPRESET,170,91,120,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_NVENCPRESET,170,91,120,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
|
CONTROL "Settings.Advanced.NVENC2Pass",IDC_NVENC2PASS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,293,92,117,10
|
||||||
RTEXT "Settings.Advanced.QSVPreset",IDC_QSVPRESET_LABEL,7,94,160,8
|
RTEXT "Settings.Advanced.QSVPreset",IDC_QSVPRESET_LABEL,7,94,160,8
|
||||||
COMBOBOX IDC_QSVPRESET,170,91,120,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_QSVPRESET,170,91,120,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
RTEXT "Settings.Encoding.Video.KeyframeInterval",IDC_STATIC,7,124,160,8
|
RTEXT "Settings.Encoding.Video.KeyframeInterval",IDC_STATIC,7,124,160,8
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
@ -184,7 +184,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="inc\cudaDynload.h" />
|
<ClInclude Include="inc\cudaDynload.h" />
|
||||||
<ClInclude Include="inc\license.h" />
|
|
||||||
<ClInclude Include="inc\NVENCEncoder.h" />
|
<ClInclude Include="inc\NVENCEncoder.h" />
|
||||||
<ClInclude Include="inc\nvmain.h" />
|
<ClInclude Include="inc\nvmain.h" />
|
||||||
<ClInclude Include="inc\nvEncodeAPI.h" />
|
<ClInclude Include="inc\nvEncodeAPI.h" />
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Quelldateien">
|
<Filter Include="Quelldateien">
|
||||||
@ -28,9 +28,6 @@
|
|||||||
<ClInclude Include="inc\nvEncodeAPI.h">
|
<ClInclude Include="inc\nvEncodeAPI.h">
|
||||||
<Filter>Headerdateien</Filter>
|
<Filter>Headerdateien</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="inc\license.h">
|
|
||||||
<Filter>Headerdateien</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="inc\nvmain.h">
|
<ClInclude Include="inc\nvmain.h">
|
||||||
<Filter>Headerdateien</Filter>
|
<Filter>Headerdateien</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
#include "nvEncodeAPI.h"
|
|
||||||
|
|
||||||
static const GUID NV_CLIENT_KEY = { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
|
File diff suppressed because it is too large
Load Diff
@ -66,12 +66,4 @@ inline bool dataEqual(const T& a, const T& b)
|
|||||||
String guidToString(const GUID &guid);
|
String guidToString(const GUID &guid);
|
||||||
bool stringToGuid(const String &string, GUID *guid);
|
bool stringToGuid(const String &string, GUID *guid);
|
||||||
|
|
||||||
// {7ADD423D-D035-4F6F-AEA5-50885658643C}
|
|
||||||
static const GUID NV_ENC_PRESET_STREAMING =
|
|
||||||
{0x7ADD423D, 0xD035, 0x4F6F, {0xAE, 0xA5, 0x50, 0x88, 0x56, 0x58, 0x64, 0x3C}};
|
|
||||||
|
|
||||||
// {C2DC0940-76C5-481B-A97E-B1582DDC7079}
|
|
||||||
static const GUID NV_ENC_KEY_STREAMING =
|
|
||||||
{0xC2DC0940, 0x76C5, 0x481B, {0xA9, 0x7E, 0xB1, 0x58, 0x2D, 0xDC, 0x70, 0x79}};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include "nvmain.h"
|
#include "nvmain.h"
|
||||||
#include "NVENCEncoder.h"
|
#include "NVENCEncoder.h"
|
||||||
#include "license.h"
|
|
||||||
|
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
@ -153,18 +152,17 @@ void NVENCEncoder::init()
|
|||||||
{
|
{
|
||||||
NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS stEncodeSessionParams = {0};
|
NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS stEncodeSessionParams = {0};
|
||||||
NV_ENC_PRESET_CONFIG presetConfig = {0};
|
NV_ENC_PRESET_CONFIG presetConfig = {0};
|
||||||
GUID clientKey = NV_CLIENT_KEY;
|
|
||||||
CUcontext cuContextCurr;
|
CUcontext cuContextCurr;
|
||||||
NVENCSTATUS nvStatus = NV_ENC_SUCCESS;
|
NVENCSTATUS nvStatus = NV_ENC_SUCCESS;
|
||||||
int surfaceCount = 0;
|
int surfaceCount = 0;
|
||||||
|
|
||||||
GUID encoderPreset = NV_ENC_PRESET_HQ_GUID;
|
GUID encoderPreset = NV_ENC_PRESET_HQ_GUID;
|
||||||
dontTouchConfig = false;
|
dontTouchConfig = false;
|
||||||
bool is2PassRC = false;
|
bool is2PassRC = AppConfig->GetInt(TEXT("Video Encoding"), TEXT("NVENC2Pass"), 1) != 0;
|
||||||
|
|
||||||
String profileString = AppConfig->GetString(TEXT("Video Encoding"), TEXT("X264Profile"), TEXT("high"));
|
String profileString = AppConfig->GetString(TEXT("Video Encoding"), TEXT("X264Profile"), TEXT("high"));
|
||||||
|
|
||||||
String presetString = AppConfig->GetString(TEXT("Video Encoding"), TEXT("NVENCPreset"), TEXT("High Quality"));
|
String presetString = AppConfig->GetString(TEXT("Video Encoding"), TEXT("NVENCPreset"), TEXT("Automatic"));
|
||||||
|
|
||||||
if (presetString == TEXT("High Performance"))
|
if (presetString == TEXT("High Performance"))
|
||||||
{
|
{
|
||||||
@ -178,21 +176,6 @@ void NVENCEncoder::init()
|
|||||||
{
|
{
|
||||||
encoderPreset = NV_ENC_PRESET_BD_GUID;
|
encoderPreset = NV_ENC_PRESET_BD_GUID;
|
||||||
}
|
}
|
||||||
else if (presetString == TEXT("Low Latency (2pass)"))
|
|
||||||
{
|
|
||||||
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID;
|
|
||||||
is2PassRC = true;
|
|
||||||
}
|
|
||||||
else if (presetString == TEXT("High Performance Low Latency (2pass)"))
|
|
||||||
{
|
|
||||||
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_HP_GUID;
|
|
||||||
is2PassRC = true;
|
|
||||||
}
|
|
||||||
else if (presetString == TEXT("High Quality Low Latency (2pass)"))
|
|
||||||
{
|
|
||||||
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_HQ_GUID;
|
|
||||||
is2PassRC = true;
|
|
||||||
}
|
|
||||||
else if (presetString == TEXT("Low Latency"))
|
else if (presetString == TEXT("Low Latency"))
|
||||||
{
|
{
|
||||||
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID;
|
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID;
|
||||||
@ -219,26 +202,17 @@ void NVENCEncoder::init()
|
|||||||
{
|
{
|
||||||
encoderPreset = NV_ENC_PRESET_DEFAULT_GUID;
|
encoderPreset = NV_ENC_PRESET_DEFAULT_GUID;
|
||||||
}
|
}
|
||||||
else if (presetString == TEXT("Streaming"))
|
|
||||||
{
|
|
||||||
encoderPreset = NV_ENC_PRESET_STREAMING;
|
|
||||||
clientKey = NV_ENC_KEY_STREAMING;
|
|
||||||
}
|
|
||||||
else if (presetString == TEXT("Streaming (2pass)"))
|
|
||||||
{
|
|
||||||
encoderPreset = NV_ENC_PRESET_STREAMING;
|
|
||||||
is2PassRC = true;
|
|
||||||
clientKey = NV_ENC_KEY_STREAMING;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (height > 1080 || (height == 1080 && fps > 30))
|
if (height > 1080 || (height == 1080 && fps > 30))
|
||||||
{
|
{
|
||||||
encoderPreset = NV_ENC_PRESET_HQ_GUID;
|
encoderPreset = NV_ENC_PRESET_HQ_GUID;
|
||||||
|
is2PassRC = false;
|
||||||
}
|
}
|
||||||
if (height > 720 || (height == 720 && fps > 30))
|
if (height > 720 || (height == 720 && fps > 30))
|
||||||
{
|
{
|
||||||
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_HQ_GUID;
|
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_HQ_GUID;
|
||||||
|
is2PassRC = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -247,20 +221,6 @@ void NVENCEncoder::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TCHAR envClientKey[128] = {0};
|
|
||||||
DWORD envRes = GetEnvironmentVariable(TEXT("NVENC_KEY"), envClientKey, 128);
|
|
||||||
if (envRes > 0 && envRes <= 128)
|
|
||||||
{
|
|
||||||
if (stringToGuid(envClientKey, &clientKey))
|
|
||||||
{
|
|
||||||
NvLog(TEXT("Got NVENC key from environment"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NvLog(TEXT("NVENC_KEY environment variable has invalid format"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mset(&initEncodeParams, 0, sizeof(NV_ENC_INITIALIZE_PARAMS));
|
mset(&initEncodeParams, 0, sizeof(NV_ENC_INITIALIZE_PARAMS));
|
||||||
mset(&encodeConfig, 0, sizeof(NV_ENC_CONFIG));
|
mset(&encodeConfig, 0, sizeof(NV_ENC_CONFIG));
|
||||||
|
|
||||||
@ -271,10 +231,9 @@ void NVENCEncoder::init()
|
|||||||
|
|
||||||
stEncodeSessionParams.version = NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER;
|
stEncodeSessionParams.version = NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER;
|
||||||
stEncodeSessionParams.apiVersion = NVENCAPI_VERSION;
|
stEncodeSessionParams.apiVersion = NVENCAPI_VERSION;
|
||||||
stEncodeSessionParams.clientKeyPtr = &clientKey;
|
|
||||||
|
|
||||||
cuContext = 0;
|
cuContext = 0;
|
||||||
checkCudaErrors(cuCtxCreate(&cuContext, 0, pNvencDevices[iNvencUseDeviceID]));
|
checkCudaErrors(cuCtxCreate(&cuContext, 4, pNvencDevices[iNvencUseDeviceID]));
|
||||||
checkCudaErrors(cuCtxPopCurrent(&cuContextCurr));
|
checkCudaErrors(cuCtxPopCurrent(&cuContextCurr));
|
||||||
|
|
||||||
stEncodeSessionParams.device = (void*)cuContext;
|
stEncodeSessionParams.device = (void*)cuContext;
|
||||||
@ -347,10 +306,10 @@ void NVENCEncoder::init()
|
|||||||
|
|
||||||
if (bUseCBR)
|
if (bUseCBR)
|
||||||
{
|
{
|
||||||
auto filler = AppConfig->GetInt(TEXT("Video Encoding"), TEXT("PadCBR"), 1) != 0;
|
bool filler = AppConfig->GetInt(TEXT("Video Encoding"), TEXT("PadCBR"), 1) != 0;
|
||||||
if (is2PassRC)
|
if (is2PassRC)
|
||||||
{
|
{
|
||||||
encodeConfig.rcParams.rateControlMode = filler ? NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP : NV_ENC_PARAMS_RC_2_PASS_VBR;
|
encodeConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_2_PASS_QUALITY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -364,7 +323,10 @@ void NVENCEncoder::init()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
encodeConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_VBR_MINQP;
|
if (is2PassRC)
|
||||||
|
encodeConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_2_PASS_VBR;
|
||||||
|
else
|
||||||
|
encodeConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_VBR_MINQP;
|
||||||
encodeConfig.rcParams.enableMinQP = 1;
|
encodeConfig.rcParams.enableMinQP = 1;
|
||||||
encodeConfig.rcParams.minQP.qpInterB = 32 - quality;
|
encodeConfig.rcParams.minQP.qpInterB = 32 - quality;
|
||||||
encodeConfig.rcParams.minQP.qpInterP = 32 - quality;
|
encodeConfig.rcParams.minQP.qpInterP = 32 - quality;
|
||||||
@ -397,6 +359,9 @@ void NVENCEncoder::init()
|
|||||||
encodeConfig.encodeCodecConfig.h264Config.h264VUIParameters.videoFormat = 5;
|
encodeConfig.encodeCodecConfig.h264Config.h264VUIParameters.videoFormat = 5;
|
||||||
encodeConfig.encodeCodecConfig.h264Config.h264VUIParameters.colourPrimaries = colorDesc.primaries;
|
encodeConfig.encodeCodecConfig.h264Config.h264VUIParameters.colourPrimaries = colorDesc.primaries;
|
||||||
encodeConfig.encodeCodecConfig.h264Config.h264VUIParameters.transferCharacteristics = colorDesc.transfer;
|
encodeConfig.encodeCodecConfig.h264Config.h264VUIParameters.transferCharacteristics = colorDesc.transfer;
|
||||||
|
|
||||||
|
encodeConfig.encodeCodecConfig.h264Config.sliceMode = 3;
|
||||||
|
encodeConfig.encodeCodecConfig.h264Config.sliceModeData = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nvStatus = pNvEnc->nvEncInitializeEncoder(encoder, &initEncodeParams);
|
nvStatus = pNvEnc->nvEncInitializeEncoder(encoder, &initEncodeParams);
|
||||||
@ -416,7 +381,7 @@ void NVENCEncoder::init()
|
|||||||
allocSurf.height = (height + 31) & ~31;
|
allocSurf.height = (height + 31) & ~31;
|
||||||
|
|
||||||
allocSurf.memoryHeap = NV_ENC_MEMORY_HEAP_SYSMEM_CACHED;
|
allocSurf.memoryHeap = NV_ENC_MEMORY_HEAP_SYSMEM_CACHED;
|
||||||
allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_NV12_PL;
|
allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_NV12;
|
||||||
|
|
||||||
nvStatus = pNvEnc->nvEncCreateInputBuffer(encoder, &allocSurf);
|
nvStatus = pNvEnc->nvEncCreateInputBuffer(encoder, &allocSurf);
|
||||||
|
|
||||||
@ -578,7 +543,7 @@ bool NVENCEncoder::Encode(LPVOID picIn, List<DataPacket> &packets, List<PacketTy
|
|||||||
outputSurfaces[i].inSurf = surf;
|
outputSurfaces[i].inSurf = surf;
|
||||||
|
|
||||||
picParams.inputBuffer = surf->inputSurface;
|
picParams.inputBuffer = surf->inputSurface;
|
||||||
picParams.bufferFmt = NV_ENC_BUFFER_FORMAT_NV12_PL;
|
picParams.bufferFmt = NV_ENC_BUFFER_FORMAT_NV12;
|
||||||
picParams.inputWidth = width;
|
picParams.inputWidth = width;
|
||||||
picParams.inputHeight = height;
|
picParams.inputHeight = height;
|
||||||
picParams.outputBitstream = outputSurfaces[i].outputSurface;
|
picParams.outputBitstream = outputSurfaces[i].outputSurface;
|
||||||
@ -589,7 +554,6 @@ bool NVENCEncoder::Encode(LPVOID picIn, List<DataPacket> &packets, List<PacketTy
|
|||||||
picParams.inputDuration = 0;
|
picParams.inputDuration = 0;
|
||||||
picParams.codecPicParams.h264PicParams.sliceMode = encodeConfig.encodeCodecConfig.h264Config.sliceMode;
|
picParams.codecPicParams.h264PicParams.sliceMode = encodeConfig.encodeCodecConfig.h264Config.sliceMode;
|
||||||
picParams.codecPicParams.h264PicParams.sliceModeData = encodeConfig.encodeCodecConfig.h264Config.sliceModeData;
|
picParams.codecPicParams.h264PicParams.sliceModeData = encodeConfig.encodeCodecConfig.h264Config.sliceModeData;
|
||||||
memcpy(&picParams.rcParams, &encodeConfig.rcParams, sizeof(NV_ENC_RC_PARAMS));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1006,8 +970,6 @@ String NVENCEncoder::GetInfoString() const
|
|||||||
preset = "losslesshp";
|
preset = "losslesshp";
|
||||||
else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_DEFAULT_GUID))
|
else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_DEFAULT_GUID))
|
||||||
preset = "default";
|
preset = "default";
|
||||||
else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_STREAMING))
|
|
||||||
preset = "streaming";
|
|
||||||
|
|
||||||
String profile = "unknown";
|
String profile = "unknown";
|
||||||
if (dataEqual(encodeConfig.profileGUID, NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID))
|
if (dataEqual(encodeConfig.profileGUID, NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID))
|
||||||
@ -1028,17 +990,32 @@ String NVENCEncoder::GetInfoString() const
|
|||||||
profile = "constrained high";
|
profile = "constrained high";
|
||||||
|
|
||||||
String cbr = "no";
|
String cbr = "no";
|
||||||
|
String rcMode = "unknown";
|
||||||
switch (encodeConfig.rcParams.rateControlMode)
|
switch (encodeConfig.rcParams.rateControlMode)
|
||||||
{
|
{
|
||||||
|
case NV_ENC_PARAMS_RC_CONSTQP:
|
||||||
|
rcMode = "constQP";
|
||||||
|
break;
|
||||||
|
case NV_ENC_PARAMS_RC_VBR:
|
||||||
|
rcMode = "vbr";
|
||||||
|
break;
|
||||||
case NV_ENC_PARAMS_RC_CBR:
|
case NV_ENC_PARAMS_RC_CBR:
|
||||||
|
rcMode = "cbr";
|
||||||
cbr = "yes";
|
cbr = "yes";
|
||||||
break;
|
break;
|
||||||
|
case NV_ENC_PARAMS_RC_VBR_MINQP:
|
||||||
|
rcMode = "minQP";
|
||||||
|
break;
|
||||||
case NV_ENC_PARAMS_RC_2_PASS_QUALITY:
|
case NV_ENC_PARAMS_RC_2_PASS_QUALITY:
|
||||||
|
rcMode = "2pass quality";
|
||||||
|
cbr = "yes";
|
||||||
|
break;
|
||||||
case NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP:
|
case NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP:
|
||||||
cbr = "yes (2pass)";
|
rcMode = "2pass framesize cap";
|
||||||
|
cbr = "yes";
|
||||||
break;
|
break;
|
||||||
case NV_ENC_PARAMS_RC_2_PASS_VBR:
|
case NV_ENC_PARAMS_RC_2_PASS_VBR:
|
||||||
cbr = "no (2pass)";
|
rcMode = "2pass vbr";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1065,6 +1042,7 @@ String NVENCEncoder::GetInfoString() const
|
|||||||
TEXT("\r\n profile: ") << profile <<
|
TEXT("\r\n profile: ") << profile <<
|
||||||
TEXT("\r\n level: ") << level <<
|
TEXT("\r\n level: ") << level <<
|
||||||
TEXT("\r\n keyint: ") << IntString(encodeConfig.gopLength) <<
|
TEXT("\r\n keyint: ") << IntString(encodeConfig.gopLength) <<
|
||||||
|
TEXT("\r\n rcMode: ") << rcMode <<
|
||||||
TEXT("\r\n CBR: ") << cbr <<
|
TEXT("\r\n CBR: ") << cbr <<
|
||||||
TEXT("\r\n CFR: ") << cfr <<
|
TEXT("\r\n CFR: ") << cfr <<
|
||||||
TEXT("\r\n max bitrate: ") << IntString(encodeConfig.rcParams.maxBitRate / 1000) <<
|
TEXT("\r\n max bitrate: ") << IntString(encodeConfig.rcParams.maxBitRate / 1000) <<
|
||||||
|
@ -79,6 +79,10 @@ void SettingsAdvanced::SelectPresetDialog(bool useQSV, bool useNVENC)
|
|||||||
ShowWindow(hwndTemp, useNVENC ? SW_SHOW : SW_HIDE);
|
ShowWindow(hwndTemp, useNVENC ? SW_SHOW : SW_HIDE);
|
||||||
EnableWindow(hwndTemp, true);
|
EnableWindow(hwndTemp, true);
|
||||||
|
|
||||||
|
hwndTemp = GetDlgItem(hwnd, IDC_NVENC2PASS);
|
||||||
|
ShowWindow(hwndTemp, useNVENC ? SW_SHOW : SW_HIDE);
|
||||||
|
EnableWindow(hwndTemp, true);
|
||||||
|
|
||||||
hwndTemp = GetDlgItem(hwnd, IDC_QSVPRESET);
|
hwndTemp = GetDlgItem(hwnd, IDC_QSVPRESET);
|
||||||
ShowWindow(hwndTemp, useQSV ? SW_SHOW : SW_HIDE);
|
ShowWindow(hwndTemp, useQSV ? SW_SHOW : SW_HIDE);
|
||||||
EnableWindow(hwndTemp, true);
|
EnableWindow(hwndTemp, true);
|
||||||
@ -187,6 +191,11 @@ void SettingsAdvanced::ApplySettings()
|
|||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
|
|
||||||
|
BOOL bNvencUse2Pass = SendMessage(GetDlgItem(hwnd, IDC_NVENC2PASS), BM_GETCHECK, 0, 0) == BST_CHECKED;
|
||||||
|
AppConfig->SetInt (TEXT("Video Encoding"), TEXT("NVENC2Pass"), bNvencUse2Pass);
|
||||||
|
|
||||||
|
//------------------------------------
|
||||||
|
|
||||||
BOOL bSyncToVideoTime = SendMessage(GetDlgItem(hwnd, IDC_SYNCTOVIDEOTIME), BM_GETCHECK, 0, 0) == BST_CHECKED;
|
BOOL bSyncToVideoTime = SendMessage(GetDlgItem(hwnd, IDC_SYNCTOVIDEOTIME), BM_GETCHECK, 0, 0) == BST_CHECKED;
|
||||||
AppConfig->SetInt (TEXT("Audio"), TEXT("SyncToVideoTime"), bSyncToVideoTime);
|
AppConfig->SetInt (TEXT("Audio"), TEXT("SyncToVideoTime"), bSyncToVideoTime);
|
||||||
|
|
||||||
@ -252,6 +261,8 @@ void SettingsAdvanced::SetDefaults()
|
|||||||
SendMessage(GetDlgItem(hwnd, IDC_ENCODEFULLRANGE), BM_SETCHECK, BST_UNCHECKED, 0);
|
SendMessage(GetDlgItem(hwnd, IDC_ENCODEFULLRANGE), BM_SETCHECK, BST_UNCHECKED, 0);
|
||||||
SendMessage(GetDlgItem(hwnd, IDC_QSVUSEVIDEOENCODERSETTINGS), BM_SETCHECK, BST_UNCHECKED, 0);
|
SendMessage(GetDlgItem(hwnd, IDC_QSVUSEVIDEOENCODERSETTINGS), BM_SETCHECK, BST_UNCHECKED, 0);
|
||||||
SendMessage(GetDlgItem(hwnd, IDC_NVENCPRESET), CB_SETCURSEL, 0, 0);
|
SendMessage(GetDlgItem(hwnd, IDC_NVENCPRESET), CB_SETCURSEL, 0, 0);
|
||||||
|
SendMessage(GetDlgItem(hwnd, IDC_NVENC2PASS), BM_SETCHECK, BST_CHECKED, 0);
|
||||||
|
EnableWindow(GetDlgItem(hwnd, IDC_NVENC2PASS), FALSE);
|
||||||
SendMessage(GetDlgItem(hwnd, IDC_QSVPRESET), CB_SETCURSEL, 0, 0);
|
SendMessage(GetDlgItem(hwnd, IDC_QSVPRESET), CB_SETCURSEL, 0, 0);
|
||||||
EnableWindow(GetDlgItem(hwnd, IDC_QSVVIDEOENCODERSETTINGS), FALSE);
|
EnableWindow(GetDlgItem(hwnd, IDC_QSVVIDEOENCODERSETTINGS), FALSE);
|
||||||
SendMessage(GetDlgItem(hwnd, IDC_SYNCTOVIDEOTIME), BM_SETCHECK, BST_UNCHECKED, 0);
|
SendMessage(GetDlgItem(hwnd, IDC_SYNCTOVIDEOTIME), BM_SETCHECK, BST_UNCHECKED, 0);
|
||||||
@ -417,17 +428,12 @@ INT_PTR SettingsAdvanced::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam
|
|||||||
hwndTemp = GetDlgItem(hwnd, IDC_NVENCPRESET);
|
hwndTemp = GetDlgItem(hwnd, IDC_NVENCPRESET);
|
||||||
static const CTSTR nv_preset_names[16] = {
|
static const CTSTR nv_preset_names[16] = {
|
||||||
TEXT("Automatic"),
|
TEXT("Automatic"),
|
||||||
TEXT("Streaming"),
|
|
||||||
TEXT("Streaming (2pass)"),
|
|
||||||
TEXT("High Quality"),
|
TEXT("High Quality"),
|
||||||
TEXT("High Performance"),
|
TEXT("High Performance"),
|
||||||
TEXT("Bluray Disk"),
|
TEXT("Bluray Disk"),
|
||||||
TEXT("Low Latency"),
|
TEXT("Low Latency"),
|
||||||
TEXT("High Performance Low Latency"),
|
TEXT("High Performance Low Latency"),
|
||||||
TEXT("High Quality Low Latency"),
|
TEXT("High Quality Low Latency"),
|
||||||
TEXT("Low Latency (2pass)"),
|
|
||||||
TEXT("High Performance Low Latency (2pass)"),
|
|
||||||
TEXT("High Quality Low Latency (2pass)"),
|
|
||||||
TEXT("Lossless"),
|
TEXT("Lossless"),
|
||||||
TEXT("High Performance Lossless"),
|
TEXT("High Performance Lossless"),
|
||||||
TEXT("NVDefault"),
|
TEXT("NVDefault"),
|
||||||
@ -438,6 +444,12 @@ INT_PTR SettingsAdvanced::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam
|
|||||||
|
|
||||||
LoadSettingComboString(hwndTemp, TEXT("Video Encoding"), TEXT("NVENCPreset"), nv_preset_names[0]);
|
LoadSettingComboString(hwndTemp, TEXT("Video Encoding"), TEXT("NVENCPreset"), nv_preset_names[0]);
|
||||||
|
|
||||||
|
bool bNvencUse2Pass = AppConfig->GetInt(TEXT("Video Encoding"), TEXT("NVENC2Pass"), 1) != 0;
|
||||||
|
SendMessage(GetDlgItem(hwnd, IDC_NVENC2PASS), BM_SETCHECK, bNvencUse2Pass ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||||
|
|
||||||
|
String strNvencPreset = AppConfig->GetString(TEXT("Video Encoding"), TEXT("NVENCPreset"), nv_preset_names[0]);
|
||||||
|
EnableWindow(GetDlgItem(hwnd, IDC_NVENC2PASS), scmp(strNvencPreset.Array(), nv_preset_names[0]) ? TRUE : FALSE);
|
||||||
|
|
||||||
hwndTemp = GetDlgItem(hwnd, IDC_QSVPRESET);
|
hwndTemp = GetDlgItem(hwnd, IDC_QSVPRESET);
|
||||||
static const struct {
|
static const struct {
|
||||||
CTSTR name;
|
CTSTR name;
|
||||||
@ -633,7 +645,6 @@ INT_PTR SettingsAdvanced::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam
|
|||||||
case IDC_SENDBUFFERSIZE:
|
case IDC_SENDBUFFERSIZE:
|
||||||
case IDC_PRIORITY:
|
case IDC_PRIORITY:
|
||||||
case IDC_BINDIP:
|
case IDC_BINDIP:
|
||||||
case IDC_NVENCPRESET:
|
|
||||||
case IDC_QSVPRESET:
|
case IDC_QSVPRESET:
|
||||||
if(HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE)
|
if(HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE)
|
||||||
{
|
{
|
||||||
@ -643,6 +654,23 @@ INT_PTR SettingsAdvanced::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDC_NVENCPRESET:
|
||||||
|
if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE)
|
||||||
|
{
|
||||||
|
HWND hwndTemp = (HWND)lParam;
|
||||||
|
|
||||||
|
String strNewPreset = GetCBText(hwndTemp);
|
||||||
|
if (scmp(strNewPreset.Array(), TEXT("Automatic")))
|
||||||
|
EnableWindow(GetDlgItem(hwnd, IDC_NVENC2PASS), TRUE);
|
||||||
|
else
|
||||||
|
EnableWindow(GetDlgItem(hwnd, IDC_NVENC2PASS), FALSE);
|
||||||
|
|
||||||
|
if (App->GetVideoEncoder())
|
||||||
|
ShowWindow(GetDlgItem(hwnd, IDC_INFO), SW_SHOW);
|
||||||
|
SetChangedSettings(true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case IDC_DISABLEPREVIEWENCODING:
|
case IDC_DISABLEPREVIEWENCODING:
|
||||||
case IDC_ALLOWOTHERHOTKEYMODIFIERS:
|
case IDC_ALLOWOTHERHOTKEYMODIFIERS:
|
||||||
case IDC_MICSYNCFIX:
|
case IDC_MICSYNCFIX:
|
||||||
@ -654,6 +682,7 @@ INT_PTR SettingsAdvanced::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam
|
|||||||
case IDC_UNLOCKHIGHFPS:
|
case IDC_UNLOCKHIGHFPS:
|
||||||
case IDC_LATENCYMETHOD:
|
case IDC_LATENCYMETHOD:
|
||||||
case IDC_DISABLETCPOPTIMIZATIONS:
|
case IDC_DISABLETCPOPTIMIZATIONS:
|
||||||
|
case IDC_NVENC2PASS:
|
||||||
if(HIWORD(wParam) == BN_CLICKED)
|
if(HIWORD(wParam) == BN_CLICKED)
|
||||||
{
|
{
|
||||||
if (App->GetVideoEncoder())
|
if (App->GetVideoEncoder())
|
||||||
|
@ -374,6 +374,7 @@
|
|||||||
#define IDC_TSRCOPACITY_EDIT 1209
|
#define IDC_TSRCOPACITY_EDIT 1209
|
||||||
#define IDC_IMPORT 1210
|
#define IDC_IMPORT 1210
|
||||||
#define IDC_TSRCOPACITY 1210
|
#define IDC_TSRCOPACITY 1210
|
||||||
|
#define IDC_NVENC2PASS 1211
|
||||||
#define IDA_SOURCE_MOVEUP 40018
|
#define IDA_SOURCE_MOVEUP 40018
|
||||||
#define IDA_SOURCE_MOVEDOWN 40019
|
#define IDA_SOURCE_MOVEDOWN 40019
|
||||||
#define IDA_SOURCE_MOVETOTOP 40020
|
#define IDA_SOURCE_MOVETOTOP 40020
|
||||||
|
@ -248,6 +248,7 @@ Settings.Advanced.VideoEncoderSettings="Custom x264 Encoder Settings"
|
|||||||
Settings.Advanced.VideoEncoderSettingsTooltip="This allows you to set custom x264 encoder settings. In the form of [parameter]=[value] (e.g. \"vbv-maxrate=1000 vbv-bufsize=1000\")."
|
Settings.Advanced.VideoEncoderSettingsTooltip="This allows you to set custom x264 encoder settings. In the form of [parameter]=[value] (e.g. \"vbv-maxrate=1000 vbv-bufsize=1000\")."
|
||||||
Settings.Advanced.X264Profile="Encoding Profile:"
|
Settings.Advanced.X264Profile="Encoding Profile:"
|
||||||
Settings.Advanced.NVENCPreset="NVENC Preset:"
|
Settings.Advanced.NVENCPreset="NVENC Preset:"
|
||||||
|
Settings.Advanced.NVENC2Pass="Twopass Encoding"
|
||||||
Settings.Advanced.QSVPreset="Quick Sync Preset:"
|
Settings.Advanced.QSVPreset="Quick Sync Preset:"
|
||||||
Settings.Advanced.EncodeFullRange="Encode in Full Range"
|
Settings.Advanced.EncodeFullRange="Encode in Full Range"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user