diff --git a/README.md b/README.md index 6b1066614..9bc0a0ef4 100755 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v1.0, 2014-05-25, fix [#89](https://github.com/winlinvip/simple-rtmp-server/issues/89), config to /dev/null to disable ffmpeg log. 0.9.117 * v1.0, 2014-05-25, fix [#76](https://github.com/winlinvip/simple-rtmp-server/issues/76), allow edge vhost to add or remove. 0.9.114 * v1.0, 2014-05-24, Johnny contribute [ossrs.net](http://ossrs.net). karthikeyan start to translate wiki to English. * v1.0, 2014-05-22, fix [#78](https://github.com/winlinvip/simple-rtmp-server/issues/78), st joinable thread must be stop by other threads, 0.9.113 diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index cb24ec97a..43f32c5e1 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -19,6 +19,7 @@ pid ./objs/srs.pid; chunk_size 60000; # the logs dir. # if enabled ffmpeg, each stracoding stream will create a log file. +# /dev/null to disable the log. # default: ./objs ff_log_dir ./objs; # the log tank, console or file. diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 1cfdcd66f..99e7f14a7 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -2410,6 +2410,12 @@ string SrsConfig::get_log_file() return conf->arg0(); } +bool SrsConfig::get_ffmpeg_log_enabled() +{ + string log = get_ffmpeg_log_dir(); + return log != "/dev/null"; +} + string SrsConfig::get_ffmpeg_log_dir() { srs_assert(root); diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp index bdaa056f6..c655f9474 100644 --- a/trunk/src/app/srs_app_config.hpp +++ b/trunk/src/app/srs_app_config.hpp @@ -253,6 +253,7 @@ public: virtual bool get_log_tank_file(); virtual std::string get_log_level(); virtual std::string get_log_file(); + virtual bool get_ffmpeg_log_enabled(); virtual std::string get_ffmpeg_log_dir(); // hls section private: diff --git a/trunk/src/app/srs_app_encoder.cpp b/trunk/src/app/srs_app_encoder.cpp index 3c01f8ca8..63d3dcf6b 100644 --- a/trunk/src/app/srs_app_encoder.cpp +++ b/trunk/src/app/srs_app_encoder.cpp @@ -287,18 +287,20 @@ int SrsEncoder::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsRequest* req, SrsConfDir output = srs_string_replace(output, "[stream]", req->stream); output = srs_string_replace(output, "[engine]", engine->arg0()); - std::string log_file; + std::string log_file = "/dev/null"; // disabled // write ffmpeg info to log file. - log_file = _srs_config->get_ffmpeg_log_dir(); - log_file += "/"; - log_file += "ffmpeg-encoder"; - log_file += "-"; - log_file += req->vhost; - log_file += "-"; - log_file += req->app; - log_file += "-"; - log_file += req->stream; - log_file += ".log"; + if (_srs_config->get_ffmpeg_log_enabled()) { + log_file = _srs_config->get_ffmpeg_log_dir(); + log_file += "/"; + log_file += "ffmpeg-encoder"; + log_file += "-"; + log_file += req->vhost; + log_file += "-"; + log_file += req->app; + log_file += "-"; + log_file += req->stream; + log_file += ".log"; + } // important: loop check, donot transcode again. std::vector::iterator it; diff --git a/trunk/src/app/srs_app_ingest.cpp b/trunk/src/app/srs_app_ingest.cpp index d33bb3359..da56e89fa 100644 --- a/trunk/src/app/srs_app_ingest.cpp +++ b/trunk/src/app/srs_app_ingest.cpp @@ -262,18 +262,20 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S app = app.substr(0, pos); } - std::string log_file; + std::string log_file = "/dev/null"; // disabled // write ffmpeg info to log file. - log_file = _srs_config->get_ffmpeg_log_dir(); - log_file += "/"; - log_file += "ffmpeg-ingest"; - log_file += "-"; - log_file += vhost->arg0(); - log_file += "-"; - log_file += app; - log_file += "-"; - log_file += stream; - log_file += ".log"; + if (_srs_config->get_ffmpeg_log_enabled()) { + log_file = _srs_config->get_ffmpeg_log_dir(); + log_file += "/"; + log_file += "ffmpeg-ingest"; + log_file += "-"; + log_file += vhost->arg0(); + log_file += "-"; + log_file += app; + log_file += "-"; + log_file += stream; + log_file += ".log"; + } // input std::string input_type = _srs_config->get_ingest_input_type(ingest); diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 5574688b8..78e86518c 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "116" +#define VERSION_REVISION "117" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS"