Accessing Nuke’s Write node advanced Compression Settings dialog with Python.

Written by Gary Kelly on .

There are a couple different ways of working with the Compression Settings panel for setting up a Quicktime in Nuke’s Write node.

write node advanced

Setting fps, quality & keyframe rate.

Nuke adds 3 additional hidden knobs: ‘fps’, ‘quality’ & ‘keyframerate’ to the Write node after selecting ‘MOV’ as the file type. (it actually adds 4, but i’ll cover that in a second…)

You can set them the same way you would with other knobs:

w = nuke.createNode(‘Write’)


The ‘settings’ knob.

As well as the 3 above, an additional knob named ‘settings’ is available as a way to access the Compression Settings dialog.

By default, the ‘settings’ knob is a blank string. When you change the settings in the dialog though, this knob stores a serialized data string that can be used to reproduce those settings.

Start by opening the Compression Settings dialog and enter all the settings you want. When you’re done, click OK.

Either print the value of the knob in Nuke’s Script Editor, or copy and paste the Write node into a plain text editor. Either way you’re looking for the large string that the ‘settings’ knob is storing. So for example: Assuming you only have your Write node selected, with all the required settings applied, enter this into Nuke’s Script Editor…

i = nuke.selectedNode()

print i.knob(‘settings’).value()

This should return a big long string that looks something like this:


You can now copy and store that string for use in your code to setup the advanced Compression Settings dialog.

w = nuke.createNode(‘Write’)



0 # Ezequiel Cesana 2014-02-17 21:44
0 # Tom Feist-Wilson 2015-04-13 13:35
unfortunately this didn't work for me :(

I've noted a small correction that needs to be made to the above, with Nuke 8 at least, that for setting the value of the file_type should be in lower case for the MOV

should be
I saved my settings for the write file as a node pre-set and it's interesting the long coded value is listed as "mov.settings" rather than simply "settings". The fps and key frame rate are also handled as separate attributes "mov.fps" and "mov.keyframerate" respectively. However using these strings to set values hasn't been successful for me so far.

I also tried to load in the pre-set I'd made in the and then use:
nuke.applyUserPreset("Write1", "MyWritePreset")
Where "MyWritePreset" is the name I've called my pre-set. The problem here though is that nuke won't accept a node in the first argument ("Write1") only a string...not very handy if you're trying to iterate over things.

If anyone can shed some light on this I'd love to hear it :)
0 # Tom Feist-Wilson 2015-04-13 14:12

I managed to set my fps using the code below. Got stuck for a bit trying to figure out why it was coming up with errors about having two float values. I didn't know you have to use the float() fiction built in to python to do this!


fpsValue = float(YourFPS)
w.knob("fps").setValue(fpsValue )
where YourFPS is a variable describing your desired fps. In my personal example I was actually just using a straight integer (25)
+1 # punit vishwkarma 2023-03-28 11:44
Im not getting AVID QT Format: DNx36 MXF(w/ALE) option in nuke 13 to render video file . can someone please help me out ?

You have no rights to post comments

We have 2531 guests and 46 members online