FFmpegWrapper is a small wrapper for the ffmpeg encoder. You can append Codec, Filters and other OptionStores to the FFmpeg class and then run the resulting command.
>>> from ffmpegwrapper import FFmpeg, Input, Output, VideoCodec, VideoFilter
>>> videofilter = VideoFilter().crop(300, 200)
>>> codec = VideoCodec('webm')
>>> input_video = Input('old')
>>> output_video = Output('new', videofilter, codec)
>>> FFmpeg('ffmpeg', input_video, output_video)
<FFmpeg ['ffmpeg', '-i', 'old', '-vf', 'crop=300:200', '-vcodec', 'webm', 'new']>
There are two kinds of classes in FFmpegwrapper. The Stores and Options. A Store is a object where you can append an Option or even Stores which then have their own Options. A Option represent one or more arguments for FFmpeg. A Store is more likea bigger block of Options for a specific need. For example: Everything that describe the Output can be appended to the Output class.
This class represent the FFmpeg command.
It behaves like a list. If you iterate over the object it will yield small parts from the ffmpeg command with it arguments. The arguments for the command are in the Option classes. They can be appended directly or through one or more Stores.
Parameters: |
|
---|
Executes the command of this object. Return a FFmpegProcess object which have already the FFmpegProcess.run() invoked.
Returns: | FFmpegProcess object with run() invoked |
---|
Class to exectute FFmpeg.
Parameters: | command – a sequence of the binary and it arguments |
---|
Yield lines from the queue that were collected from the command. You can specify if you want to keep newlines at the ends. Default is to drop them.
Parameters: | keepends – keep the newlines at the end. Default=False |
---|
Executes the command. A thread will be started to collect the outputs (stderr and stdout) from that command. The outputs will be written to the queue.
Returns: | self |
---|
Store for a input file.
Parameters: |
|
---|
This represent an video codec.
You can append this class to an Output object to tell which FFmpeg which codec you want.
This represent an audio codec.
You can append this class to an Output object to tell which FFmpeg which codec you want.
Load default presets from a preset file
FilterStore for Videofilters.
See also
FilterStore for Audifilters.
See also
does nothing