コード例 #1
0
ファイル: NVENCEncoder.cpp プロジェクト: FBirth/OBS
String NVENCEncoder::GetInfoString() const
{
    String strInfo;

    String preset = "unknown";
    if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_HP_GUID))
        preset = "hp";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_HQ_GUID))
        preset = "hq";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_BD_GUID))
        preset = "bd";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID))
        preset = "ll";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOW_LATENCY_HP_GUID))
        preset = "llhp";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOW_LATENCY_HQ_GUID))
        preset = "llhq";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOSSLESS_DEFAULT_GUID))
        preset = "lossless";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOSSLESS_HP_GUID))
        preset = "losslesshp";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_DEFAULT_GUID))
        preset = "default";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_STREAMING))
        preset = "streaming";

    String profile = "unknown";
    if (dataEqual(encodeConfig.profileGUID, NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID))
        profile = "autoselect";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_BASELINE_GUID))
        profile = "baseline";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_MAIN_GUID))
        profile = "main";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_HIGH_GUID))
        profile = "high";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_HIGH_444_GUID))
        profile = "high444";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_STEREO_GUID))
        profile = "stereo";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_SVC_TEMPORAL_SCALABILTY))
        profile = "svc temporal";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_CONSTRAINED_HIGH_GUID))
        profile = "constrained high";

    String cbr = "no";
    switch (encodeConfig.rcParams.rateControlMode)
    {
    case NV_ENC_PARAMS_RC_CBR:
        cbr = "yes";
        break;
    case NV_ENC_PARAMS_RC_2_PASS_QUALITY:
    case NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP:
        cbr = "yes (2pass)";
        break;
    case NV_ENC_PARAMS_RC_2_PASS_VBR:
        cbr = "no (2pass)";
        break;
    }

    String cfr = "yes";
    if (encodeConfig.encodeCodecConfig.h264Config.enableVFR)
        cfr = "no";

    String level = "unknown";
    if (encodeConfig.encodeCodecConfig.h264Config.level == 0)
    {
        level = "autoselect";
    }
    else if (encodeConfig.encodeCodecConfig.h264Config.level <= 51)
    {
        level = IntString(encodeConfig.encodeCodecConfig.h264Config.level / 10);
        level << ".";
        level << IntString(encodeConfig.encodeCodecConfig.h264Config.level % 10);
    }

    strInfo << TEXT("Video Encoding: NVENC") <<
            TEXT("\r\n    fps: ") << IntString(initEncodeParams.frameRateNum / initEncodeParams.frameRateDen) <<
            TEXT("\r\n    width: ") << IntString(initEncodeParams.encodeWidth) << TEXT(", height: ") << IntString(initEncodeParams.encodeHeight) <<
            TEXT("\r\n    preset: ") << preset <<
            TEXT("\r\n    profile: ") << profile <<
            TEXT("\r\n    level: ") << level <<
            TEXT("\r\n    keyint: ") << IntString(encodeConfig.gopLength) <<
            TEXT("\r\n    CBR: ") << cbr <<
            TEXT("\r\n    CFR: ") << cfr <<
            TEXT("\r\n    max bitrate: ") << IntString(encodeConfig.rcParams.maxBitRate / 1000) <<
            TEXT("\r\n    avg bitrate: ") << IntString(encodeConfig.rcParams.averageBitRate / 1000) <<
            TEXT("\r\n    buffer size: ") << IntString(encodeConfig.rcParams.vbvBufferSize / 1000);

    if (!bUseCBR)
    {
        strInfo << TEXT("\r\n    quality: ") << IntString(quality);
    }

    return strInfo;
}
コード例 #2
0
ファイル: NVENCEncoder.cpp プロジェクト: kitez/OBS
String NVENCEncoder::GetInfoString() const
{
    String strInfo;

    String preset = "unknown";
    if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_HP_GUID))
        preset = "hp";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_HQ_GUID))
        preset = "hq";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_BD_GUID))
        preset = "bd";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID))
        preset = "ll";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOW_LATENCY_HP_GUID))
        preset = "llhp";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_LOW_LATENCY_HQ_GUID))
        preset = "llhq";
    else if (dataEqual(initEncodeParams.presetGUID, NV_ENC_PRESET_DEFAULT_GUID))
        preset = "default";

    String profile = "unknown";
    if (dataEqual(encodeConfig.profileGUID, NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID))
        profile = "autoselect";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_BASELINE_GUID))
        profile = "baseline";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_MAIN_GUID))
        profile = "main";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_HIGH_GUID))
        profile = "high";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_STEREO_GUID))
        profile = "stereo";
    else if (dataEqual(encodeConfig.profileGUID, NV_ENC_H264_PROFILE_SVC_TEMPORAL_SCALABILTY))
        profile = "svc temporal";

    String cbr = "no";
    if (encodeConfig.rcParams.rateControlMode == NV_ENC_PARAMS_RC_CBR
        || encodeConfig.rcParams.rateControlMode == NV_ENC_PARAMS_RC_CBR2)
    {
        cbr = "yes";
    }

    String cfr = "yes";
    if (encodeConfig.encodeCodecConfig.h264Config.enableVFR)
        cfr = "no";

    String level = "unknown";
    if (encodeConfig.encodeCodecConfig.h264Config.level == 0)
        level = "autoselect";
    else if (encodeConfig.encodeCodecConfig.h264Config.level <= 51)
    {
        level = IntString(encodeConfig.encodeCodecConfig.h264Config.level / 10);
        level << ".";
        level << IntString(encodeConfig.encodeCodecConfig.h264Config.level % 10);
    }

    strInfo << TEXT("Video Encoding: NVENC") <<
        TEXT("\r\n    fps: ") << IntString(initEncodeParams.frameRateNum / initEncodeParams.frameRateDen) <<
        TEXT("\r\n    width: ") << IntString(initEncodeParams.encodeWidth) << TEXT(", height: ") << IntString(initEncodeParams.encodeHeight) <<
        TEXT("\r\n    preset: ") << preset <<
        TEXT("\r\n    profile: ") << profile <<
        TEXT("\r\n    level: ") << level <<
        TEXT("\r\n    keyint: ") << IntString(encodeConfig.gopLength) <<
        TEXT("\r\n    CBR: ") << cbr <<
        TEXT("\r\n    CFR: ") << cfr <<
        TEXT("\r\n    max bitrate: ") << IntString(encodeConfig.rcParams.maxBitRate / 1000) <<
        TEXT("\r\n    buffer size: ") << IntString(encodeConfig.rcParams.vbvBufferSize / 1000);

    return strInfo;
}