cineform-sdk icon indicating copy to clipboard operation
cineform-sdk copied to clipboard

LUTPaths: when is it used/useful?

Open shekh opened this issue 6 years ago • 10 comments

There is some weirdness here (hardcoded fully qualified path) https://github.com/gopro/cineform-sdk/blob/1eb2cb7914c38db128b9518ab25dd9f3f24c9890/Codec/lutpath.cpp#L483

and here https://github.com/gopro/cineform-sdk/blob/1eb2cb7914c38db128b9518ab25dd9f3f24c9890/DecoderSDK/SampleMetadata.cpp#L62

Is this actually executed at some point? Also there are registry access, system variable access etc. Is it a convention shared between all CineForm-enabled programs? Which programs create these registry keys and lut files?

shekh avatar Nov 20 '17 13:11 shekh

I’m also interested in knowing more about the use of LUTs in CineForm.

retokromer avatar Nov 20 '17 13:11 retokromer

Active Metadata is runs out of this path. CineForm FirstLight and GoPro Studio uses these for color correction and other visual enhancements that occur during decode. Also the defaults paths are typically overridden with system environment controls.

dnewman-gpsw avatar Nov 20 '17 18:11 dnewman-gpsw

I just noted that Active Metadata was not be supported within VDFM, some CineForm user will miss this (including myself).

dnewman-gpsw avatar Nov 21 '17 18:11 dnewman-gpsw

Good to know. I planned to collect some feedback and then have second attempt.

What do you think about replacing "C:\Program Files\Common Files\" with SHGetSpecialFolderPathW(CSIDL_PROGRAM_FILES_COMMON)? Leaving it as is leads to undefined behavior where c: drive does not exist, is removable, remote etc.

Also related somehow.. Is anyone having trouble compiling with atlbase/ccombstr dependency? It seems quite unnecessary, I`d love to see it go away (please somebody replace it with std::wstring :)

shekh avatar Nov 21 '17 19:11 shekh

Ok, atlbase can be removed with no loss by adding this fragment to settings.h

#include <tchar.h>

class CComBSTR
{
public:
	char* str;

	CComBSTR()
	{
		str = NULL;
	}

	CComBSTR(LPCSTR pSrc)
	{
		str = NULL;
		if(pSrc){
			int size = strlen(pSrc);
			str = (char*)malloc(size+1);
			strcpy(str,pSrc);
		}
	}

	~CComBSTR()
	{
		free(str);
	}
};

#define USES_CONVERSION

inline char* OLE2T(CComBSTR& a){ return a.str; }

shekh avatar Nov 24 '17 12:11 shekh

Cool. I will try that out.

dnewman-gpsw avatar Nov 24 '17 16:11 dnewman-gpsw

This didn't work for me. So I cleaned up the code a different way. I have removed settings.cpp/h and atlbase.h from the Windows builds.

dnewman-gpsw avatar Nov 25 '17 19:11 dnewman-gpsw

Great. Now it looks like it does not need the registry key to exist (SOFTWARE\CineForm\ColorProcessing) Is it still good idea to think: if there is any AM db the key also exists and points to db? In previous code if(cfg.Open...) looked like the intent was to check for key existence.

shekh avatar Nov 25 '17 20:11 shekh

An existing CineForm users will have these setup via the registry keys. New users can run with the defaults as they have not disk based database of active metadata changes. Users can manipulate the LUTPaths and DBPaths for interesting workflows like this https://vimeo.com/10024749

dnewman-gpsw avatar Nov 25 '17 20:11 dnewman-gpsw

Has anyone implemented metadata support outside of first light?

zcream avatar Feb 17 '20 19:02 zcream