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

fix #89, config to /dev/null to disable ffmpeg log. 0.9.117

This commit is contained in:
winlin 2014-05-27 14:10:46 +08:00
parent 14f0a2e046
commit d74921e1ab
7 changed files with 36 additions and 23 deletions

View file

@ -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);

View file

@ -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:

View file

@ -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<std::string>::iterator it;

View file

@ -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);

View file

@ -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"