AWS Thinkbox Discussion Forums

Draft 1.5.0 Beta 1 (revision #59410)

Draft 1.5.0 Beta 1 is now available, and will also be released with Deadline 8.0 Beta 5.

[size=150]INSTALLATION INFORMATION[/size]
This version of Draft will not work with Deadline 6 or earlier. The installers for Deadline 8.0 include Draft 1.5.0 Beta 1, but you can also (re)install Draft from the attached .zip archives.

To update Draft, all you should need to do is extract the attached Draft .zip file into the root of your Deadline Repository. It will propagate to the slaves when needed.

If you are using Draft 1.4.x or earlier, you will need an updated Draft 1.5 license.

[size=150]What’s New:[/size]

Images

  • Added support for specifying the channel bit depth when writing an image to file.
  • Added support for embedding a timecode when writing an image to file.
  • Added support for accessing an image in memory as a byte array that is compatible with the QByteArray in PySide.

Videos

  • Added support for embedding a timecode when encoding a video.
  • Added support for video concatenation.

Fixed bugs

  • Fixed a bug that was causing ImageMagick to read image file twice.
  • Fixed a bug that was preventing Draft to encode a video with codec DNxHD and format MXF for some frame rates.

[size=85]Draft_Deadline8_1_5_0_59410_beta1.zip - removed
Draft binaries
(80.85 MiB) Downloaded 2 times[/size]

DraftDocumentation-1.5.0b1.pdf (320 KB)
DraftDocumentation-1.5.0b1.zip (427 KB)

[size=150]Working with File Channel Map[/size]

A file channel map is associated with a Draft.Image and is used to specify on write and retrieve on read the bit depth and type of the image channels. A file channel map is represented using a dictionary. Each dictionary entry is made of two strings separated by a colon. The first string corresponds to the channel name, typically ‘R’, ‘G’, ‘B’ and ‘A’, and the second string corresponds to the channel bit depth. An ‘ui’ is appended to the bit depth string to specify that the channel represents an index and an ‘f’ to specify that the channel is of type float. Such a string represents a channel data type. Here are some common valid channel data types: ‘8’, ‘16’, ‘16f’, ‘32f’ and ‘32ui’. When Draft creates an image or add a new channel to an existing image, a default file channel data type of ‘8’ is assigned to the new channel(s).

The file channel map associated to a Draft.Image can be manipulated using the two functions SetFileChannelMap() and GetFileChannelMap().

  • A dictionary representing a file channel map can be passed to the function SetFileChannelMap() to set the file channel map of a Draft.Image. Note that the dictionary must contain one entry for each channel present in the Draft.Image and for those channels only. An error will be thrown otherwise.
  • A dictionary is returned by the function GetFileChannelMap() to retrieve the current file channel map of a Draft.Image.

Internally, Draft is still storing image channel data using 32 bit floats.

Usage:

  • To write an EXR image file with a specific file channel map -
image = Draft.Image.ReadFromFile( '//path/to/in.exr' )
fileChannelMap = { 'R':'16f', 'G':'16f', 'B':'16f', 'A':'16f', 'ID':'32ui' }
image.SetFileChannelMap( fileChannelMap )
image.WriteToFile( '//path/to/out.exr' )
  • To retrieve the file channel map associated to an EXR image file -
image = Draft.Image.ReadFromFile( '//path/to/in.exr' )
fileChannelMap = image.GetFileChannelMap()

It is important to understand that each file format only supports specific bit depth and type. Here’s a list of the valid channel data types supported by Draft for common file formats:

BMP: ‘8’
CIN: ‘10’
DPX: ‘8’, ‘10’, ‘12’, ‘16’
EXR: ‘16f’, ‘32f’, ‘32ui’
GIF: ‘8’
HDR: ‘16’
JPEG/JPG: ‘8’
PNG: ‘8’, ‘16’
TGA: ‘5’*, ‘8’
TIF/TIFF: ‘8’, ‘16’

While Draft supports specifying the file channel map for other file formats, correct resulting images written with requested bit depths are not guaranteed.

For more information, you can also consult the Image section of the Draft documentation. The pdf and the zipped html versions of the documentation can be downloaded from this thread’s initial post.

  • Writing a TGA image file with a channel data type of ‘5’ corresponds to ImageMagick’s 16-bit TGA – 5*3 + 1.

[size=150]Working with Draft.Timecode[/size]

A Draft.Timecode is used to embed on write and to extract on read a timecode in a DPX or EXR image file or in a video file. A Draft.Timecode object stores the hours, the minutes, the seconds and the frame associated to a timecode as described in SMPTE standard. In addition, a flag indicating whether the Draft.Timecode object represents a non-drop frame or a drop frame timecode is stored. A Draft.Timecode is created using a string with format hh:mm:ss:ff for non-drop frame timecode and hh:mm:ss;ff for drop frame timecode, where hh indicates the hours in the range [0…23], mm the minutes in the range [0…59], ss the seconds in the range [0…59] and ff the frame in the range [0…59].

  • In the case of a DPX or EXR image file, a Draft.ImageInfo can be used to embed or to extract a Draft.Timecode.
  • In the case of a video file, the Draft.Timecode to be embedded can be specified when creating a Draft.VideoEncoder and a Draft.VideoDecoder has a timecode property that can be used to extract the embedded Draft.Timecode.

Usage:

  • To write a DPX image file with an embedded timecode -
timecode = Draft.Timecode( '12:40:10:15' )
imageInfo = Draft.ImageInfo()
imageInfo.timecode = timecode
	
image = Draft.Image.ReadFromFile( '//path/to/in.dpx' )
image.WriteToFile( '//path/to/out.dpx', imageInfo=imageInfo )
  • To extract the timecode embedded in an EXR image file -
imageInfo = Draft.ImageInfo()
image = Draft.Image.ReadFromFile( '//path/to/in.exr', imageInfo )
timecode = imageInfo.timecode
  • To embed a timecode in a video -
timecode = Draft.Timecode( '12:40:10:15' )
encoder = Draft.VideoEncoder( "//path/to/video/save.mov", 24, 800, 600, timecode=timecode )
  • To extract a timecode from a video -
decoder = Draft.VideoDecoder( "//path/to/video/load.mov" )
timecode = decoder.timecode
  • To extract a timecode from a DPX image sequences and, if one is found, embed it in a video -
from DraftParamParser import ReplaceFilenameHashesWithNumber

imageInfo = Draft.ImageInfo()
for currFrame in range( 1, 200 ):
	currFile = ReplaceFilenameHashesWithNumber( 'movie_frame####.dpx', currFrame )
	frame = Draft.Image.ReadFromFile( currFile, imageInfo )
	
	if currFrame == 1:
		if( imageInfo.timecode ):
			encoder = Draft.VideoEncoder( '//path/to/video/save.mov', timecode = imageInfo.timecode )   
		else:
			encoder = Draft.VideoEncoder( '//path/to/video/save.mov' )
	
	encoder.EncodeNextFrame( frame )
	
encoder.FinalizeEncoding()

For more information, you can also consult the Timecode, ImageInfo and Video sections of the Draft documentation. The pdf and the zipped html versions of the documentation can be downloaded from this thread’s initial post.

Privacy | Site terms | Cookie preferences