madam.ffmpeg module¶
-
class
madam.ffmpeg.
FFmpegMetadataProcessor
[source]¶ Bases:
madam.core.MetadataProcessor
Represents a metadata processor that uses FFmpeg.
-
class
madam.ffmpeg.
FFmpegProcessor
[source]¶ Bases:
madam.core.Processor
Represents a processor that uses FFmpeg to read audio and video data.
The minimum version of FFmpeg required is v0.9.
-
convert
(asset, mime_type, video=None, audio=None, subtitles=None)[source]¶ Creates a new asset of the specified MIME type from the essence of the specified asset.
Additional options can be specified for video, audio, and subtitle streams. Options are passed as dictionary instances and can contain various keys for each stream type.
Options for video streams:
- codec – Processor-specific name of the video codec as string
- bitrate – Target bitrate in kBit/s as float number
Options for audio streams:
- codec – Processor-specific name of the audio codec as string
- bitrate – Target bitrate in kBit/s as float number
Options for subtitle streams:
- codec – Processor-specific name of the subtitle format as string
Parameters: - asset – Asset whose contents will be converted
- mime_type – MIME type of the video container
- video – Dictionary with options for video streams.
- audio – Dictionary with options for audio streams.
- subtitles – Dictionary with the options for subtitle streams.
Returns: New asset with converted essence
-
extract_frame
(asset, mime_type, seconds=0)[source]¶ Creates a new image asset of the specified MIME type from the essence of the specified video asset.
Parameters: Returns: New image asset with converted essence
-
resize
(asset, width, height)[source]¶ Creates a new image or video asset of the specified width and height from the essence of the specified image or video asset.
Width and height must be positive numbers.
Parameters: Returns: New asset with specified width and height
-