·您当前的位置:首页 > 技术教程 > crtmpserver >

[crtmpserver]crtmpserver流媒体配置文件的分析

时间:2016-01-18 20:56酷播
[crtmpserver]crtmpserver流媒体配置文件的分析

主结构

configuration=
{
  daemon=false,
  pathSeparator="/",
  logAppenders=
  {
    -- content removed for clarity
  },
  applications=
  {
    -- content removed for clarity
  }
}
configuration structure
key type mandatory description
daemon boolean yes true means the server will start in daemon mode. 
false means it will start in console mode (nice for development)
true  表示 服务以后台方式启动;
false 表示 服务以控制台模式启动(以用于开发);
pathSeparator string(1) yes This value will be used by the server to compose paths (like media files paths).
Examples: on UNIX-like systems this is / while on windows is \. 
Special care must be taken when you specify this values on windows
because \ is an escape sequence for lua so the value should be “\\”
用来分隔路径; 
例如,在UNIX-like是 /, Windows是 \  ;
logAppenders object yes Will hold a collection of log appenders. Each of log messages will pass through all the log appenders enumerated here. 
More details below
配置日志追加的容器
applications object yes Will hold a collection of loaded applications.
Besides that, it will also hold few other values. More detailsbelow
配置加载各种应用的容器

When the server starts, the following sequence of operations is performed:
服务启动时,将按顺序执行下列操作:

  1. The configuration file is loaded. Part of the loading process, is the verification. 
    If something is wrong with the syntax please read this
    配置文件加载后,首先做的就是对配置文件进行校验,
    如果配置文件有错误,将会有错误提示并停止启动,可进行修改后再启动
  2. daemon value is read. The server now will either fork to become daemon 
    or continue as is in console mode
    读取 daemon 值,判断服务是以后台方式启动还是以控制台方式启动
  3. logAppenders is read. This is where all log appenders are configured and brought up to running state. 
    Depending on the collection of your log appenders, you may (not) see further log messages
    读取日志追加器,用来配置日志记录并启动到运行状态,
    依据日志追加器,可以看到更多的日志信息
  4. applications is taken into consideration. Up until now, the server doesn't do much. 
    After this stage completes, all the applications are fully functional and the server is online and ready to do stuff
    最后的应用加载,只到这一步完成后,服务和应用才在线,并准备就绪。

日志追加器
logAppenders

This section contains a list of log appenders. The entire collection of appenders listed in this section 
is loaded inside the logger at config-time. All log messages will be than passed to all this log appenders. 
Depending on the log level, an appender may (not) log the message. “Logging” a message means “saving” 
it on the specified “media” (in the example below we have a console appender and a file).
这部分包含了一个日志追加器的列表。
整个日志追加器的添加是在加载时配置,
依据日志级别,追加器可以选择是否有日志消息输出到指定目的处;
logAppenders=
{
  {
    name="console appender",
    type="coloredConsole",
    level=6
  },
  {
    name="file appender",
    type="file",
    level=6,
    fileName="/tmp/crtmpserver.log"
  }
},

http://www.cnblogs.com/zjoch/archive/2013/08/23/3277198.html

热门文章推荐

请稍候...

保利威视云平台-轻松实现点播直播视频应用

酷播云数据统计分析跨平台播放器