maix.pipeline
maix.pipeline module, video stream processing via pipeline
You can use
maix.pipeline
to access this module with MaixPy
This module is generated from MaixPy and MaixCDK
Module
No module
Enum
Variable
Function
Class
Stream
Stream class, saved the video stream data
C++ defination code:
class Stream
data_count
def data_count(self) -> int
Since a single stream may contain multiple pieces of data, this returns the number of data segments present.
item | description |
---|---|
type | func |
static | False |
C++ defination code:
int data_count()
data
def data(*args, **kwargs)
Get the data stream at index
item | description |
---|---|
type | func |
param | idx: data index, must be less than data_count(). |
return | Returns the data at index. Note: when using C++, you need to manually release the memory. |
static | False |
C++ defination code:
Bytes *data(int idx)
data_size
def data_size(self, idx: int) -> int
Get the data size at index
item | description |
---|---|
type | func |
param | idx: data index, must be less than data_count(). |
return | Returns the data size at index. |
static | False |
C++ defination code:
int data_size(int idx)
get_sps_frame
def get_sps_frame(*args, **kwargs)
Get the SPS frame data; if the frame does not exist, return null.
item | description |
---|---|
type | func |
return | SPS frame data. |
static | False |
C++ defination code:
Bytes *get_sps_frame()
get_pps_frame
def get_pps_frame(*args, **kwargs)
Get the PPS frame data; if the frame does not exist, return null.
item | description |
---|---|
type | func |
return | PPS frame data. |
static | False |
C++ defination code:
Bytes *get_pps_frame()
get_i_frame
def get_i_frame(*args, **kwargs)
Get the I frame data; if the frame does not exist, return null.
item | description |
---|---|
type | func |
return | I frame data. |
static | False |
C++ defination code:
Bytes *get_i_frame()
get_p_frame
def get_p_frame(*args, **kwargs)
Get the PTS(Presentation Timestamp) of the stream.
item | description |
---|---|
type | func |
return | P frame data. |
static | False |
C++ defination code:
Bytes *get_p_frame()
has_pps_frame
def has_pps_frame(self) -> bool
Check if the stream has PPS frame.
item | description |
---|---|
type | func |
return | PPS frame data. |
static | False |
C++ defination code:
bool has_pps_frame()
has_sps_frame
def has_sps_frame(self) -> bool
Check if the stream has SPS frame.
item | description |
---|---|
type | func |
return | SPS frame data. |
static | False |
C++ defination code:
bool has_sps_frame()
has_i_frame
def has_i_frame(self) -> bool
Check if the stream has I frame.
item | description |
---|---|
type | func |
return | True if the stream has I frame, otherwise false. |
static | False |
C++ defination code:
bool has_i_frame()
has_p_frame
def has_p_frame(self) -> bool
Check if the stream has P frame.
item | description |
---|---|
type | func |
return | True if the stream has P frame, otherwise false. |
static | False |
C++ defination code:
bool has_p_frame()
pts
def pts(self) -> int
Get the pts(Presentation Timestamp) of the stream
item | description |
---|---|
type | func |
return | Returns the pts of the stream. |
static | False |
C++ defination code:
size_t pts()
Frame
Frame class, saved the image data
C++ defination code:
class Frame
__init__
def __init__(self, frame: capsule, auto_delete: bool = False, from: str = '') -> None
Construct a new Frame object
item | description |
---|---|
type | func |
param | frame: frame handle auto_delete: auto delete frame when object is destroyed from: When releasing the object, the 'from' parameter will be referenced to determine the release method. |
static | False |
C++ defination code:
Frame(void *frame, bool auto_delete = false, std::string from = "")
width
def width(self) -> int
Get the width of the frame
item | description |
---|---|
type | func |
return | Returns the width of the frame. |
static | False |
C++ defination code:
int width()
height
def height(self) -> int
Get the height of the frame
item | description |
---|---|
type | func |
return | Returns the height of the frame. |
static | False |
C++ defination code:
int height()
format
def format(self) -> maix.image.Format
Get the format of the frame
item | description |
---|---|
type | func |
return | Returns the format of the frame. |
static | False |
C++ defination code:
image::Format format()
to_image
def to_image(self) -> maix.image.Image
Convert the frame to an image
item | description |
---|---|
type | func |
return | Returns an image object. |
static | False |
C++ defination code:
image::Image *to_image()
stride
def stride(self, idx: int) -> int
Get the stride of the plane. Stride represents the number of bytes occupied in memory by each row of image data.\nIt is usually greater than or equal to the number of bytes actually used by the pixels in that row.\nIn image processing, different image formats are divided into multiple planes.\nTypically, RGB images have only one valid plane, while NV21/NV12 images have two valid planes.
item | description |
---|---|
type | func |
param | idx: plane index. |
return | Returns the stride of the frame. |
static | False |
C++ defination code:
int stride(int idx)
virtual_address
def virtual_address(self, idx: int) -> int
Get the virtual address of the plane. In image processing, different image formats are divided into multiple planes.\nTypically, RGB images have only one valid plane, while NV21/NV12 images have two valid planes.
item | description |
---|---|
type | func |
note | You can read image data from this address, but you need to be very careful. If the current object has been released, operating on this address is prohibited. |
param | idx: plane index. |
return | Returns the virtual address of the frame. |
static | False |
C++ defination code:
uint64_t virtual_address(int idx)
physical_address
def physical_address(self, idx: int) -> int
Get the physical address of the plane. In image processing, different image formats are divided into multiple planes.\nTypically, RGB images have only one valid plane, while NV21/NV12 images have two valid planes.
item | description |
---|---|
type | func |
note | Don’t operate on this address. |
param | idx: plane index. |
return | Returns the physical address of the frame. |
static | False |
C++ defination code:
uint64_t physical_address(int idx)