Videos
Video data is processed internally using PyAV.
- Supported formats: MP4, MKV, WebM, AVI, MOV, FLV, M4V, M4A, 3GP, 3G2, and TS
- Supported codecs: AVC1, AVC3, H.264, HVC1, H.265, HEVC, VP9, VP8, and MP4V
The video object includes specific attributes and methods for further processing.
| Attribute | Type | Description |
|---|---|---|
| filename | str | Path of the video file (if loaded from a file). |
| format | str | Video format (e.g., mp4, avi). |
| data | bytes | Video data. |
| Method | Parameter | Return Value | Description |
|---|---|---|---|
| __init__ | filename: Union[str, os.PathLike] = None,data: Union[str, bytes] = None | None | Constructor: Loads video from a file or binary data. |
| truncate | start_time: float (start time, in seconds) <br>end_time: float (end time, in seconds) <br>shape: Optional[tuple[int, int]] (target resolution) <br>fps: float = None (target frame rate) <br>codec: str = "avc1" (encoding format) <br>format: str = "mp4" (output format) | Video | Trims a video segment, allowing adjustments to resolution, frame rate, and encoding format. Returns a new video object. |
| write | filename: str, codec: str | None | Saves the video to a file. |
| convert_format | format | Video | Converts the video to another one in a different format. |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot