Package dvedit :: Module core
[hide private]
[frames] | no frames]

Module core



Core DVEdit classes.

A set of classes for creation/editing of video files.

Internally, these classes work with DV format. If any given input clips are not in DV format, they will be transcoded to DV prior to opening.

The strength of this framework is based on the fact that most classes are derived from a single abstract base class Clip, and can themselves contain any objects of classes derived from Clip. This allows for great simplicity and versatility when constructing a video project.

A simple yet powerful plugin architecture is provided which supports filters on segments of Sequence objects, as well as transitions between two Clip objects.

Classes [hide private]
  BlankClip
Encapsulates a clip of a fixed length which returns only blank frames
  BlankFrame
Encapsulates a frame with no data
  Blend
Base class for a clip which is formed from 2 other clips
  Clip
Abstract base class for the various DV clip classes.
  ClipHolder
Used internally by Sequence and Stack objects for encapsulating individual Clip objects and their placement/trimming parameters
  Codec
Basic wrapping of libdv's DV codec, for converting between encoded DV data and the raw video/audio frames
  File
Presents a list-style interface to physical DV files, supporting some of the usual python list methods
  Filter
Base class for custom filters - subclass this and override the getFrame method to implement your own filters
  Frame
Encapsulates a single frame, with video and audio
  Frei0rFactory
Encapsulates a loaded Frei0r filter module, and contains methods to create a Frei0rFilter or Frei0rBlend object
  Frei0rFilter
Encapsulates an instance of a loaded Frei0r plugin
  Frei0rLoader
Singleton class which manages the loading of Frei0r plugins
  Frei0rMixer
Interface to a Frei0r mixer plugin, works like a regular DVEdit Blend
  Iter
Supports iteration over instances of Clip (or subclass)
  Keyframe
Encapsulates a single keyframe
  NameFactory
Utility class for assigning process-unique names to objects
  Sequence
Allows clips to be arranged in a timeline, analogous to a track.
  Slice
Encapsulates a slice of a clip
  Stack
Allows clips to be stacked on top of each other like tracks on a timeline
  Sum
Encapsulates the result of adding one clip to another via the '+' operator
  Transition
Base class for transitions between clips.
  UINode
Helper class for user interfaces
Functions [hide private]
 
_interpolate(...)
General-purpose utility for interpolating a set of values by a given proportion
 
cmpKeyframes(...)
compares two keyframes, used in sort routine in Clip.addKeyframe()
 
fileModTime(...)
 
frameTicker(...)
utility which displays dots and frame numbers, to show rendering progress.
 
interpolate(...)
Interpolates values at a point in a set of keyframes
 
isseq(...)
returns True if thing is a list or tuple
 
log(...)
 
makeName(...)
 
reconfigure(...)
 
rgb2yuv(...)
converts an r,g,b tuple to y,cb,cr
 
yuv2rgb(...)
converts a y,cb,cr tuple to r,g,b
Variables [hide private]
  AUDIO_CORRECT_AVERAGE = 2
  AUDIO_CORRECT_NONE = 0
  AUDIO_CORRECT_SILENCE = 1
  AUDIO_MAX_SAMPLES = 1944
  AUDIO_NUM_OPTS = 5
  AUDIO_OPT_CALLBACK = 4
  AUDIO_OPT_CHAN_MIX = 3
  AUDIO_OPT_EMPHASIS = 2
  AUDIO_OPT_FREQUENCY = 0
  AUDIO_OPT_QUANTIZATION = 1
  COLOR_BGR0 = 2
  COLOR_RGB = 1
  COLOR_YUV = 0
  DCT_248 = 1
  DCT_88 = 0
  DCT_AUTO = -1
  DECODER_NUM_OPTS = 5
  DECODER_OPT_AUDIO_INCLUDE = 2
  DECODER_OPT_CALLBACK = 3
  DECODER_OPT_NTSCSETUP = 4
  DECODER_OPT_SYSTEM = 0
  DECODER_OPT_VIDEO_INCLUDE = 1
  FSC_0 = 0
  FSC_1 = 1
  OSS_NUM_OPTS = 2
  OSS_OPT_DEVICE = 0
  OSS_OPT_FILE = 1
  PIX_FMT_BGR = 2
  PIX_FMT_BGRA = 5
  PIX_FMT_NONE = 0
  PIX_FMT_RGB = 1
  PIX_FMT_RGBA = 4
  PIX_FMT_YUV = 3
  PIX_FMT_YUVA = 6
  PIX_FMT_YUY2 = 7
  QUALITY_AC_1 = 2
  QUALITY_AC_2 = 4
  QUALITY_AC_MASK = 6
  QUALITY_BEST = 5
  QUALITY_COLOR = 1
  QUALITY_DC = 0
  QUALITY_FASTEST = 0
  SAMPLE_411 = 1
  SAMPLE_420 = 2
  SAMPLE_422 = 3
  SAMPLE_NONE = 0
  SCT_AUDIO = 3
  SCT_HEADER = 0
  SCT_SUBCODE = 1
  SCT_VAUX = 2
  SCT_VIDEO = 4
  STD_IEC_61834 = 2
  STD_NONE = 0
  STD_SMPTE = 1
  STSTEM_525_60 = 1
  SYSTEM_625_50 = 2
  SYSTEM_NONE = 0
  VIDEO_NUM_OPTS = 3
  VIDEO_OPT_BLOCK_QUALITY = 0
  VIDEO_OPT_CALLBACK = 2
  VIDEO_OPT_MONOCHROME = 1
  WEIGHT_BIAS = 6
  __pyx_capi__ = {'clamp256': <PyCObject object at 0x4046e158>}
  _standardNames = {0: 'NTSC', 1: 'PAL'}
  frei0r = <object 'Frei0r plugin loader'>
  frei0rColorModels = {0: 'BGRA8888', 1: 'RGBA8888', 2: 'PACKED32'}
  frei0rParamTypes = {0: 'bool', 1: 'double', 2: 'color', 3: 'po...
  frei0rPluginAbbrevs = {0: 'F', 1: 'S', 2: 'M2', 3: 'M3'}
  frei0rPluginTypes = {0: 'Filter: one input, one output', 1: 'S...
Function Details [hide private]

_interpolate(...)

 

General-purpose utility for interpolating a set of values by a given proportion

Arguments:
  • proportion - a number between 0 and 1, meaning what proportion of the distance to travel from state1 to state2
  • state0 - a simple data structure for start state, can be a simple number, or sequence of numbers, with sequence nesting allowed
  • state1 - a simple data structure for end state, ditto

frameTicker(...)

 
utility which displays dots and frame numbers, to show rendering progress. Pass this as a callback to .render() calls

interpolate(...)

 

Interpolates values at a point in a set of keyframes

Arguments:
  • t - current frame number
  • keyframes - one or more (framenum, state) tuples, where framenum is the position of the keyframe, and state is a simple data structure for values at that frame (refer function 'interpolate')
Note:
  • before frame t0, will return values0
  • if t0 <= t < t1, will interpolate between values0 and values1
  • at frame t1 and after, will return values1
  • types of returned values will be same as inputs
  • value args can have arbitrarily nested sequences

Variables Details [hide private]

frei0rParamTypes

Value:
{0: 'bool', 1: 'double', 2: 'color', 3: 'position', 4: 'string'}

frei0rPluginTypes

Value:
{0: 'Filter: one input, one output',
 1: 'Source: just one output',
 2: 'Mixer2: two inputs, one output',
 3: 'Mixer3: three inputs, one output'}