AWS Thinkbox Discussion Forums

Frame Number Burn-In

I’m trying to get my head around Draft.

Is it possible to burn in the frame number on QuickTimes? I want Draft to generate a QT from a sequence of files and stamp the frame number on each frame. Possible?

Yeap, it most certainly can. Our sample templates do it (the one I sent you guys doesn’t, but can be modified to do so fairly easily).

You just need to generate an annotation for each frame number, then comp that onto the frames before you encode them. Here’s a snippet demonstrating how to do that:

#Prepare the annotation properties for later
annotationInfo = AnnotationInfo()
annotationInfo.FontType = "Arial"
annotationInfo.Color = ColorRGBA(0.85, 0.85, 0.85, 1.0)
annotationInfo.DrawShadow = True
annotationInfo.ShadowColor = ColorRGBA(0.1, 0.1, 0.1, 1.0)
annotationInfo.PointSize = int(height*0.08)

# encode the video frames
for frameNumber in range(startFrame, endFrame + 1):
	print "Processing frame: " + str(frameNumber)
	
	#Read in the current frame
	inFile = ReplaceFilenameHashesWithNumber(inFilePattern, frameNumber)
	currFrame = Image.ReadFromFile(inFile)
	
	#Create the annotation image and comp it onto the frame	
	annotation = Image.CreateAnnotation(str(frameNumber), annotationInfo)
	currFrame.CompositeWithGravity(annotation, PositionalGravity.NorthEastGravity, CompositeOperator.OverCompositeOp)
	
	encoder.EncodeNextFrame( currFrame )

Note that you can do this with all kinds of information, not just frame numbers.

Hope this helps!

Cheers,

  • Jon

Jon, you are awesome.

Looks great. Thanks for the help!

No problem, I’m glad to help :slight_smile:

Cheers,

  • Jon
Privacy | Site terms | Cookie preferences