Scripts to change QT NCLC tag within Flame

Yes in Mac, haven’t checked in PC.
When I open the QT and press Apple+I for Info, the file shows up as 1-2-1.
This is how I do it with AMCDX, starting at 20:30:

-Ted

So some of this is hit or miss with FFMpeg encoding of mp4 files. The python scripts I have for client posting do not work with AMCDX. I’ve created other scripts for encoding mp4s that do. I’m going to try to mesh them both together since the pythons scripts are better encoding.
That being said we have been able to use AMCDX for changing the metadata flag to 1 2 1 so it is read correctly on MacOS with the correct gamma.
Also i’ve been able to install it on CentOS Linux release 7.6.1810 (Core)

When running the command line version of AMCDX I get these errors.

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card

This is on CentOS 7.6

Big thanks to @kyleobley and @finnjaeger for their help in this. I’m now able to right click .mp4 files in the MediaHub in Flame and change them to 1-2-1 and gamma 2.4 using their scripts and AMCDX.

1 Like

Very cool. Is that something you can share?

Here’s the 3 files that are needed.
I put the AMCDX file in /opt/Autodesk/myusername/AMCDXVideoPatcher
I also put nclc.py there as well.
Put nclc_mediahub_tag.py in /opt/Autodesk/shared/python/
Change line 46 in nclc.py to reflect the path of AMCDXVideoPatcherCLI.
Change line 43 in nclc_mediahub_tag.py to show path of nclc.py
make sure everything is run executable.
Refresh python

That should be it. This runs for me on Linux. Right click on an mp4 in the MediaHub. QT NCLC Tagging should pop up.

nclc.py can also be run from command line with the following structure.
nclc.py 1 2 1 2.4 /path/to/file/file.mp4

Thank Kyle Obley for this. He did all the work.

nclc.py.zip (1.4 MB)

1 Like

Hey. I’m trying to use nclc python in 2023. Terminal reports some python error in some lines. Maybe it need some update to python 3.x from python 2.x.

My goal is try to modify the code to add a 1-13-1 tagging option. My dear colour artist colleague has decided that the life is too easy and he exports color renders with 1-13-1. :triumph: … and now I have to export with this tag. I’m using amcdx gui tool but I’d like to come back to this python hook.

If you’re using the above script, it works fine in the current beta. So it should work in all flavors of 2023. I did change the name of it.
nclc_mediahub_tag_20230210.zip (1.5 KB)

Hmm…I’ll have a look when I can but it looks like @Hengy has already modified it below. As an aside, you can also tag a clip as srgb display and Flame will tag it as 1-13-1 if I remember correctly.

Good tip. It works, but I prefer use the python hook. It’s more flexible to change the tag as many times I need without re-save.

With the last version posted above by Hengy I have same error.

First, on flame start:


Python encountered SystemExit('\nUsage: python  primaries transfer matrix gamma /path/to/mov\n') in unknown code
[PYTHON HOOK] An error occurred. Ignoring python hooks from /opt/Autodesk/shared/python/nclc/nclc.py

When I try to use it:

File:  /mnt/RAID/test_color.mp4
Setting to:  1 - 2 - 1  Gamma:  2.4
Finished.
Python encountered SystemExit('\nUsage: python  primaries transfer matrix gamma /path/to/mov\n') in unknown code
[PYTHON HOOK] An error occurred. Ignoring python hooks from /opt/Autodesk/shared/python/nclc/nclc.py

It’s something related to sysargs check. I wonder if it’s a syntax mistake caused by python version . I tried to bypass that line but I get another error (IndexError ‘List index out of range’ in unknown code). I searched about possible updates about sysargs , but with my poor python skills, it was a waste of time.

First, nclc.py should not be in a directory where Flame will look for Python hooks as it’s a stand-alone script that can be used outside of Flame.

Second, try commenting out lines 55 & 65 in nclc.py where it says sys.exit. Hopefully these two things will sort you out but if not, let me know and I’ll have a closer look.

1 Like

Yeah. Stupid of me. I didn’t realize. In my first tests I had nclc.py and cli binary in other folder. Now it’s working. Without comment any line.

Here is the script with 1-13-1 option added. And, in addition, I added a second condition to is_mov def, to allow the script work with Quicktimes and .mp4. at the same time. I’m a newbie coding, so if anyone is interested, check if this changes are well written.

I checked it out and it works. With quicktimes and .mp4, thought, “actual” .mp4 , at least generated by handbrake, (not quicktime renamed) does not handle colour tags.

nclc_mediahub_tag with -1-13-1.zip (1,5 KB)

1 Like

The python hook is not changing anything when using the contextual menu. I also tried using the latest nclc_mediahub_tag 1-13-1 script posted above. Any ideas?

OSX Monterey
Flame 2023.3
AMCDX v0.6.5

I can notice some random behavior. Sometimes it works the first time, sometimes I have to try a couple of times. But it ends up working. I’m using it since I posted my version. Both mov and mp4 files. I’m on linux , using amcdx cli version.

Don’t forget you have to refresh the mediahub (r key) and display the metadata information again to check changes.

Are there any errors in the terminal? That’s the only way to start figuring out what could be wrong.

1 Like

you can also “natively”
export 1-13-1 tags from flame, if you tag your source in the timeline as sRGB and then export with lut turned on to sRGB it will write 1-13-1 …

NCLC Tag Change <<<
File: /PathToFile/movie.mov
Setting to: 1 - 1 - 1 Gamma: 0
Rec 709, Legacy (1-1-1) execute callback [<function rec709_legacy at 0x181d2a9d0>((<flame.PyMediaHubFilesEntry object at 0x189ef7270>,),)] failed because of an error of type FileNotFoundError(2, ‘No such file or directory’)

Looks like the locations of nclc.py (within the media hub script) and/or AMCDX (within nclc.py) haven’t been set up properly. They need to point to the correct locations of either. Give that a go and let me know if it’s still not working.

Looks right to the untrained eye.

Line #47 in nclc.py is pointing to the correct location in OSX
(amcdxLocMac = “/Applications/AMCDXVideoPatcher.app/Contents/MacOS/AMCDXVideoPatcher”)

and line #43 in nclc_mediahub_tag.py is also pointing to the correct path of nclc.py
(nclcLoc = “/opt/Autodesk/EKDAHL/nclc.py”)

Your media path or file might have space in its file name. You can fix that by either making sure to replace space with underscore, sanitized the input path / file name using replace string method OR build the command so spaces are escaped.

As a rule of thumb when creating a script which runs a shell command, you should always print the command (to the terminal) so you can see the actual command and try it. This will save you hours.