winlin

update readme

@@ -110,6 +110,7 @@ cd simple-rtmp-server/trunk @@ -110,6 +110,7 @@ cd simple-rtmp-server/trunk
110 * [Usage: How to forward stream to other server?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleForward) 110 * [Usage: How to forward stream to other server?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleForward)
111 * [Usage: How to deploy low lantency application?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleRealtime) 111 * [Usage: How to deploy low lantency application?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleRealtime)
112 * [Usage: How to deploy SRS on ARM?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleARM) 112 * [Usage: How to deploy SRS on ARM?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleARM)
  113 +* [Usage: How to ingest file/stream/device to SRS?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleIngest)
113 * [Usage: How to use SRS-HTTP-server to delivery HTTP/HLS stream?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleHTTP) 114 * [Usage: How to use SRS-HTTP-server to delivery HTTP/HLS stream?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleHTTP)
114 * [Usage: How to show the demo of SRS?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleDemo) 115 * [Usage: How to show the demo of SRS?](https://github.com/winlinvip/simple-rtmp-server/wiki/SampleDemo)
115 * [Usage: Solution using SRS?](https://github.com/winlinvip/simple-rtmp-server/wiki/Sample) 116 * [Usage: Solution using SRS?](https://github.com/winlinvip/simple-rtmp-server/wiki/Sample)
@@ -116,6 +116,7 @@ vhost ingest.srs.com { @@ -116,6 +116,7 @@ vhost ingest.srs.com {
116 # @remark, the output is specified following. 116 # @remark, the output is specified following.
117 engine { 117 engine {
118 # @see enabled of transcode engine. 118 # @see enabled of transcode engine.
  119 + # if disabled or vcodec/acodec not specified, use copy.
119 # default: off. 120 # default: off.
120 enable off; 121 enable off;
121 # output stream. variables: 122 # output stream. variables:
  1 +# use ffmpeg to ingest file/stream/device to SRS
  2 +# @see https://github.com/winlinvip/simple-rtmp-server/wiki/SampleIngest
  3 +# @see full.conf for detail config.
  4 +
  5 +listen 1935;
  6 +vhost __defaultVhost__ {
  7 + ingest {
  8 + enable on;
  9 + input {
  10 + type file;
  11 + url ./doc/source.200kbps.768x320.flv;
  12 + }
  13 + ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  14 + engine {
  15 + enable off;
  16 + output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
  17 + }
  18 + }
  19 +}
@@ -303,7 +303,9 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S @@ -303,7 +303,9 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S
303 srs_error("invalid ingest type=%s, ret=%d", input_type.c_str(), ret); 303 srs_error("invalid ingest type=%s, ret=%d", input_type.c_str(), ret);
304 } 304 }
305 305
306 - if (!engine || !_srs_config->get_engine_enabled(engine)) { 306 + std::string vcodec = _srs_config->get_engine_vcodec(engine);
  307 + std::string acodec = _srs_config->get_engine_acodec(engine);
  308 + if (!engine || !_srs_config->get_engine_enabled(engine) || vcodec.empty() || acodec.empty()) {
307 if ((ret = ffmpeg->initialize_copy()) != ERROR_SUCCESS) { 309 if ((ret = ffmpeg->initialize_copy()) != ERROR_SUCCESS) {
308 return ret; 310 return ret;
309 } 311 }