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

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’)
w.knob(‘file_type’).setValue(‘MOV’)
w.knob(‘codec’).setValue(‘avc1’)
w.knob(‘fps’).setValue(25)
w.knob(‘quality’).setValue(‘Normal’)
w.knob(‘keyframerate’).setValue(‘12’)
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:
0000000000000000000000000000019a7365616e0000000100000001000000000000018676696465000000010000000e00000000000000227370746c0000000100000000000000006176633100000000001800000400000000207470726c00000001000000000000000000000400001e00000000000c000000246472617400000001000000000000000000465000000000530000010000000100000000156d70736f00000001000000000000000000000000186d66726100000001000000000000000000000000000000187073667200000001000000000000000000000000000000156266726100000001000000000000000001000000166d70657300000001000000000000000001000000002868617264000000010000000000000000000000000000000000000000000000000000000000000016656e647300000001000000000000000000000000001663666c67000000010000000000000000004400000018636d66720000000100000000000000006170706c00000014636c75740000000100000000000000000000001c766572730000000100000000000000000003001c00010000
You can now copy and store that string for use in your code to setup the advanced Compression Settings dialog.
w = nuke.createNode(‘Write’)
w.knob(‘file_type’).setValue(‘MOV’)
w.knob(‘codec’).setValue(‘avc1’)w.knob(‘settings’).value(‘0000000000000000000000000000019a7365616e0000000100000001000000000000018676696465000000010000000e00000000000000227370746c0000000100000000000000006176633100000000001800000400000000207470726c00000001000000000000000000000400001e00000000000c000000246472617400000001000000000000000000465000000000530000010000000100000000156d70736f00000001000000000000000000000000186d66726100000001000000000000000000000000000000187073667200000001000000000000000000000000000000156266726100000001000000000000000001000000166d70657300000001000000000000000001000000002868617264000000010000000000000000000000000000000000000000000000000000000000000016656e647300000001000000000000000000000000001663666c67000000010000000000000000004400000018636d66720000000100000000000000006170706c00000014636c75740000000100000000000000000000001c766572730000000100000000000000000003001c00010000’)