Video¶
-
Draft.
QTFastStart
((str)inputFile, (str)outputFile) → int :¶ Rearranges the atoms inside the input QT file to enable playback without first loading the entire file.
Arguments:
- inputFile
The filename of the input .mov file.
- outputFile
The filename of the output .mov file.
Usage:
Draft.QTFastStart( "/path/to/input.mov", "/path/to/output.mov" )
-
Draft.
ConcatenateVideoFiles
((list)inputFiles, (str)outputFile) → None :¶ Concatenate a list of video files.
New in version 1.5.
Arguments:
- inputFiles
A list of string values indicating paths to the video files to concatenate.
- outputFile
A string value indicating the path to the concatenated video to create.
Usage:
Draft.ConcatenateVideoFiles( [ "/path/to/input1.mov", "/path/to/input2.mov" ], "/path/to/output.mov" )
VideoEncoder
¶
-
class
Draft.
VideoEncoder
¶ - object __init__(tuple args, dict kwds) :
__init__( (VideoEncoder) arg1, (str)filename [, (object)fps=24 [, (int)width=640 [, (int)height=480 [, (int)kbitRate=None [, (str)codec=’MJPEG’ [, (str)audioFilename=’’ [, (int)audioDelay=0]]]]]]] ) -> None[, (TimeCode)timecode=None
Create a VideoEncoder.
Constructor Arguments:
- filename
A string value indicating where the video file should be saved.
- fps
Optional. An integer, float, or Fraction value indicating the framerate to use. (Default is 24.)
- width
Optional. An integer value indicating the width to use. (Default is 640.)
- height
Optional. An integer value indicating the height to use. (Default is 480.)
- kbitRate
Optional. An integer value indicating the kbit rate to use. (Default is None, which corresponds to quality = 85.) Only one of kbitRate or quality can be specified.
- codec
A string value indicating the Codec to use. (Default is ‘MJPEG’.) Valid codec values are: ‘MPEG4’, ‘MJPEG’, ‘H264’, ‘DNxHD’, ‘RAWVIDEO’, and ‘VP8’.
- audioFilename
A string value indicating the name of an audio file, or a video file with an audio track, to include in the video. This can be an empty string for no audio file. (Default is ‘’.)
- audioDelay
Optional. An integer value indicating the delay to apply to the audio file, measured in frames. (Default is 0.)
- timecode
Optional. A
Draft.Timecode
object used to set the timecode that will be embedded in the video. (Default is None.)
Named arguments:
- quality
An integer in the range [0..100] indicating the video encoding quality to use. Greater values correspond to higher quality. Only one of quality or kbitRate can be specified.
Usage:
enc = Draft.VideoEncoder( "//path/to/video/save.mov" )
or, to specify the frame rate and frame size:
enc = Draft.VideoEncoder( "//path/to/video/save.mov", 24, 800, 600 )
or, to include an audio file:
enc = Draft.VideoEncoder( "//path/to/video/save.mov", audioFilename='//path/to/audio/load.wav' )
or, to use a specific quality and codec:
enc = Draft.VideoEncoder( "//path/to/video/save.mov", quality=80, codec='H264' )
or, to use a Fraction FPS:
from fractions import Fraction fps = Fraction(30000, 1001) enc = Draft.VideoEncoder( "//path/to/video.mov", fps, 800, 600, 5120, "MJPEG" )