Skip to main content
yergin
Known Participant
September 14, 2022
Answered

Obtaining the sequence and clip color spaces using the Premiere Pro Effect SDK

  • September 14, 2022
  • 1 reply
  • 1466 views

Hi community,

 

I'd like my effect to know which color spaces both the clip (if applied to a clip) and sequence are set up as - eg. Rec709, HLG or PQ. Something like the ColorSpaceRec struct used by importers, exporters and transmitters would be perfect but I haven't encountered any API like it for effects searching through the SDK headers.

 

The furthest I've gotten so far is getting an "opaque" color space ID for the sequence in the render callback which I can see does change based the sequence's color space setting in Premiere, only I don't know how to get anything meaningful from that opaque ID:

 

        AEFX_SuiteScoper<PF_UtilitySuite4> utilitySuite(inData, kPFUtilitySuite, kPFUtilitySuiteVersion4, outData);
        AEFX_SuiteScoper<PrSDKSequenceInfoSuite> infoSuite(inData, kPrSDKSequenceInfoSuite, kPrSDKSequenceInfoSuiteVersion, outData);

        PrTimelineID timelineID;
        PrSDKColorSpaceID colourSpaceID;
        utilitySuite->GetContainingTimelineID(inData->effect_ref, &timelineID);
        infoSuite->GetWorkingColorSpace(timelineID, &colourSpaceID);

 

Any clues would be appreciated!

This topic has been closed for replies.
Correct answer Bruce Bullis

Thanks Chetan, this is exactly what I'm looking for, however PrSDKColorManagementSuite.h is not included in the latest SDKs available for download (October 2021) from the developer console. How do I get a hold of this API? 


That was an omission. I've sent you the header, directly; future SDK releases will contain PrSDKColorManagementSuite.h.

1 reply

Bruce Bullis
Legend
September 15, 2022

Here are some helpful enumerations, from an upcoming release of the SDK; these values are valid for shipping PPro.

// Supported color Primaries
enum class PrColorPrimaries : csSDK_int32
{
	kBT709 = 1,				// Rec. 709 Primaries
	kBT470M = 4,			// Rec. ITU-R BT.470-6 System M (historical)
	kBT601_625 = 5,			// Rec. ITU-R BT.601-6 625 (PAL)
	kBT601_525 = 6,			// Rec. ITU-R BT.601-6 525 (NTSC)
	kSMPTE_240M = 7,		// functionally equivalent to BT.601-525, code value 6
	kGenericFilm = 8,		// Generic film
	kBT2020 = 9,			// Rec. ITU-R BT.2020-2
	kSMPTE_ST428_1 = 10,	// SMPTE ST 428-1
	kSMPTE_RP431 = 11,		// SMPTE ST 431-2
	kP3D65 = 12,			// SMPTE ST 432-1, P3D65
	kEBU3213 = 22,			// SMPTE EBU3213
	
	// Custom primaries not defined in ITU specifications.
	kSony_SGamut = 1010,		// Sony SGamut
	kSony_SGamut3 = 1011,		// Sony SGamut3
	kSony_SGamut3Cine = 1012,	// Sony SGamut3Cine
	kPanasonic_VGamut = 1020,	// Panasonic VGamut
	kCanon_CGamut = 1030		// Canon CGamut
};

// Supported Transfer Characteristics
enum class PrTransferCharacteristic : csSDK_int32
{
	kBT709 = 1,				// Rec. 709, functionally same as code values 6, 11, 14 and 15
	kBT470M = 4,			// Assumed display gamma 2.2
	kBT470BG = 5,			// Assumed display gamma 2.8
	kBT601 = 6,				// Rec. ITU-R BT.601-6 525 or 625, functionally same as code values 1, 11, 14 and 15
	kSMPTE_240M = 7,		// SMPTE 240M, functtioonallyy same as code values 1, 11, 14, 15
	kLinear = 8,			// Linear curve.
	kIEC61966_2_4 = 11,		// xvYCC, functionally same as code values 1, 6, 14 and 15
	kIEC61966_2_1 = 13,		// IEC 61966-2-1 sRGB or sYCC
	kBT2020a = 14,			// Rec. ITU-R BT.2020, functionally same as code values 1, 6, 11 and 15
	kBT2020b = 15,			// Rec. ITU-R BT.2020, functionally same as code values 1, 6, 11 and 14
	kBT2100PQ = 16,			// SMPTE ST 2084
	kST428_1 = 17,			// DCDM, SMPTE ST428 use Gamma of 2.6
	kBT2100HLG = 18,		// Rec. 2100 HLG
	
	// Custom curves not defined in ITU specifications.
	kSony_SLog2 = 1000,		// Sony SLog2
	kSony_SLog3 = 1001,		// Sony SLog3
	kPanasonic_VLog = 1010,	// Panasonic VLog
	kCanon_CLog2 = 1020,	// Canon CLog2
	kCanon_CLog3 = 1021		// Cannon CLog3
};

// Supported Matrix equations - used for YCC <-> RGB conversions
enum class PrMatrixEquations : csSDK_int32
{
	kIdentity = 0,			// Identity matrix
	kBT709 = 1,				// Rec. ITU-R BT.709-6
	kFCCTitle47 = 4,		// United States Federal Communications Commission Title 47
	kBT601_625 = 5,			// Rec. ITU-R BT.601-6 625, functionally same as code 6
	kBT601_525 = 6,			// Rec. ITU-R BT.601-6 525. functionally same as code 5
	kSMPTE_240M = 7,		// SMPTE 240M
	kBT2020NCL = 9,			// Rec. ITU-R BT.2020-2 non-constant luminance system
	kBT2020CL = 10,			// Rec. ITU-R BT.2020-2 constant luminance system
	kBT2100ICtCp = 14		// Rec. 2100 ICtCp
};

enum class PrEncodingBitDepth : csSDK_int32
{
	k8u = 8,
	k10u = 10,
	k12u = 12,
	k15u = 15,
	k16u = 16,
	k32f = 32
};


yergin
yerginAuthor
Known Participant
September 16, 2022

Thanks Bruce, that looks promising. Is there currently a way to get these values from the PrSDKColorSpaceID GUID or do I need to wait for the upcoming SDK? And are there plans for a similar Effect API for source clips?

Bruce Bullis
Legend
September 16, 2022

Those constants work, and the values are available, today.

There are currently no plans for any API expansion.