mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
ffmpeg/tools: Fix incorrect colors for sRGB
This commit is contained in:
parent
d85ced4107
commit
b60f68fcb8
1 changed files with 8 additions and 3 deletions
|
@ -250,17 +250,22 @@ void tools::setup_obs_color(video_colorspace colorspace, video_range_type range,
|
||||||
{
|
{
|
||||||
std::map<video_colorspace, std::tuple<AVColorSpace, AVColorPrimaries, AVColorTransferCharacteristic>> colorspaces =
|
std::map<video_colorspace, std::tuple<AVColorSpace, AVColorPrimaries, AVColorTransferCharacteristic>> colorspaces =
|
||||||
{
|
{
|
||||||
{VIDEO_CS_DEFAULT, {AVCOL_SPC_BT470BG, AVCOL_PRI_BT470BG, AVCOL_TRC_SMPTE170M}},
|
|
||||||
{VIDEO_CS_601, {AVCOL_SPC_BT470BG, AVCOL_PRI_BT470BG, AVCOL_TRC_SMPTE170M}},
|
{VIDEO_CS_601, {AVCOL_SPC_BT470BG, AVCOL_PRI_BT470BG, AVCOL_TRC_SMPTE170M}},
|
||||||
{VIDEO_CS_709, {AVCOL_SPC_BT709, AVCOL_PRI_BT709, AVCOL_TRC_BT709}},
|
{VIDEO_CS_709, {AVCOL_SPC_BT709, AVCOL_PRI_BT709, AVCOL_TRC_BT709}},
|
||||||
{VIDEO_CS_SRGB, {AVCOL_SPC_RGB, AVCOL_PRI_BT709, AVCOL_TRC_BT709}},
|
{VIDEO_CS_SRGB, {AVCOL_SPC_RGB, AVCOL_PRI_BT709, AVCOL_TRC_IEC61966_2_1}},
|
||||||
};
|
};
|
||||||
std::map<video_range_type, AVColorRange> colorranges = {
|
std::map<video_range_type, AVColorRange> colorranges = {
|
||||||
{VIDEO_RANGE_DEFAULT, AVCOL_RANGE_MPEG},
|
|
||||||
{VIDEO_RANGE_PARTIAL, AVCOL_RANGE_MPEG},
|
{VIDEO_RANGE_PARTIAL, AVCOL_RANGE_MPEG},
|
||||||
{VIDEO_RANGE_FULL, AVCOL_RANGE_JPEG},
|
{VIDEO_RANGE_FULL, AVCOL_RANGE_JPEG},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
if (colorspace == VIDEO_CS_DEFAULT)
|
||||||
|
colorspace = VIDEO_CS_601;
|
||||||
|
if (range == VIDEO_RANGE_DEFAULT)
|
||||||
|
range = VIDEO_RANGE_PARTIAL;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto found = colorspaces.find(colorspace);
|
auto found = colorspaces.find(colorspace);
|
||||||
if (found != colorspaces.end()) {
|
if (found != colorspaces.end()) {
|
||||||
|
|
Loading…
Reference in a new issue