anjisuan783 / mia

stream server library written with c++
MIT License
7 stars 4 forks source link

MIA

Media stream server library written by c++.

Usage:

Build MIA from code. Then edit conf/mia.cfg, correct candidates.

git clone https://github.com/anjisuan783/mia.git
cd mia
./script/buildAll.sh
nohup ./mia -l conf/log4cxx.properties -c conf/mia.cfg &

Start players by http_server which is a very simple http server written by python. Or replace http_server with apache、ngnix etc. The web players pages are located in mia/www/srs_players

./script/http_server.sh

Open https://localhost/ to check if it works.

CentOS 7 supported only now!

Features

Rtc API

1. WebRTC api is compating with SRS.

You can publish and playing with SRS players.

2. C++ api

class MediaRtcPublisherApi {

public:

virtual ~MediaRtcPublisherApi() = default;

virtual void OnPublish(const std::string& tcUrl, const std::string& stream) = 0;

virtual void OnUnpublish() = 0;

virtual void OnFrame(owt_base::Frame&) = 0;

};

class MediaRtmpPublisherApi {

public:

virtual ~MediaRtmpPublisherApi() = default;

virtual void OnPublish(const std::string& tcUrl, const std::string& stream) = 0;

virtual void OnUnpublish() = 0;

virtual void OnVideo(const uint8_t*, uint32_t len, uint32_t timestamp) = 0;

virtual void OnAudio(const uint8_t*, uint32_t len, uint32_t timestamp) = 0;

};

Example

1. Publish with MediaRtcPublisherApi

./rtc_push -l conf/log4cxx.properties -c conf/mia.cfg -s data/avatar_264_1080.flv

2. Publish with MediaRtmpPublisherApi

./rtmp_push -l conf/log4cxx.properties -c conf/mia.cfg -s data/avatar_264_1080.flv

WebRTC Play

WebRTC Play

Http(s)-flv play

Http(s)-flv Play

AUTHORS

anjisuan783@sina.com

Releases

developing