maix.rtmp

maix.rtmp module

You can use maix.rtmp to access this module with MaixPy
This module is generated from MaixPy and MaixCDK

Module

No module

Enum

TagType

Video type

item describe
values TAG_NONE:
TAG_VIDEO:
TAG_AUDIO:
TAG_SCRIPT:

C++ defination code:

enum TagType
    {
        TAG_NONE,
        TAG_VIDEO,
        TAG_AUDIO,
        TAG_SCRIPT,
    }

Variable

Function

Class

Rtmp

Rtmp class

C++ defination code:

class Rtmp

__init__

def __init__(self, host: str = 'localhost', port: int = 1935, app: str = '', stream: str = '', bitrate: int = 1000000) -> None

Construct a new Video object

item description
type func
note Rtmp url : rtmp://host:prot/app/stream
example:
r = Rtmp("localhost", 1935, "live", "stream")
means rtmp url is rtmp://localhost:1935/live/stream
param host: rtmp ip
port: rtmp port, default is 1935.
app: rtmp app name
stream: rtmp stream name
bitrate: rtmp bitrate, default is 1000 * 1000
static False

C++ defination code:

Rtmp(std::string host = "localhost", int port = 1935, std::string app = std::string(), std::string stream = std::string(), int bitrate = 1000 * 1000)

push_video

def push_video(self) -> int

Get bitrate

item description
type func
return bitrate
static False

C++ defination code:

int bitrate()

bind_camera

def bind_camera(self, cam: maix.camera.Camera) -> maix.err.Err

Bind camera

item description
type func
note If the cam object is bound, the cam object cannot be used elsewhere.
param cam: camera object
return error code, err::ERR_NONE means success, others means failed
static False

C++ defination code:

err::Err bind_camera(camera::Camera *cam)

get_camera

def get_camera(self) -> maix.camera.Camera

If you bind a camera, return the camera object.

item description
type func
return Camera object
static False

C++ defination code:

camera::Camera *get_camera()

start

def start(self, path: str = '') -> maix.err.Err

Start push stream

item description
type func
note only support flv file now
param path: File path, if you passed file path, cyclic push the file, else if you bound camera, push the camera image.
return error code, err::ERR_NONE means success, others means failed
static False

C++ defination code:

err::Err start(std::string path = std::string())

stop

def stop(self) -> maix.err.Err

Stop push stream

item description
type func
return error code, err::ERR_NONE means success, others means failed
static False

C++ defination code:

err::Err stop()

get_path

def get_path(self) -> str

Get the file path of the push stream

item description
type func
return file path
static False

C++ defination code:

std::string get_path()

get_path (overload 1)

Check whether push streaming has started

item description
type func
return If rtmp thread is running, returns true
static False

C++ defination code:

bool is_started()