Class DecodeVideo

Inheritance Relationships

Base Type

Class Documentation

class DecodeVideo : public mindspore::dataset::TensorTransform

Decode the input video.

Public Functions

DecodeVideo()

Constructor. It will decode a vector containing a raw video tensor into a vector containing two tensors. The raw video tensor in the input vector should be 1D array of UINT8. The first tensor in the output vector is a visual tensor, the shape is <T,H,W,C>, the type is DE_UINT8. Pixel order is RGB. The second tensor in the output vector is an audio tensor, the shape is <C, L>.

Example
/* Read video file into tensor */
mindspore::MSTensor video;
ASSERT_OK(mindspore::dataset::vision::ReadFile("/path/to/video/file", &video));
std::vector<mindspore::MSTensor> input_tensor;
std::vector<mindspore::MSTensor> output_tensor;
input_tensor.push_back(video);
auto decode_video = vision::DecodeVideo();
auto transform = Execute(decode_video);
Status rc = transform(input_tensor, &output_tensor);

~DecodeVideo() = default

Destructor.