Video
paper-pptx 0.2.0 API reference
Immutable value object representing a video such as MP4.
Video(blob: bytes, mime_type: str | None, filename: str | None)Attributes
blob
attributeblobThe bytestream of the media "file".
content_type
attributecontent_typeMIME-type of this media, e.g. 'video/mp4'.
ext
attributeextReturn the file extension for this video, e.g. 'mp4'.
The extension is that from the actual filename if known. Otherwise it is the lowercase canonical extension for the video's MIME type. 'vid' is used if the MIME type is 'video/unknown'.
filename
attributefilenamestrReturn a filename.ext string appropriate to this video.
The base filename from the original path is used if this image was loaded from the filesystem. If no filename is available, such as when the video object is created from an in-memory stream, the string 'movie.{ext}' is used where 'ext' is suitable to the video format, such as 'mp4'.
sha1
attributesha1The SHA1 hash digest for the binary "file" of this video.
Example: '1be010ea47803b00e140b852765cdf84f491da47'
Functions
from_blob
funcfrom_blob(blob: bytes, mime_type: str | None, filename: str | None = None)Return a new Video object loaded from image binary in blob.
paramblobbytesparammime_typestr | Noneparamfilenamestr | None= Nonefrom_path_or_file_like
funcfrom_path_or_file_like(movie_file: str | IO[bytes], mime_type: str | None) -> VideoReturn a new Video object containing video in movie_file.
movie_file can be either a path (string) or a file-like (e.g. StringIO) object.
parammovie_filestr | IO[bytes]parammime_typestr | NoneReturns
pptx.media.Video