mindspore/docs/api/api_python/dataset_vision/mindspore.dataset.vision.Vi...

37 lines
1.2 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.dataset.vision.VideoDecoder
=====================================
.. py:class:: mindspore.dataset.vision.VideoDecoder(source)
单流视频解码器支持读取视频流的元数据以及支持对H264或者H265编码格式的视频提供抽帧能力。
参数:
- **source** (str) - 视频文件路径。
异常:
- **TypeError** - 如果 `source` 不是str类型。
- **ValueError** - 如果 `source` 不存在或者权限被拒绝。
.. py:method:: get_frames_at(indices)
检索指定索引处的帧。
参数:
- **indices** (list[int]) - 要获取的帧索引列表。
返回:
numpy.ndarray四维uint8视频数据。格式为 [T, H, W, C]。“T”是帧数“H”是高度“W”是宽度“C”是RGB的通道。
异常:
- **TypeError** - 如果 `indices` 不是list类型。
- **TypeError** - 如果 `indices` 的值不是int类型。
- **ValueError** - 如果 `indices` 的值不在[0总帧数)范围内。
.. py:method:: metadata
:property:
获取视频流的元数据。
返回:
dict元数据的相关信息。