Browse Source

2021-07-22 02

nukeffmpeg: added create vcurrent. Saves a copy of the output file one dir higher and replaces v#### with vcurrent
Martin Sächsinger 3 years ago
parent
commit
693961e58f

+ 8
- 0
README.md View File

54
 
54
 
55
 
55
 
56
 ##### Changelog:
56
 ##### Changelog:
57
+`2021-07-22 02`
58
+
59
+`nukeffmpeg: added create vcurrent. Saves a copy of the output file one dir higher and replaces v#### with vcurrent`
60
+
61
+
62
+
57
 `2021-07-22`
63
 `2021-07-22`
58
 
64
 
59
 `sceneControl: our_write. Added Element to filepath if configured in sceneControl.`
65
 `sceneControl: our_write. Added Element to filepath if configured in sceneControl.`
61
 `Denoise with Noise: Added alert if denoise output is the same as input.`
67
 `Denoise with Noise: Added alert if denoise output is the same as input.`
62
 
68
 
63
 
69
 
70
+`__________`
71
+
64
 
72
 
65
 `2021-07-12`
73
 `2021-07-12`
66
 
74
 

BIN
doc/ffmpegWrite.jpg View File


+ 15
- 14
pythonpluginsUI/nukeffmpeg/Preview_QT.nk View File

2
 version 12.2 v5
2
 version 12.2 v5
3
 push $cut_paste_input
3
 push $cut_paste_input
4
 Group {
4
 Group {
5
- name Preview_QT
5
+ name Preview_QT2
6
  tile_color 1
6
  tile_color 1
7
- label "h264 intra\n\[value nodeLabel]"
7
+ label "h264 standard\n\[value nodeLabel]"
8
  selected true
8
  selected true
9
- xpos -5
10
- ypos -51
9
+ xpos 313
10
+ ypos 39
11
  addUserKnob {20 ffmpeg}
11
  addUserKnob {20 ffmpeg}
12
  addUserKnob {35 presets M {"Prores 422" "knobs this \{ffmpeg_args \"-c:v prores_ks -profile:v 2 -qscale:v 7 -pix_fmt yuv444p10le -r 24 -vf colormatrix=bt601:bt709 -vendor ap10 -metadata:s encoder=\\\"Apple ProRes 422\\\"\" framerate 24 label \"Prores 422\\n\[value nodeLabel]\"\}" "Prores 422 HQ" "knobs this \{ffmpeg_args \"-c:v prores_ks -profile:v 3 -qscale:v 7 -pix_fmt yuv444p10le -r 24 -vf colormatrix=bt601:bt709 -vendor ap10 -metadata:s encoder=\\\"Apple ProRes 422 HQ\\\"\" framerate 24 label \"Prores 422 HQ\\n\[value nodeLabel]\"\}" "Prores 4444" "knobs this \{ffmpeg_args \"-c:v prores_ks -profile:v 4 -qscale:v 5 -pix_fmt yuv444p10le -r 24 -vf colormatrix=bt601:bt709 -vendor ap10 -metadata:s encoder=\\\"Apple ProRes 4444\\\"\\\"\" framerate 24 label \"Prores 4444\\n\[value nodeLabel]\"\}" "DNxHD 36" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p -b:v 36M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 36\\n\[value nodeLabel]\"\}" "DNxHD 115" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p -b:v 115M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 115\\n\[value nodeLabel]\"\}" "DNxHD 175" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p -b:v 175M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 175\\n\[value nodeLabel]\"\}" "DNxHD 175 10bit" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p10 -b:v 175M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 175 10bit\\n\[value nodeLabel]\"\}" "DNxHD 220 10bit" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p10 -b:v 220M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 220 10bit\\n\[value nodeLabel]\"\}" "DNxHR HQ" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -vf \\\"colormatrix=bt601:bt709\\\"\" framerate 24 label \"DNxHR HQ\\n\[value nodeLabel]\"\}" "DNxHR HQX" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhr_hqx -pix_fmt yuv422p10le -vf \\\"colormatrix=bt601:bt709\\\"\" framerate 24 label \"DNxHR HQX\\n\[value nodeLabel]\"\}" "DNxHR 444" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhr_444 -pix_fmt yuv444p10le -vf \\\"colormatrix=bt601:bt709\\\"\" framerate 24 label \"DNxHR 444\\n\[value nodeLabel]\"\}" "h264 standard" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high -crf 15 -preset slow -tune film -pix_fmt yuv420p -g 4 -bf 2 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 standard\\n\[value nodeLabel]\"\}" "h264 intra" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high -crf 12 -preset slow -tune film -pix_fmt yuv420p -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 intra\\n\[value nodeLabel]\"\}" "h264 intra 444" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high444 -crf 12 -preset slow -tune film -pix_fmt yuv444p -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 intra 444\\n\[value nodeLabel]\"\}" "h264 intra 444 10bit" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high444 -crf 12 -preset slow -tune film -pix_fmt yuv444p10le -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 intra 444 10bit\\n\[value nodeLabel]\"\}" "h265 standard 10bit" "knobs this \{ffmpeg_args \"-c:v libx265 -profile:v main10 -crf 15 -preset slow -tune psnr -pix_fmt yuv420p10le -g 2 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h265 standard 10bit\\n\[value nodeLabel]\"\}" "h265 intra 422 10bit" "knobs this \{ffmpeg_args \"-c:v libx265 -profile:v main422-10-intra -crf 12 -preset slow -tune psnr -pix_fmt yuv422p10le -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h265 intra 10bit\\n\[value nodeLabel]\"\}" "h265 intra 444 10bit" "knobs this \{ffmpeg_args \"-c:v libx265 -profile:v main444-10-intra -crf 12 -preset slow -tune psnr -pix_fmt yuv444p10le -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h265 intra 444 10bit\\n\[value nodeLabel]\"\}"}}
12
  addUserKnob {35 presets M {"Prores 422" "knobs this \{ffmpeg_args \"-c:v prores_ks -profile:v 2 -qscale:v 7 -pix_fmt yuv444p10le -r 24 -vf colormatrix=bt601:bt709 -vendor ap10 -metadata:s encoder=\\\"Apple ProRes 422\\\"\" framerate 24 label \"Prores 422\\n\[value nodeLabel]\"\}" "Prores 422 HQ" "knobs this \{ffmpeg_args \"-c:v prores_ks -profile:v 3 -qscale:v 7 -pix_fmt yuv444p10le -r 24 -vf colormatrix=bt601:bt709 -vendor ap10 -metadata:s encoder=\\\"Apple ProRes 422 HQ\\\"\" framerate 24 label \"Prores 422 HQ\\n\[value nodeLabel]\"\}" "Prores 4444" "knobs this \{ffmpeg_args \"-c:v prores_ks -profile:v 4 -qscale:v 5 -pix_fmt yuv444p10le -r 24 -vf colormatrix=bt601:bt709 -vendor ap10 -metadata:s encoder=\\\"Apple ProRes 4444\\\"\\\"\" framerate 24 label \"Prores 4444\\n\[value nodeLabel]\"\}" "DNxHD 36" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p -b:v 36M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 36\\n\[value nodeLabel]\"\}" "DNxHD 115" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p -b:v 115M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 115\\n\[value nodeLabel]\"\}" "DNxHD 175" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p -b:v 175M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 175\\n\[value nodeLabel]\"\}" "DNxHD 175 10bit" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p10 -b:v 175M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 175 10bit\\n\[value nodeLabel]\"\}" "DNxHD 220 10bit" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhd -pix_fmt yuv422p10 -b:v 220M -vf \\\"scale=1920:1080,fps=24000/1001,colormatrix=bt601:bt709\\\"\" framerate 23.976 label \"DNxHD 220 10bit\\n\[value nodeLabel]\"\}" "DNxHR HQ" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -vf \\\"colormatrix=bt601:bt709\\\"\" framerate 24 label \"DNxHR HQ\\n\[value nodeLabel]\"\}" "DNxHR HQX" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhr_hqx -pix_fmt yuv422p10le -vf \\\"colormatrix=bt601:bt709\\\"\" framerate 24 label \"DNxHR HQX\\n\[value nodeLabel]\"\}" "DNxHR 444" "knobs this \{ffmpeg_args \"-c:v dnxhd -profile:v dnxhr_444 -pix_fmt yuv444p10le -vf \\\"colormatrix=bt601:bt709\\\"\" framerate 24 label \"DNxHR 444\\n\[value nodeLabel]\"\}" "h264 standard" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high -crf 15 -preset slow -tune film -pix_fmt yuv420p -g 4 -bf 2 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 standard\\n\[value nodeLabel]\"\}" "h264 intra" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high -crf 12 -preset slow -tune film -pix_fmt yuv420p -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 intra\\n\[value nodeLabel]\"\}" "h264 intra 444" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high444 -crf 12 -preset slow -tune film -pix_fmt yuv444p -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 intra 444\\n\[value nodeLabel]\"\}" "h264 intra 444 10bit" "knobs this \{ffmpeg_args \"-c:v libx264 -profile:v high444 -crf 12 -preset slow -tune film -pix_fmt yuv444p10le -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h264 intra 444 10bit\\n\[value nodeLabel]\"\}" "h265 standard 10bit" "knobs this \{ffmpeg_args \"-c:v libx265 -profile:v main10 -crf 15 -preset slow -tune psnr -pix_fmt yuv420p10le -g 2 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h265 standard 10bit\\n\[value nodeLabel]\"\}" "h265 intra 422 10bit" "knobs this \{ffmpeg_args \"-c:v libx265 -profile:v main422-10-intra -crf 12 -preset slow -tune psnr -pix_fmt yuv422p10le -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h265 intra 10bit\\n\[value nodeLabel]\"\}" "h265 intra 444 10bit" "knobs this \{ffmpeg_args \"-c:v libx265 -profile:v main444-10-intra -crf 12 -preset slow -tune psnr -pix_fmt yuv444p10le -g 1 -bf 0 -vf colormatrix=bt601:bt709\" framerate 24 label \"h265 intra 444 10bit\\n\[value nodeLabel]\"\}"}}
13
  addUserKnob {1 ffmpeg_args l "ffmpeg args"}
13
  addUserKnob {1 ffmpeg_args l "ffmpeg args"}
14
- ffmpeg_args "-c:v libx264 -profile:v high -crf 12 -preset slow -tune film -pix_fmt yuv420p -g 1 -bf 0 -vf colormatrix=bt601:bt709"
14
+ ffmpeg_args "-c:v libx264 -profile:v high -crf 15 -preset slow -tune film -pix_fmt yuv420p -g 4 -bf 2 -vf colormatrix=bt601:bt709"
15
  addUserKnob {26 ""}
15
  addUserKnob {26 ""}
16
  addUserKnob {1 info t "Additional non-mandatory File Info"}
16
  addUserKnob {1 info t "Additional non-mandatory File Info"}
17
  addUserKnob {2 file t "output file"}
17
  addUserKnob {2 file t "output file"}
18
- file //calculon/o/_projekte/HOTZ/550_previewQTs/010/010/HOT_comp_010_010.comp_v001/HOT_comp_010_010.comp_v001.mp4
19
- addUserKnob {22 setfilepath l "Set Filepath" t "Creates a valid filename.\nUses the main task of SceneControl and points to the PreviewQT Dir." T "n = nuke.thisNode()\ninfo = n\['info'].value()\nffmpeg_args = n\['ffmpeg_args'].value()\n\nif 'dnxhd' in ffmpeg_args:\n    extension = 'mov'\nif 'libx264' in ffmpeg_args:\n    extension = 'mp4'\nif 'libx265' in ffmpeg_args:\n    extension = 'mp4'\nif 'prores' in ffmpeg_args:\n    extension = 'mov'\n\noutputpath = sceneControl.kenvQuery('PREVIEW_QT_FILE', minor_version=None, info=info, ext=extension, USE_ENV_PROJECTROOT=False)\n\nn.knobs()\[\"file\"].setValue(outputpath)\n\n# create label for displaying the generated output\n# autoLabel = \"n.name() + '\\\\n' +n\['file'].value().split('/')\[-1] +  '\\\\n' + n\['label'].value()\"\n# n\['autolabel'].setValue(autoLabel)" +STARTLINE}
18
+ file //calculon/o/_projekte/HOTZ/550_previewQTs/001/030/HOT_comp_001_030.comp_v001/HOT_comp_001_030.comp_v001.mp4
19
+ addUserKnob {22 setfilepath l "Set Filepath" t "Creates a valid filename.\nUses the main task of SceneControl and points to the PreviewQT Dir." T "n = nuke.thisNode()\ninfo = n\['info'].value()\nffmpeg_args = n\['ffmpeg_args'].value()\n\nif 'dnxhd' in ffmpeg_args:\n    extension = 'mov'\nif 'libx264' in ffmpeg_args:\n    extension = 'mp4'\nif 'libx265' in ffmpeg_args:\n    extension = 'mp4'\nif 'prores' in ffmpeg_args:\n    extension = 'mov'\n\noutputpath = sceneControl.kenvQuery('PREVIEW_QT_FILE', minor_version=None, info=info, ext=extension)\n\nn.knobs()\[\"file\"].setValue(outputpath)\n\n# create label for displaying the generated output\n# autoLabel = \"n.name() + '\\\\n' +n\['file'].value().split('/')\[-1] +  '\\\\n' + n\['label'].value()\"\n# n\['autolabel'].setValue(autoLabel)" +STARTLINE}
20
  addUserKnob {26 ""}
20
  addUserKnob {26 ""}
21
  addUserKnob {1 burnNameText l burn-in}
21
  addUserKnob {1 burnNameText l burn-in}
22
  burnNameText "\[python \{nuke.thisNode().knobs()\['file'].value().split('/')\[-1].replace('.mp4','').replace('.mov','')\}]"
22
  burnNameText "\[python \{nuke.thisNode().knobs()\['file'].value().split('/')\[-1].replace('.mp4','').replace('.mov','')\}]"
37
  burnName true
37
  burnName true
38
  addUserKnob {6 burnFrame l "Burn-in Frame" -STARTLINE}
38
  addUserKnob {6 burnFrame l "Burn-in Frame" -STARTLINE}
39
  burnFrame true
39
  burnFrame true
40
+ addUserKnob {6 vcurrent l "Create vcurrent" -STARTLINE}
41
+ vcurrent true
40
  addUserKnob {26 ""}
42
  addUserKnob {26 ""}
41
  addUserKnob {7 framerate R 23 30}
43
  addUserKnob {7 framerate R 23 30}
42
- framerate {{"\[python \{nuke.root().knobs()\['fps'].value()\}]"}}
44
+ framerate 24
43
  addUserKnob {1 framerange -STARTLINE}
45
  addUserKnob {1 framerange -STARTLINE}
44
  framerange 1001-1024
46
  framerange 1001-1024
45
  addUserKnob {22 set_framerange l "Set to Input" -STARTLINE T "n = nuke.thisNode()\nfr = n.frameRange()\nn\['framerange'].setValue(\"\{0\}-\{1\}\".format(fr.first(), fr.last()))"}
47
  addUserKnob {22 set_framerange l "Set to Input" -STARTLINE T "n = nuke.thisNode()\nfr = n.frameRange()\nn\['framerange'].setValue(\"\{0\}-\{1\}\".format(fr.first(), fr.last()))"}
59
   xpos -6
61
   xpos -6
60
   ypos -16
62
   ypos -16
61
  }
63
  }
62
-set N4966fc00 [stack 0]
64
+set N47169c00 [stack 0]
63
  Text2 {
65
  Text2 {
64
   font_size_toolbar 100
66
   font_size_toolbar 100
65
   font_width_toolbar 100
67
   font_width_toolbar 100
66
   font_height_toolbar 100
68
   font_height_toolbar 100
67
   message "\[value parent.burnNameText]"
69
   message "\[value parent.burnNameText]"
68
-  old_message {{72 79 84 95 99 111 109 112 95 48 49 48 95 48 49 48 46 99 111 109 112 95 118 48 48 49}
70
+  old_message {{72 79 84 95 99 111 109 112 95 48 48 49 95 48 51 48 46 99 111 109 112 95 118 48 48 49}
69
     }
71
     }
70
   old_expression_markers {{0 25}
72
   old_expression_markers {{0 25}
71
     }
73
     }
88
   xpos -163
90
   xpos -163
89
   ypos -19
91
   ypos -19
90
  }
92
  }
91
-push $N4966fc00
93
+push $N47169c00
92
  Switch {
94
  Switch {
93
   inputs 2
95
   inputs 2
94
   which {{"\[value parent.burnName]"}}
96
   which {{"\[value parent.burnName]"}}
101
   xpos -6
103
   xpos -6
102
   ypos 79
104
   ypos 79
103
  }
105
  }
104
-set N4966f000 [stack 0]
106
+set N47169000 [stack 0]
105
  Text2 {
107
  Text2 {
106
   font_size_toolbar 100
108
   font_size_toolbar 100
107
   font_width_toolbar 100
109
   font_width_toolbar 100
135
   xpos -164
137
   xpos -164
136
   ypos 76
138
   ypos 76
137
  }
139
  }
138
-push $N4966f000
140
+push $N47169000
139
  Switch {
141
  Switch {
140
   inputs 2
142
   inputs 2
141
   which {{"\[value parent.burnFrame]"}}
143
   which {{"\[value parent.burnFrame]"}}
151
   checkHashOnRead false
153
   checkHashOnRead false
152
   version 486
154
   version 486
153
   name write_tmp
155
   name write_tmp
154
-  selected true
155
   xpos -40
156
   xpos -40
156
   ypos 246
157
   ypos 246
157
   addUserKnob {20 keller l Keller}
158
   addUserKnob {20 keller l Keller}

+ 19
- 0
pythonpluginsUI/nukeffmpeg/ffmpeg_render.py View File

83
     framerate = node['framerate'].getValue()
83
     framerate = node['framerate'].getValue()
84
     output = node['file'].getValue()
84
     output = node['file'].getValue()
85
 
85
 
86
+    # vcurrent
87
+    vcurrent = node['vcurrent'].getValue()
88
+
86
     # create folder if necessary
89
     # create folder if necessary
87
     dir = os.path.dirname(output)
90
     dir = os.path.dirname(output)
88
     osdir = nuke.callbacks.filenameFilter(dir)
91
     osdir = nuke.callbacks.filenameFilter(dir)
122
         except:
125
         except:
123
             pass
126
             pass
124
     result, error = ffproc.communicate()
127
     result, error = ffproc.communicate()
128
+
125
     print("Rendering done.")
129
     print("Rendering done.")
126
 
130
 
131
+    # vcurrent
132
+    import re
133
+    import shutil
134
+    import os.path as path
135
+
136
+    if vcurrent == 1:
137
+        print("Copying vcurrent.")
138
+        pattern = re.compile('[vV]\d+')
139
+        ending = output.split('/')[-1]
140
+        result = pattern.findall(ending)
141
+        two_up = path.abspath(path.join(output, "../.."))
142
+        vcurrentfile = two_up + '\\' + ending.replace((result[-1]), 'vcurrent')
143
+        shutil.copyfile(output, vcurrentfile)
144
+        print("Copying vcurrent done.")
145
+
127
 if __name__=="__main__":
146
 if __name__=="__main__":
128
     terminal_render()
147
     terminal_render()
129
 
148
 

Loading…
Cancel
Save