__init__(self,
dirname,
numframes,
prefix=' frame ' ,
ext=' jpg ' ,
pad=None,
startnum=1,
size=None)
(Constructor)
| source code
|
The file names are of the format {prefix}{zero-padded num}.{ext}, the
amount of zero-padding is determined automatically based on numframes. If
there is additional zero-padding required, put it in the prefix. Example:
a directory with images: vid_t1_s1_f001.jpg, ..., vid_t1_s1_f999.jpg
would have prefix="vid_t1_s1_f", startnum=1, numframes=999,
ext="jpg"
- Parameters:
dirname - directory where the images comprising the video exist
numframes - the number of frames in the video...0 to numframes will be read.
specify None to read all images in directory, in which case you
must specify a value for the pad parameter.
prefix - a string which remains as a constant prefix to all frames in
video
ext - the extension of the images, like jpg, png, etc. Do not include
the dot.
pad - the padding (like string.zfill(x)) used on the sequential
numbering of the input files. Specify None, and the padding will
be determined based on length of numframes. (So if numframes =
1234, then pad=4, 0001,0002,...1234)
startnum - the starting number of the first frame, defaults to 1
size - the optional width,height to resize the input frames
- Overrides:
object.__init__
|