Hi,
I realise that draft dosen’t use quite much of my CPU, my RAM, and my network. It pretty much stays at 30% use of my system. Is there anyway to optimise this ? Some moc take 2 hour to do, and in rv it takes about 20 minute.
Thanks
Fred
Hi,
I realise that draft dosen’t use quite much of my CPU, my RAM, and my network. It pretty much stays at 30% use of my system. Is there anyway to optimise this ? Some moc take 2 hour to do, and in rv it takes about 20 minute.
Thanks
Fred
You’re comparing Quicktime .MOV generation in Draft and RV, right?
Draft could certainly be faster. However, I tried saving a .MOV in Draft and RV, and they took around the same time.
In my test, I loaded a sequence of 360 1024x768 EXR files. I saved the sequence as a MOV file with MJPEG encoding:
enc = Draft.VideoEncoder( outFile, 24, 1024, 768, 50000, 'MJPEG' )
Would it be possible for you to please describe your test, and if possible please post the Draft script you used?
I have 4 output from nuke, wich 2 eye each. Some draft render take almost 2 hours and in rv about 20 minute.
Here’s my script
[code]import sys
import os
import datetime
import copy
import xml.etree.ElementTree as xml
import Draft
from DraftParamParser import *
def ResizeWithLetterbox(self, width, height):
if width <= 0:
raise RuntimeError(‘width must be a positive number’)
if height <= 0:
raise RuntimeError(‘height must be a positive number’)
sourceAR = float(self.width) / self.height
destAR = float(width) / height
if sourceAR == destAR:
self.Resize(width, height)
else:
image = copy.deepcopy(self)
self.Resize(width,height)
self.SetToColor(Draft.ColorRGBA(0, 0, 0, 1.0))
if sourceAR > destAR:
image.Resize(width,int(round(width/sourceAR)))
else:
image.Resize(int(round(height*sourceAR)),height)
self.CompositeWithPositionAndGravity(image, 0.5, 0.5, Draft.PositionalGravity.CenterGravity, Draft.CompositeOperator.CopyCompositeOp)
Draft.Image.ResizeWithLetterbox = ResizeWithLetterbox
#Returns a dictionary of a Deadline Job’s properties
def getDeadlineJob (job, repository):
deadlineJobPath = (repository + “\jobs\” + job + “\” + job + “.job”)
jobKeys = (xml.parse(deadlineJobPath)).getroot()
jobDict = {}
for o in list(jobKeys):
if len(o.getchildren()) < 1:
jobDict[o.tag] = o.text
else:
jobDict[o.tag] = []
for t in list(o):
(jobDict[o.tag]).append(t.text)
jobDict[‘deadlineJobPath’] = deadlineJobPath
return jobDict
#Returns a list of frames based on the given frameString
def FrameListToFrames( frameString ):
frames = []
frameRangeTokens = re.split( ‘\s+|,+’, frameString )
for token in frameRangeTokens:
try:
if ( len(token) > 0 ):
dashIndex = string.find( token, '-', 1)
if ( dashIndex == -1 ):
startFrame = int(token)
frames.add( startFrame )
else:
startFrame = int(token[0:dashIndex])
m = re.match( "(-?\d+)(?:(x|step|by|every)(\d+))?", token[dashIndex + 1:] )
if ( m == None ):
raise StandardError( "Second part of Token '" + token[dashIndex + 1:] + "' failed regex match" )
else:
endFrame = int(m.group(1))
if ( m.group(2) == None ):
frames.extend( range(startFrame, endFrame + 1 ))
else:
dir = 1
if startFrame > endFrame:
dir = -1
byFrame = int(m.group(3));
frame = startFrame
while (startFrame * dir) <= (endFrame * dir):
frames.add( frame )
frame += byFrame * dir
except:
print "ERROR: Frame Range token '" + token + "' is malformed. Skipping this token."
raise
frames = list(set(frames))
frames.sort()
return frames
#CHANGE ME! Path to the Deadline Repository root
deadlineRepo = “\fx-deadline\deadline\”
#CHANGE ME! Path to an image containing the background of the slate frame
slateFrame = “\\fx-deadline\deadline\Draft\Slate_Montage5K.png”
#The argument name/types we’re expecting from the command line arguments
expectedTypes = dict()
expectedTypes[‘frameList’] = ‘’
expectedTypes[‘inFile’] = ‘’
expectedTypes[‘outFile’] = ‘’
expectedTypes[‘username’] = ‘’
expectedTypes[‘entity’] = ‘’
expectedTypes[‘version’] = ‘’
expectedTypes[‘deadlineJobID’] = ‘’
#Parse the command line arguments
params = ParseCommandLine( expectedTypes, sys.argv )
inFilePattern = params[‘inFile’]
frames = FrameListToFrames( params[‘frameList’] )
(outBase, outExt)= os.path.splitext( params[‘outFile’] )
#not a huge deal if we can’t connect to the repo, we’ll just be missing some info
try:
jobParams = getDeadlineJob( params[‘deadlineJobID’], deadlineRepo )
except:
jobParams = {}
outWidth = 1920
outHeight = 1080
h264Scale = 1
slateFrames = 1
for eye in [‘l’,‘r’]:
#Build up the encoders
outBaseEye = outBase.replace( ‘%v’, eye )
MJPEGencoder = Draft.VideoEncoder( outBaseEye + outExt, 24, outWidth, outHeight, 75000, “MJPEG” )
h264Encoder = Draft.VideoEncoder( outBaseEye + “-h264” + outExt, 24, int(h264Scale * outWidth), int(h264Scale * outHeight), 16000, “H264” )
#Annotation info used for burn ins
annotationInfo = Draft.AnnotationInfo()
annotationInfo.FontType = "Times-New-Roman"
annotationInfo.PointSize = int( outHeight * 0.022 )
annotationInfo.Color = Draft.ColorRGBA( 1.0, 1.0, 1.0, 1.0 )
#prep the Slate Frame
try:
slate = Draft.Image.ReadFromFile( slateFrame )
except:
slate = Draft.Image.CreateImage( outWidth, outHeight )
slate.SetToColor( Draft.ColorRGBA( 0.0, 0.0, 0.0, 1.0 ) )
if ( slate.width != outWidth or slate.height != outHeight ):
slate.ResizeWithLetterbox( outWidth, outHeight )
#sets up the text on the slate frame
slateAnnotations = [
("SHOW", jobParams.get('ExtraInfo1', '<SKIP>')), #This line is skipped if there is not ExtraInfo1
("Episode", params.get('episode', '<SKIP>')), #This line is skipped if 'episode' isn't in the extra args
("Shot", params['entity']),
("Frames", params['frameList']),
("Handles", params.get('handles', '<SKIP>')), #This line is skipped if 'handles' isn't in the extra args
("Version", params['version']),
("",''),
("",''),
("Artist", params['username']),
("Date", datetime.datetime.now().strftime("%m/%d/%Y %I:%M %p") )
]
#comp the annotations over top the slate frame
skipLines = 0
for i in range( 0, len( slateAnnotations ) ):
annotationTuple = slateAnnotations[i]
if ( annotationTuple[1] == "<SKIP>" ):
skipLines += 1
continue
lineNum = i - skipLines
if ( annotationTuple[0] != "" ):
annotation = Draft.Image.CreateAnnotation( slateAnnotations[i][0] + ": ", annotationInfo )
slate.CompositeWithPositionAndGravity( annotation, 0.45, 0.7 - (lineNum * 0.06), Draft.PositionalGravity.SouthEastGravity, Draft.CompositeOperator.OverCompositeOp )
if ( annotationTuple[1] != "" ):
annotation = Draft.Image.CreateAnnotation( slateAnnotations[i][1], annotationInfo )
slate.CompositeWithPositionAndGravity( annotation, 0.46, 0.7 - (lineNum * 0.06), Draft.PositionalGravity.SouthWestGravity, Draft.CompositeOperator.OverCompositeOp )
slate_h264 = copy.deepcopy( slate )
if ( h264Scale != 1 ):
slate_h264.ResizeWithLetterbox( int(outWidth * h264Scale), int(outHeight * h264Scale) )
#encode the slate frames at the start of the video
print( "Encoding Slate Frames..." )
for i in range( 0, slateFrames ):
MJPEGencoder.EncodeNextFrame( slate )
h264Encoder.EncodeNextFrame( slate_h264 )
studioAnnotation = Draft.Image.CreateAnnotation( "The Ice Age", annotationInfo )
entityAnnotation = Draft.Image.CreateAnnotation( "%s %s" % (params['entity'], datetime.datetime.now().strftime("%m/%d/%Y")), annotationInfo )
annotationInfo.BackgroundColor = Draft.ColorRGBA( 0.0, 0.0, 0.0, 1.0 )
#Main encoding loop
for frameNumber in frames:
print( "Processing Frame: %d...-1" % frameNumber )
inFile = inFilePattern.replace( '%v', eye )
inFile = ReplaceFilenameHashesWithNumber( inFile, frameNumber )
bgFrame = Draft.Image.ReadFromFile( inFile )
if ( bgFrame.width != outWidth or bgFrame.height != outHeight ):
bgFrame.ResizeWithLetterbox( outWidth, outHeight )
#Do the frame burnins
framesAnnotation = Draft.Image.CreateAnnotation( str( frameNumber ), annotationInfo )
bgFrame.CompositeWithGravity( studioAnnotation, Draft.PositionalGravity.NorthWestGravity, Draft.CompositeOperator.OverCompositeOp )
bgFrame.CompositeWithGravity( entityAnnotation, Draft.PositionalGravity.SouthWestGravity, Draft.CompositeOperator.OverCompositeOp )
bgFrame.CompositeWithGravity( framesAnnotation, Draft.PositionalGravity.SouthEastGravity, Draft.CompositeOperator.OverCompositeOp )
MJPEGencoder.EncodeNextFrame( bgFrame )
if ( h264Scale != 1 ):
bgFrame.ResizeWithLetterbox( int(outWidth * h264Scale), int(outHeight * h264Scale) )
h264Encoder.EncodeNextFrame( bgFrame )
#Finalize the encoding process
MJPEGencoder.FinalizeEncoding()
h264Encoder.FinalizeEncoding()
[/code]
I talk to my network manager. It might be because we are using a VM on a different network. We are building a P4 to see the result.
Thanks
Thank you for posting your script! I noticed a few things, and I’ll send you a new script to try later today.
I notice the script writes both a H264 and a MJPEG movie. That’s reasonable, but it definitely gives RV an advantage. Would you prefer to use one or the other for benchmarking?
Actually i dont need that much of the h264, because it’s not compatible with rv. Thanks for the support
Fred
Is there any way to assing a priority by user in the draft event ?
I got one guy that have 4 output, who would be my low priority, and to the one render put it on a fast lane
Could you please try the version attached here?
I think the biggest issue is the CompositeWithGravity() function. Draft Beta 8 has faster compositing operations, but we missed CompositeWithGravity(). This will be fixed in the next build. For now I’ve changed your script to use the equivalent CompositeWithPositionAndGravity() calls.
I also made a small change in ResizeWithLetterbox(). Now it uses Crop() to resize the background image when possible. We’re planning to add something like ResizeWithLetterbox() directly to Draft which will avoid the need for such workarounds.
simple_slate_eyes_MJPEG_burnins(letterbox)4.zip (2.73 KB)
Unfortunately, there isn’t currently a way to set the priority offset differently based on different users, short of hard-coding it in the Event Plugin.
This might be something that we could do in the future, but we would probably allow different priority offsets based on the scripts themselves, instead of it being user-based. I’m not making any promises, though!
Cheers,
I just tested the script,
It actually took a minute longer than the first time. I did a exact same same. A went from 38 minute to 39 minutes
I suspect you are using an older version of Draft. Here are a couple ways to check:
print "Draft Version: %s" % Draft.LibraryInfo.Version()
Then check the job’s log file for the version number.The attached script includes both of these changes. Could you please run it and let us know?
simple_slate_eyes_MJPEG_burnins(letterbox)5.zip (2.76 KB)
Yes thanks im doing this right now, so far, 3 minute past and no error. I dunno if the error was suppose to be at the begenning.
Is it possible if i was resubmitting my job it was loading the old draft template ?
okay i think resubmitting my scene was causing trouble. I submit my job from draft and got this error
Exception during render: An error occurred in RenderTasks(): Error in CheckExitCode(): Renderer returned non-zero error code, 1. Check the log for more information.
à Deadline.Plugins.ScriptPlugin.RenderTasks(String taskId, Int32 startFrame, Int32 endFrame, String& outMessage)
0: Task timeout is disabled.
0: Loaded job: IA_005_0006_shl [DRAFT] (999_075_999_2db63e84)
0: INFO: StartJob: initializing script plugin Draft
0: INFO: Found Draft python module at: ‘C:\Users\renderfx\AppData\Local\Thinkbox\Deadline\slave\Draft_node\Draft\Draft.pyd’
0: INFO: About: Draft Plugin for Deadline
0: Plugin rendering frame(s): 0
0: INFO: Draft job starting…
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Looking for bundled python at: ‘C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe’
0: INFO: Render Executable: “C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe”
0: INFO: Render Argument: -u “R:/simple_slate_h264_MJPEG_burnins.py” username=“jbelley” entity=“IA_005_0006_shl” version="" inFile=“R:\IA\SHOTS\005\0006\shl\outputs\IA_005_0006_shl_Tracking.%v.####.exr” outFile=“R:\IA\SHOTS\005\0006\shl\outputs\Draft\IA_005_0006_shl_Tracking.%v…mov” startFrame=“43” endFrame=“294” frameList=“43-294” deadlineJobID=999_050_999_733a7564
0: INFO: Startup Directory: “C:\Users\renderfx\AppData\Local\Thinkbox\Deadline\slave\Draft_node\Draft”
0: INFO: Process Priority: BelowNormal
0: INFO: Process is now running
0: STDOUT: Checking for license at @ProdFlexMR
0: STDOUT: Traceback (most recent call last):
0: STDOUT: File “R:/simple_slate_h264_MJPEG_burnins.py”, line 132, in
0: STDOUT: Draft Version: 1.0.0.46224
0: STDOUT: Command line args:
0: STDOUT: username=jbelley
0: STDOUT: entity=IA_005_0006_shl
0: STDOUT: version=
0: STDOUT: inFile=R:\IA\SHOTS\005\0006\shl\outputs\IA_005_0006_shl_Tracking.%v.####.exr
0: STDOUT: outFile=R:\IA\SHOTS\005\0006\shl\outputs\Draft\IA_005_0006_shl_Tracking.%v…mov
0: STDOUT: startFrame=43
0: STDOUT: endFrame=294
0: STDOUT: frameList=43-294
0: STDOUT: deadlineJobID=999_050_999_733a7564
0: STDOUT: MJPEGencoder = Draft.VideoEncoder( outBaseEye + outExt, 24.0, outWidth, outHeight, 75000, “MJPEG” )
0: STDOUT: Boost.Python.ArgumentError: Python argument types in
0: STDOUT: VideoEncoder.init(VideoEncoder, str, float, int, int, int, str)
0: STDOUT: did not match C++ signature:
0: STDOUT: init(struct _object * __ptr64, class std::basic_string<char,struct std::char_traits,class std::allocator >, int, int, int, int, class std::basic_string<char,struct std::char_traits,class std::allocator >)
0: STDOUT: init(struct _object * __ptr64, class std::basic_string<char,struct std::char_traits,class std::allocator >)
0: INFO: Process exit code: 1
RenderPluginException
à Deadline.Plugins.Plugin.RenderTask(String taskId, Int32 startFrame, Int32 endFrame)
à Deadline.Slaves.SlaveRenderThread.RenderCurrentTask(TaskLogWriter tlw)
[/code]
Thank you for posting your log file!
That error means you’re using an older version of Draft. I recommend that you update to the latest Draft Beta 8, which should be faster on your test.
I update it again and i still get the same kind of erre
Exception during render: An error occurred in RenderTasks(): Error in CheckExitCode(): Renderer returned non-zero error code, 1. Check the log for more information.
à Deadline.Plugins.ScriptPlugin.RenderTasks(String taskId, Int32 startFrame, Int32 endFrame, String& outMessage)
0: Task timeout is disabled.
0: Loaded job: IA_005_0006_shl [DRAFT] (999_075_999_2db63e84)
0: INFO: StartJob: initializing script plugin Draft
0: INFO: Found Draft python module at: ‘C:\Users\renderfx\AppData\Local\Thinkbox\Deadline\slave\Draft_node\Draft\Draft.pyd’
0: INFO: About: Draft Plugin for Deadline
0: Plugin rendering frame(s): 0
0: INFO: Draft job starting…
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Looking for bundled python at: ‘C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe’
0: INFO: Render Executable: “C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe”
0: INFO: Render Argument: -u “R:/simple_slate_h264_MJPEG_burnins.py” username=“jbelley” entity=“IA_005_0006_shl” version="" inFile=“R:\IA\SHOTS\005\0006\shl\outputs\IA_005_0006_shl_Tracking.%v.####.exr” outFile=“R:\IA\SHOTS\005\0006\shl\outputs\Draft\IA_005_0006_shl_Tracking.%v…mov” startFrame=“43” endFrame=“294” frameList=“43-294” deadlineJobID=999_050_999_733a7564
0: INFO: Startup Directory: “C:\Users\renderfx\AppData\Local\Thinkbox\Deadline\slave\Draft_node\Draft”
0: INFO: Process Priority: BelowNormal
0: INFO: Process is now running
0: STDOUT: Checking for license at @ProdFlexMR
0: STDOUT: Draft Version: 1.0.0.46224
0: STDOUT: Command line args:
0: STDOUT: username=jbelley
0: STDOUT: entity=IA_005_0006_shl
0: STDOUT: version=
0: STDOUT: inFile=R:\IA\SHOTS\005\0006\shl\outputs\IA_005_0006_shl_Tracking.%v.####.exr
0: STDOUT: outFile=R:\IA\SHOTS\005\0006\shl\outputs\Draft\IA_005_0006_shl_Tracking.%v…mov
0: STDOUT: startFrame=43
0: STDOUT: endFrame=294
0: STDOUT: frameList=43-294
0: STDOUT: deadlineJobID=999_050_999_733a7564
0: STDOUT: Traceback (most recent call last):
0: STDOUT: File “R:/simple_slate_h264_MJPEG_burnins.py”, line 132, in
0: STDOUT: MJPEGencoder = Draft.VideoEncoder( outBaseEye + outExt, 24.0, outWidth, outHeight, 75000, “MJPEG” )
0: STDOUT: Boost.Python.ArgumentError: Python argument types in
0: STDOUT: VideoEncoder.init(VideoEncoder, str, float, int, int, int, str)
0: STDOUT: did not match C++ signature:
0: STDOUT: init(struct _object * __ptr64, class std::basic_string<char,struct std::char_traits,class std::allocator >, int, int, int, int, class std::basic_string<char,struct std::char_traits,class std::allocator >)
0: STDOUT: init(struct _object * __ptr64, class std::basic_string<char,struct std::char_traits,class std::allocator >)
0: INFO: Process exit code: 1
RenderPluginException
à Deadline.Plugins.Plugin.RenderTask(String taskId, Int32 startFrame, Int32 endFrame)
à Deadline.Slaves.SlaveRenderThread.RenderCurrentTask(TaskLogWriter tlw)
[/code]
I delete draft in my draft folder,recopy it, and restart my slave. Am i doing something wrong ?
That means you’re still using an older version of Draft. Here are some steps to try:
This is great.
The problem was i needed to delete that folder in the node folder.
Our render went from 40 minute to 16 minutes. Which is a great amelioration. Before the end of the week i will have a new computer assign to those render, on our network. Do you got any advice on which system will be the most optimize. Its going to be a P4 for the moment.
Thanks again `:) !
Fred
Is the folder to delete in appdata is suppose to be in the same folder in windows XP ?
My new computer for draft in with XP and the folder dosen’t seem to be there.
Thanks
Fred
I believe in XP it would be C:\Documents and Settings<username>\Application Data\Thinkbox\Deadline<slave name>\Draft
Where and should be swapped out with the actual user/slave names