소스 검색

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 년 전
부모
커밋
693961e58f
4개의 변경된 파일42개의 추가작업 그리고 14개의 파일을 삭제
  1. 8
    0
      README.md
  2. BIN
      doc/ffmpegWrite.jpg
  3. 15
    14
      pythonpluginsUI/nukeffmpeg/Preview_QT.nk
  4. 19
    0
      pythonpluginsUI/nukeffmpeg/ffmpeg_render.py

+ 8
- 0
README.md 파일 보기

@@ -54,6 +54,12 @@
54 54
 
55 55
 
56 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 63
 `2021-07-22`
58 64
 
59 65
 `sceneControl: our_write. Added Element to filepath if configured in sceneControl.`
@@ -61,6 +67,8 @@
61 67
 `Denoise with Noise: Added alert if denoise output is the same as input.`
62 68
 
63 69
 
70
+`__________`
71
+
64 72
 
65 73
 `2021-07-12`
66 74
 

BIN
doc/ffmpegWrite.jpg 파일 보기


+ 15
- 14
pythonpluginsUI/nukeffmpeg/Preview_QT.nk 파일 보기

@@ -2,21 +2,21 @@ set cut_paste_input [stack 0]
2 2
 version 12.2 v5
3 3
 push $cut_paste_input
4 4
 Group {
5
- name Preview_QT
5
+ name Preview_QT2
6 6
  tile_color 1
7
- label "h264 intra\n\[value nodeLabel]"
7
+ label "h264 standard\n\[value nodeLabel]"
8 8
  selected true
9
- xpos -5
10
- ypos -51
9
+ xpos 313
10
+ ypos 39
11 11
  addUserKnob {20 ffmpeg}
12 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 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 15
  addUserKnob {26 ""}
16 16
  addUserKnob {1 info t "Additional non-mandatory File Info"}
17 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 20
  addUserKnob {26 ""}
21 21
  addUserKnob {1 burnNameText l burn-in}
22 22
  burnNameText "\[python \{nuke.thisNode().knobs()\['file'].value().split('/')\[-1].replace('.mp4','').replace('.mov','')\}]"
@@ -37,9 +37,11 @@ Group {
37 37
  burnName true
38 38
  addUserKnob {6 burnFrame l "Burn-in Frame" -STARTLINE}
39 39
  burnFrame true
40
+ addUserKnob {6 vcurrent l "Create vcurrent" -STARTLINE}
41
+ vcurrent true
40 42
  addUserKnob {26 ""}
41 43
  addUserKnob {7 framerate R 23 30}
42
- framerate {{"\[python \{nuke.root().knobs()\['fps'].value()\}]"}}
44
+ framerate 24
43 45
  addUserKnob {1 framerange -STARTLINE}
44 46
  framerange 1001-1024
45 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,13 +61,13 @@ Group {
59 61
   xpos -6
60 62
   ypos -16
61 63
  }
62
-set N4966fc00 [stack 0]
64
+set N47169c00 [stack 0]
63 65
  Text2 {
64 66
   font_size_toolbar 100
65 67
   font_width_toolbar 100
66 68
   font_height_toolbar 100
67 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 72
   old_expression_markers {{0 25}
71 73
     }
@@ -88,7 +90,7 @@ set N4966fc00 [stack 0]
88 90
   xpos -163
89 91
   ypos -19
90 92
  }
91
-push $N4966fc00
93
+push $N47169c00
92 94
  Switch {
93 95
   inputs 2
94 96
   which {{"\[value parent.burnName]"}}
@@ -101,7 +103,7 @@ push $N4966fc00
101 103
   xpos -6
102 104
   ypos 79
103 105
  }
104
-set N4966f000 [stack 0]
106
+set N47169000 [stack 0]
105 107
  Text2 {
106 108
   font_size_toolbar 100
107 109
   font_width_toolbar 100
@@ -135,7 +137,7 @@ set N4966f000 [stack 0]
135 137
   xpos -164
136 138
   ypos 76
137 139
  }
138
-push $N4966f000
140
+push $N47169000
139 141
  Switch {
140 142
   inputs 2
141 143
   which {{"\[value parent.burnFrame]"}}
@@ -151,7 +153,6 @@ push $N4966f000
151 153
   checkHashOnRead false
152 154
   version 486
153 155
   name write_tmp
154
-  selected true
155 156
   xpos -40
156 157
   ypos 246
157 158
   addUserKnob {20 keller l Keller}

+ 19
- 0
pythonpluginsUI/nukeffmpeg/ffmpeg_render.py 파일 보기

@@ -83,6 +83,9 @@ def terminal_render():
83 83
     framerate = node['framerate'].getValue()
84 84
     output = node['file'].getValue()
85 85
 
86
+    # vcurrent
87
+    vcurrent = node['vcurrent'].getValue()
88
+
86 89
     # create folder if necessary
87 90
     dir = os.path.dirname(output)
88 91
     osdir = nuke.callbacks.filenameFilter(dir)
@@ -122,8 +125,24 @@ def terminal_render():
122 125
         except:
123 126
             pass
124 127
     result, error = ffproc.communicate()
128
+
125 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 146
 if __name__=="__main__":
128 147
     terminal_render()
129 148
 

Loading…
취소
저장