1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

release 1.0r2

This commit is contained in:
winlin 2015-02-12 10:45:44 +08:00
commit 99a455fdeb
10 changed files with 63 additions and 17 deletions

View file

@ -1,12 +1,14 @@
#Simple-RTMP-Server #Simple-RTMP-Server
SRS/1.0,开发代号:[HuKaiqun](https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_Product#release10)
SRS定位是运营级的互联网直播服务器集群追求更好的概念完整性和最简单实现的代码。 SRS定位是运营级的互联网直播服务器集群追求更好的概念完整性和最简单实现的代码。
下载发布版(github): 下载发布版(github):
[Centos6-x86_64](http://winlinvip.github.io/srs.release/releases/files/SRS-CentOS6-x86_64-1.0.21.zip) [Centos6-x86_64](http://winlinvip.github.io/srs.release/releases/files/SRS-CentOS6-x86_64-1.0.27.zip)
其他[more...](http://winlinvip.github.io/srs.release/releases/) <br/> 其他[more...](http://winlinvip.github.io/srs.release/releases/) <br/>
下载发布版(国内阿里云镜像): 下载发布版(国内阿里云镜像):
[Centos6-x86_64](http://www.ossrs.net/srs.release/releases/files/SRS-CentOS6-x86_64-1.0.21.zip) [Centos6-x86_64](http://www.ossrs.net/srs.release/releases/files/SRS-CentOS6-x86_64-1.0.27.zip)
其他[more...](http://www.ossrs.net/srs.release/releases/)<br/> 其他[more...](http://www.ossrs.net/srs.release/releases/)<br/>
QQ群: 365936885, by wenjie <br/> QQ群: 365936885, by wenjie <br/>
同类产品:[BLS](https://github.com/wenjiegit/Bull-Live-Server)/[BLE](https://github.com/wenjiegit/Bull-Live-Encoder), [NGINX-RTMP](https://github.com/arut/nginx-rtmp-module), [CRTMPD](http://www.rtmpd.com/), [RED5](http://www.red5.org/), [WOWZA](http://www.wowza.com/), [FMS/AMS](http://www.adobe.com/products/adobe-media-server-standard.html) 同类产品:[BLS](https://github.com/wenjiegit/Bull-Live-Server)/[BLE](https://github.com/wenjiegit/Bull-Live-Encoder), [NGINX-RTMP](https://github.com/arut/nginx-rtmp-module), [CRTMPD](http://www.rtmpd.com/), [RED5](http://www.red5.org/), [WOWZA](http://www.wowza.com/), [FMS/AMS](http://www.adobe.com/products/adobe-media-server-standard.html)
@ -362,6 +364,7 @@ Supported operating systems and hardware:
[2.0dev branch](https://github.com/winlinvip/simple-rtmp-server/tree/master). [2.0dev branch](https://github.com/winlinvip/simple-rtmp-server/tree/master).
## Releases ## Releases
* 2015-02-12, [Release v1.0r2](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r2), bug fixed, 1.0.27, 59507 lines.<br/>
* 2015-01-15, [Release v1.0r1](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1), bug fixed, 1.0.21, 59472 lines.<br/> * 2015-01-15, [Release v1.0r1](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1), bug fixed, 1.0.21, 59472 lines.<br/>
* 2014-12-05, [Release v1.0](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0), all bug fixed, 1.0.10, 59391 lines.<br/> * 2014-12-05, [Release v1.0](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0), all bug fixed, 1.0.10, 59391 lines.<br/>
* 2014-10-09, [Release v1.0-beta](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.beta), all bug fixed, 1.0.0, 59316 lines.<br/> * 2014-10-09, [Release v1.0-beta](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.beta), all bug fixed, 1.0.0, 59316 lines.<br/>
@ -384,6 +387,14 @@ Supported operating systems and hardware:
* 2013-10-17, Created.<br/> * 2013-10-17, Created.<br/>
## History ## History
* <strong>v1.0, 2015-02-12, [1.0r2 release(1.0.27)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r2) released. 59507 lines.</strong>
* v1.0, 2015-02-11, dev code HuKaiqun for 1.0.27.
* v1.0, 2015-02-10, for [#310](https://github.com/winlinvip/simple-rtmp-server/issues/310), the aac profile must be object plus one. 1.0.26
* v1.0, 2015-01-25, hotfix [#268](https://github.com/winlinvip/simple-rtmp-server/issues/268), refine the pcr start at 0, dts/pts plus delay. 1.0.25
* v1.0, 2015-01-25, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), refine pcr=dts-800ms and use dts/pts directly. 1.0.24
* v1.0, 2015-01-23, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), use absolutely overflow to make jwplayer happy. 1.0.23
* v1.0, 2015-01-17, hotfix [#290](https://github.com/winlinvip/simple-rtmp-server/issues/290), use iformat only for rtmp input. 1.0.22
* <strong>v1.0, 2015-01-15, [1.0r1 release(1.0.21)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1) released. 59472 lines.</strong> * <strong>v1.0, 2015-01-15, [1.0r1 release(1.0.21)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1) released. 59472 lines.</strong>
* v1.0, 2015-01-08, hotfix [#281](https://github.com/winlinvip/simple-rtmp-server/issues/281), fix hls bug ignore type-9 send aud. 1.0.20 * v1.0, 2015-01-08, hotfix [#281](https://github.com/winlinvip/simple-rtmp-server/issues/281), fix hls bug ignore type-9 send aud. 1.0.20
* v1.0, 2015-01-03, hotfix to remove the pageUrl for http callback. 1.0.19 * v1.0, 2015-01-03, hotfix to remove the pageUrl for http callback. 1.0.19

View file

@ -247,6 +247,13 @@ int SrsAvcAacCodec::audio_aac_demux(char* data, int size, SrsCodecSample* sample
return ret; return ret;
} }
// the profile = object_id + 1
// @see aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 78,
// Table 1. A.9 ¨C MPEG-2 Audio profiles and MPEG-4 Audio object types
// so the aac_profile should plus 1, not minus 1, and nginx-rtmp used it to
// downcast aac SSR to LC.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/310
// TODO: FIXME: fix the following in future version.
// aac_profile = audioObjectType - 1 // aac_profile = audioObjectType - 1
aac_profile--; aac_profile--;

View file

@ -222,7 +222,7 @@ int SrsEdgeIngester::connect_app(string ep_server, string ep_port)
// @see https://github.com/winlinvip/simple-rtmp-server/issues/147 // @see https://github.com/winlinvip/simple-rtmp-server/issues/147
SrsAmf0Object* data = req->args; SrsAmf0Object* data = req->args;
data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY)); data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY));
data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")")); data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_SERVER));
data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE)); data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE));
data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE)); data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE));
data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL)); data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL));
@ -654,7 +654,7 @@ int SrsEdgeForwarder::connect_app(string ep_server, string ep_port)
// @see https://github.com/winlinvip/simple-rtmp-server/issues/147 // @see https://github.com/winlinvip/simple-rtmp-server/issues/147
SrsAmf0Object* data = req->args; SrsAmf0Object* data = req->args;
data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY)); data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY));
data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")")); data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_SERVER));
data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE)); data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE));
data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE)); data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE));
data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL)); data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL));

View file

@ -209,6 +209,13 @@ int SrsFFMPEG::initialize_transcode(SrsConfDirective* engine)
return ret; return ret;
} }
// for not rtmp input, donot append the iformat,
// for example, "-f flv" before "-i udp://192.168.1.252:2222"
// @see https://github.com/winlinvip/simple-rtmp-server/issues/290
if (input.find("rtmp://") != 0) {
iformat = "";
}
return ret; return ret;
} }

View file

@ -336,7 +336,7 @@ int SrsForwarder::connect_app(string ep_server, string ep_port)
// @see https://github.com/winlinvip/simple-rtmp-server/issues/147 // @see https://github.com/winlinvip/simple-rtmp-server/issues/147
SrsAmf0Object* data = req->args; SrsAmf0Object* data = req->args;
data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY)); data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY));
data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")")); data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_SERVER));
data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE)); data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE));
data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE)); data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE));
data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL)); data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL));

View file

@ -78,7 +78,9 @@ using namespace std;
// @see: NGX_RTMP_HLS_DELAY, // @see: NGX_RTMP_HLS_DELAY,
// 63000: 700ms, ts_tbn=90000 // 63000: 700ms, ts_tbn=90000
#define SRS_AUTO_HLS_DELAY 63000 // 72000: 800ms, ts_tbn=90000
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71352511
#define SRS_AUTO_HLS_DELAY 72000
// the mpegts header specifed the video/audio pid. // the mpegts header specifed the video/audio pid.
#define TS_VIDEO_PID 256 #define TS_VIDEO_PID 256
@ -237,7 +239,8 @@ public:
p[-1] |= 0x20; // Both Adaption and Payload p[-1] |= 0x20; // Both Adaption and Payload
*p++ = 7; // size *p++ = 7; // size
*p++ = 0x50; // random access + PCR *p++ = 0x50; // random access + PCR
p = write_pcr(p, frame->dts - SRS_AUTO_HLS_DELAY); // about the pcr, read https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71352511
p = write_pcr(p, frame->dts);
} }
// PES header // PES header
@ -368,10 +371,12 @@ private:
} }
static char* write_pcr(char* p, int64_t pcr) static char* write_pcr(char* p, int64_t pcr)
{ {
// the pcr=dts-delay // the pcr=dts-delay, where dts = frame->dts + delay
// and the pcr maybe negative // and the pcr should never be negative
// @see https://github.com/winlinvip/simple-rtmp-server/issues/268 // @see https://github.com/winlinvip/simple-rtmp-server/issues/268
int64_t v = srs_max(0, pcr); srs_assert(pcr >= 0);
int64_t v = pcr;
*p++ = (char) (v >> 25); *p++ = (char) (v >> 25);
*p++ = (char) (v >> 17); *p++ = (char) (v >> 17);
@ -655,10 +660,15 @@ int SrsHlsMuxer::on_sequence_header()
bool SrsHlsMuxer::is_segment_overflow() bool SrsHlsMuxer::is_segment_overflow()
{ {
srs_assert(current); srs_assert(current);
return current->duration >= hls_fragment; return current->duration >= hls_fragment;
} }
bool SrsHlsMuxer::is_segment_absolutely_overflow()
{
srs_assert(current);
return current->duration >= 2 * hls_fragment;
}
int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab) int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
@ -1090,7 +1100,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
// pure audio again for audio disabled. // pure audio again for audio disabled.
// so we reap event when the audio incoming when segment overflow. // so we reap event when the audio incoming when segment overflow.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151 // @see https://github.com/winlinvip/simple-rtmp-server/issues/151
if (muxer->is_segment_overflow()) { // we use absolutely overflow of segment to make jwplayer/ffplay happy
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184
if (muxer->is_segment_absolutely_overflow()) {
if ((ret = reap_segment("audio", muxer, af->pts)) != ERROR_SUCCESS) { if ((ret = reap_segment("audio", muxer, af->pts)) != ERROR_SUCCESS) {
return ret; return ret;
} }

View file

@ -192,10 +192,16 @@ public:
virtual int segment_open(int64_t segment_start_dts); virtual int segment_open(int64_t segment_start_dts);
virtual int on_sequence_header(); virtual int on_sequence_header();
/** /**
* whether video overflow, * whether segment overflow,
* that is whether the current segment duration >= the segment in config * that is whether the current segment duration>=(the segment in config)
*/ */
virtual bool is_segment_overflow(); virtual bool is_segment_overflow();
/**
* whether segment absolutely overflow, for pure audio to reap segment,
* that is whether the current segment duration>=2*(the segment in config)
* @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184
*/
virtual bool is_segment_absolutely_overflow();
virtual int flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab); virtual int flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab);
virtual int flush_video(SrsMpegtsFrame* af, SrsBuffer* ab, SrsMpegtsFrame* vf, SrsBuffer* vb); virtual int flush_video(SrsMpegtsFrame* af, SrsBuffer* ab, SrsMpegtsFrame* vf, SrsBuffer* vb);
/** /**

View file

@ -956,7 +956,7 @@ int SrsSource::on_meta_data(SrsMessage* msg, SrsOnMetaDataPacket* metadata)
} }
// add server info to metadata // add server info to metadata
metadata->metadata->set("server", SrsAmf0Any::str(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")")); metadata->metadata->set("server", SrsAmf0Any::str(RTMP_SIG_SRS_SERVER));
metadata->metadata->set("primary", SrsAmf0Any::str(RTMP_SIG_SRS_PRIMARY)); metadata->metadata->set("primary", SrsAmf0Any::str(RTMP_SIG_SRS_PRIMARY));
metadata->metadata->set("authors", SrsAmf0Any::str(RTMP_SIG_SRS_AUTHROS)); metadata->metadata->set("authors", SrsAmf0Any::str(RTMP_SIG_SRS_AUTHROS));

View file

@ -31,9 +31,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version // current release version
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 21 #define VERSION_REVISION 27
// server info. // server info.
#define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_CODE "HuKaiqun"
#define RTMP_SIG_SRS_ROLE "origin/edge server" #define RTMP_SIG_SRS_ROLE "origin/edge server"
#define RTMP_SIG_SRS_NAME RTMP_SIG_SRS_KEY"(Simple RTMP Server)" #define RTMP_SIG_SRS_NAME RTMP_SIG_SRS_KEY"(Simple RTMP Server)"
#define RTMP_SIG_SRS_URL_SHORT "github.com/winlinvip/simple-rtmp-server" #define RTMP_SIG_SRS_URL_SHORT "github.com/winlinvip/simple-rtmp-server"
@ -49,6 +51,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define RTMP_SIG_SRS_RELEASE "https://github.com/winlinvip/simple-rtmp-server/tree/1.0release" #define RTMP_SIG_SRS_RELEASE "https://github.com/winlinvip/simple-rtmp-server/tree/1.0release"
#define RTMP_SIG_SRS_HTTP_SERVER "https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPServer#feature" #define RTMP_SIG_SRS_HTTP_SERVER "https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPServer#feature"
#define RTMP_SIG_SRS_VERSION __SRS_XSTR(VERSION_MAJOR)"."__SRS_XSTR(VERSION_MINOR)"."__SRS_XSTR(VERSION_REVISION) #define RTMP_SIG_SRS_VERSION __SRS_XSTR(VERSION_MAJOR)"."__SRS_XSTR(VERSION_MINOR)"."__SRS_XSTR(VERSION_REVISION)
#define RTMP_SIG_SRS_SERVER RTMP_SIG_SRS_KEY"/"RTMP_SIG_SRS_VERSION"("RTMP_SIG_SRS_CODE")"
// internal macros, covert macro values to str, // internal macros, covert macro values to str,
// see: read https://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification // see: read https://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification

View file

@ -905,7 +905,7 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip)
data->set("version", SrsAmf0Any::str(RTMP_SIG_FMS_VER)); data->set("version", SrsAmf0Any::str(RTMP_SIG_FMS_VER));
data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY)); data->set("srs_sig", SrsAmf0Any::str(RTMP_SIG_SRS_KEY));
data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")")); data->set("srs_server", SrsAmf0Any::str(RTMP_SIG_SRS_SERVER));
data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE)); data->set("srs_license", SrsAmf0Any::str(RTMP_SIG_SRS_LICENSE));
data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE)); data->set("srs_role", SrsAmf0Any::str(RTMP_SIG_SRS_ROLE));
data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL)); data->set("srs_url", SrsAmf0Any::str(RTMP_SIG_SRS_URL));