Videos
Videos are handled internally using Decord and OpenCV libraries.
- Supported formats: MP4, AVI, MOV, MKV, FLV, WMV, M4V, 3GP.
- Supported codecs: MPEG-4, MPEG-2, VP8, VP9, AV1, MS-MPEG-4.
The video object includes specific attributes and methods for further processing.
|
Property |
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. |
|
video_reader (property) |
— |
decord.VideoReader |
Dynamic property: Returns a decord VideoReader object (lazily initialized). |
|
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. |
|
from_struct (class method) |
obj: dict (must include either filename or data) |
Video |
Creates a video object from a dictionary (such as JSON). |
Feedback
Was this page helpful?
Provide feedbackThank 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