Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f23ffc009 | |||
| d21687e348 | |||
| 0d574b81ff |
+2
-2
@@ -106,8 +106,8 @@ try {
|
||||
if (!av_codec_is_encoder(cdc))
|
||||
continue;
|
||||
|
||||
if ((cdc->type == AVMediaType::AVMEDIA_TYPE_AUDIO)
|
||||
|| (cdc->type == AVMediaType::AVMEDIA_TYPE_VIDEO)) {
|
||||
if (/*(cdc->type == AVMediaType::AVMEDIA_TYPE_AUDIO)
|
||||
|| */(cdc->type == AVMediaType::AVMEDIA_TYPE_VIDEO)) {
|
||||
auto ptr = std::make_shared<obsffmpeg::encoder_factory>(cdc);
|
||||
ptr->register_encoder();
|
||||
generic_factories.emplace(cdc, ptr);
|
||||
|
||||
@@ -198,6 +198,9 @@ void obsffmpeg::nvenc::get_defaults(obs_data_t* settings, const AVCodec*, AVCode
|
||||
obs_data_set_default_int(settings, ST_OTHER_ZEROLATENCY, -1);
|
||||
obs_data_set_default_int(settings, ST_OTHER_WEIGHTED_PREDICTION, -1);
|
||||
obs_data_set_default_int(settings, ST_OTHER_NONREFERENCE_PFRAMES, -1);
|
||||
|
||||
// Replay Buffer
|
||||
obs_data_set_default_int(settings, "bitrate", 0);
|
||||
}
|
||||
|
||||
static bool modified_ratecontrol(obs_properties_t* props, obs_property_t*, obs_data_t* settings)
|
||||
@@ -595,9 +598,13 @@ void obsffmpeg::nvenc::update(obs_data_t* settings, const AVCodec* codec, AVCode
|
||||
}
|
||||
}
|
||||
|
||||
if (have_bitrate)
|
||||
if (have_bitrate) {
|
||||
context->bit_rate =
|
||||
static_cast<int>(obs_data_get_int(settings, ST_RATECONTROL_BITRATE_TARGET) * 1000);
|
||||
// Support for Replay Buffer
|
||||
obs_data_set_int(settings, "bitrate",
|
||||
obs_data_get_int(settings, ST_RATECONTROL_BITRATE_TARGET));
|
||||
}
|
||||
if (have_bitrate_max)
|
||||
context->rc_max_rate =
|
||||
static_cast<int>(obs_data_get_int(settings, ST_RATECONTROL_BITRATE_MAXIMUM) * 1000);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "prores_aw_handler.hpp"
|
||||
#include "codecs/prores.hpp"
|
||||
#include "ffmpeg/tools.hpp"
|
||||
#include "plugin.hpp"
|
||||
#include "utility.hpp"
|
||||
|
||||
@@ -65,6 +66,26 @@ void obsffmpeg::ui::prores_aw_handler::get_defaults(obs_data_t* settings, const
|
||||
obs_data_set_default_int(settings, P_PRORES_PROFILE, 0);
|
||||
}
|
||||
|
||||
inline const char* profile_to_name(const AVProfile* ptr)
|
||||
{
|
||||
switch (ptr->profile) {
|
||||
case 0:
|
||||
return TRANSLATE(P_PRORES_PROFILE_APCO);
|
||||
case 1:
|
||||
return TRANSLATE(P_PRORES_PROFILE_APCS);
|
||||
case 2:
|
||||
return TRANSLATE(P_PRORES_PROFILE_APCN);
|
||||
case 3:
|
||||
return TRANSLATE(P_PRORES_PROFILE_APCH);
|
||||
case 4:
|
||||
return TRANSLATE(P_PRORES_PROFILE_AP4H);
|
||||
case 5:
|
||||
return TRANSLATE(P_PRORES_PROFILE_AP4X);
|
||||
default:
|
||||
return ptr->name;
|
||||
}
|
||||
}
|
||||
|
||||
void obsffmpeg::ui::prores_aw_handler::get_properties(obs_properties_t* props, const AVCodec* codec,
|
||||
AVCodecContext* context, bool)
|
||||
{
|
||||
@@ -73,27 +94,7 @@ void obsffmpeg::ui::prores_aw_handler::get_properties(obs_properties_t* props, c
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
obs_property_set_long_description(p, TRANSLATE(DESC(P_PRORES_PROFILE)));
|
||||
for (auto ptr = codec->profiles; ptr->profile != FF_PROFILE_UNKNOWN; ptr++) {
|
||||
if (strcmp("apco", ptr->name) == 0) {
|
||||
obs_property_list_add_int(p, TRANSLATE(P_PRORES_PROFILE_APCO),
|
||||
static_cast<int64_t>(ptr->profile));
|
||||
} else if (strcmp("apcs", ptr->name) == 0) {
|
||||
obs_property_list_add_int(p, TRANSLATE(P_PRORES_PROFILE_APCS),
|
||||
static_cast<int64_t>(ptr->profile));
|
||||
} else if (strcmp("apcn", ptr->name) == 0) {
|
||||
obs_property_list_add_int(p, TRANSLATE(P_PRORES_PROFILE_APCN),
|
||||
static_cast<int64_t>(ptr->profile));
|
||||
} else if (strcmp("apch", ptr->name) == 0) {
|
||||
obs_property_list_add_int(p, TRANSLATE(P_PRORES_PROFILE_APCH),
|
||||
static_cast<int64_t>(ptr->profile));
|
||||
} else if (strcmp("ap4h", ptr->name) == 0) {
|
||||
obs_property_list_add_int(p, TRANSLATE(P_PRORES_PROFILE_AP4H),
|
||||
static_cast<int64_t>(ptr->profile));
|
||||
} else if (strcmp("ap4x", ptr->name) == 0) {
|
||||
obs_property_list_add_int(p, TRANSLATE(P_PRORES_PROFILE_AP4X),
|
||||
static_cast<int64_t>(ptr->profile));
|
||||
} else {
|
||||
obs_property_list_add_int(p, ptr->name, ptr->profile);
|
||||
}
|
||||
obs_property_list_add_int(p, profile_to_name(ptr), static_cast<int64_t>(ptr->profile));
|
||||
}
|
||||
} else {
|
||||
obs_property_set_enabled(obs_properties_get(props, P_PRORES_PROFILE), false);
|
||||
@@ -105,12 +106,18 @@ void obsffmpeg::ui::prores_aw_handler::update(obs_data_t* settings, const AVCode
|
||||
context->profile = static_cast<int>(obs_data_get_int(settings, P_PRORES_PROFILE));
|
||||
}
|
||||
|
||||
void obsffmpeg::ui::prores_aw_handler::log_options(obs_data_t* settings, const AVCodec* codec, AVCodecContext*)
|
||||
void obsffmpeg::ui::prores_aw_handler::log_options(obs_data_t* settings, const AVCodec* codec, AVCodecContext* context)
|
||||
{
|
||||
for (auto ptr = codec->profiles; ptr->profile != FF_PROFILE_UNKNOWN; ptr++) {
|
||||
if (ptr->profile == static_cast<int>(obs_data_get_int(settings, P_PRORES_PROFILE)))
|
||||
PLOG_INFO("[%s] Profile: %s", codec->name, ptr->name);
|
||||
PLOG_INFO("[%s] Apple ProRes:", codec->name);
|
||||
ffmpeg::tools::print_av_option_string(context, "profile", " Profile", [&codec](int64_t v) {
|
||||
int val = static_cast<int>(v);
|
||||
for (auto ptr = codec->profiles; (ptr->profile != FF_PROFILE_UNKNOWN) && (ptr != nullptr); ptr++) {
|
||||
if (ptr->profile == val) {
|
||||
return std::string(profile_to_name(ptr));
|
||||
}
|
||||
}
|
||||
return std::string("<Unknown>");
|
||||
});
|
||||
}
|
||||
|
||||
void obsffmpeg::ui::prores_aw_handler::process_avpacket(AVPacket& packet, const AVCodec*, AVCodecContext*)
|
||||
|
||||
Reference in New Issue
Block a user