An instance of the MovieFile class allows creating a movie file from a sequence of still images. More...
Public Member Functions | |
def | __init__ (self, outFilePath, shape=(800, 600), rate=24) |
The constructor launches ffmpeg to create a movie output file (replacing any existing file with the same name). More... | |
def | addFrame (self, image) |
def | close (self) |
Private Attributes | |
_p | |
_shape | |
An instance of the MovieFile class allows creating a movie file from a sequence of still images.
Use the constructor to specify the filename and the frame size, then insert the frames one at a time with the addFrame() function, and finally flush all movie information to the file with the close() function. The resulting movie file uses MPEG-4 encoding and must have the .mp4 filename extension.
This class requires ffmpeg
(https://ffmpeg.org) to be installed and in the PATH. The Anaconda Python distribution offers a package called "ffmpeg" that does just this. In other cases, the installation procedure might differ.
def pts.visual.moviefile.MovieFile.__init__ | ( | self, | |
outFilePath, | |||
shape = (800,600) , |
|||
rate = 24 |
|||
) |
The constructor launches ffmpeg
to create a movie output file (replacing any existing file with the same name).
When the constructor finishes, ffmpeg
is waiting for movie frames to be sent to it.
The constructor accepts the following arguments: