maix::rtmp

maix.rtmp module

This is maix::rtmp module of MaixCDK.
All of these elements are in namespace maix::rtmp.

For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!

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

Rtmp

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

Get bitrate

item description
type func
return bitrate
static False

C++ defination code:

int bitrate()

push_video (overload 1)

Push rtmp video data

item description
type func
return return 0 ok, other error
static False

C++ defination code:

int push_video(void *data, size_t data_size, uint32_t timestamp)

push_audio

Push rtmp audio data

item description
type func
return return 0 ok, other error
static False

C++ defination code:

int push_audio(void *data, size_t data_size, uint32_t timestamp)

push_script

Push rtmp script data

item description
type func
return return 0 ok, other error
static False

C++ defination code:

int push_script(void *data, size_t data_size, uint32_t timestamp)

bind_camera

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)

bind_audio_recorder

Bind audio recorder

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

C++ defination code:

err::Err bind_audio_recorder(audio::Recorder *recorder)

bind_display

Bind display

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

C++ defination code:

err::Err bind_display(display::Display *display)

get_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()

capture

If you bind a camera, capture the image of the camera

item description
type func
note The return value may be null, you must check whether the return value is null
return Image object
static False

C++ defination code:

image::Image *capture()

start

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.(This parameter has been deprecated)
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

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()

lock

Lock

item description
type func
param time: lock time, unit:ms
return error code, err::ERR_NONE means success, others means failed
static False

C++ defination code:

err::Err lock(uint32_t time)

unlock

Unlock

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

C++ defination code:

err::Err unlock()

get_path

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()