分类: Streaming

  • Navidrome support SACD

    Navidrome dosen’t support DSF/DFF decoding natively,

    but it can be achieved via ffmpeg transcoding on the fly.

    1 Enable transcoding in server side config file navidrome.toml:

    FFmpegPath=”/opt/local/bin/ffmpeg”

    EnableTranscodingConfig=”true”

    2 Add flac transcode rule in Navidrome client (web browser):

    3 Select flac transcode in Tempo (Android client)

  • Increasing the amount of inotify watchers for debian

    sudo cat /proc/sys/fs/inotify/max_user_watches

    sudo sh -c “echo fs.inotify.max_user_watches=524288 >> /etc/sysctl.conf”

    sudo sysctl -p

    sudo cat /proc/sys/fs/inotify/max_user_watches

  • myMPD Local Playback

    Add a httpd audio output in mpd.conf, refer to https://jcorporation.github.io/myMPD/references/local-playback

    # myMPD local playback
    audio_output {
        type        "httpd"
        name        "HTTP Stream"
        encoder     "vorbis"
        port        "8000"
        quality     "10.0"
        format      "44100:16:1"
        always_on   "yes"
        tags        "yes"
    }

    Enable Local playback in mympd menu:

    Settings/Features/Local playback/Enable

    Launch browser, play the selected music by both:

    play button: control the mpd play

    local button: link to the httpd output

    Test Environment:

    mpd: v0.23.15

    mympd: v14.1.1

    server os: Ubuntu 18.04.1

    client os: Android 13

    client browse: chrome/firefox

  • Live Streaming with Android Handset

    Create your own streaming server with nginx

    FWD: CamOn Living Streaming

    Note: Have been verified on Redmi-6/MiUi 14, and openresty + RTMP Module + Linux

    We saw how to setup a streaming server with MistServer in this post, let’s see how to do the same with nginx.

    nginx, pronounced “engine X“, is a web server that can also be used as a reverse proxy, load balancer, mail proxy, HTTP cache and, why not, RTMP server. It is free and open-source software, released under the terms of the 2-clause BSD license.

    For the purpose of this trial, we will see how to install and configure the server on a Raspberry Pi board running Raspberry Pi OS Lite.


    Install nginx with RTMP support

    First, we must install the server and an add-on module that will allow it to handle the RTMP protocol. sudo apt install nginxsudo apt install libnginx-mod-rtmp

    After the installation is complete, we should be able to reach the welcome page simply by entering the IP address of the server in our favorite browser, http://192.168.1.18/ for us.


    Configure the RTMP server

    The way nginx and its modules work is determined in the configuration file. By default, the configuration file is named nginx.conf and placed in the directory /etc/nginx. For details, please check out the Beginner’s Guide and other resources available in the nginx documentation.

    To enable the RTMP protocol, edit the configuration file sudo nano /etc/nginx/nginx.conf

    then add these few lines at the very end # protocol imap; # proxy on; # } #}
    rtmp { server { listen 1935; application live { live on;
    hls on; hls_path /tmp/hls; } } }

    finally save the file and restart the server so that the new configuration will be loaded sudo nginx -s reload

    In this example, we are configuring the RTMP server to listen on the port 1935 (the default RTMP port), and to handle an application named live. This application has the live mode (one-to-many broadcasting) enabled. The HLS output is also enabled, the playlist and the fragments will be saved in /tmp/hls (if the directory does not exist it will be created).

    The complete reference about the available RTMP directives can be found here.


    Configure the HTTP server

    We need to configure the HTTP server so that it can access the files in /tmp/hls for clients to play HLS. nginx uses the so called Server Blocks to serve multiple sites in parallel, let’s change the configuration of the default one sudo nano /etc/nginx/sites-enabled/default

    by adding a new location entry according to the documentation location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location /hls { types { application/vnd.apple.mpegurl m3u8; } root /tmp; add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; } # pass PHP scripts to FastCGI server #

    then save the file and restart the server once again sudo nginx -s reload


    Configure the app

    From CamON Live Streaming app settings, enable the Live streaming adapter and configure it

    • in he Server field, specify the RTMP URL for the application we configured, rtmp://192.168.1.18/live in this example
    • in the Stream field enter a streaming key of your choice, let’s use spynet

    TIP: the streaming key will be used by nginx as the base name for the HLS files

    To start the stream use the arrow icon in the bottom-right corner of the main screen. By tapping on it a countdown will be shown, at the end of which the device will connect to nginx.

    TIP: during the countdown, tap on the arrow again if you wish to abort


    Let’s see it in action

    To verify that everything is working as expected, we can use VLC as the client to see the nginx broadcast.

    It is possible to see the HLS output using the URL http://192.168.1.18/hls/spynet.m3u8, where hls is the location we configured for the HTTP server to find the files and spynet is the streaming key we have chosen.

    It is also possible to see the RTMP output using the URL rtmp://192.168.1.18/live/spynet, where live is the name of the application we configured and spynet is the streaming key.


    Embed the player

    For a better user experience, we may want to embed the player in our web page, This way the broadcast will be available with no extra effort. As the player, Video.js is a good choice to see the HLS broadcast.

    Let’s create our index.html page in /var/www/html sudo nano /var/www/html/index.html

    with the following HTML code

    TIP: the key point is to set the correct source, src=”/hls/spynet.m3u8″, as described above

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32<!DOCTYPE html> <html lang=”en”> <head> <link href=”https://vjs.zencdn.net/7.17.0/video-js.css” rel=”stylesheet” /> <!– If you’d like to support IE8 (for Video.js versions prior to v7) –> <script src=”https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js”></script> </head> <body> <h1>My nginx streaming server</h1> <video id=”my-video” class=”video-js” controls preload=”auto” width=”640″ height=”360″ data-setup=”{}” > <source src=”/hls/spynet.m3u8″ type=”application/vnd.apple.mpegurl m3u8″ /> <p class=”vjs-no-js”> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href=”https://videojs.com/html5-video-support/” target=”_blank”> supports HTML5 video </a> </p> </video> <script src=”https://vjs.zencdn.net/7.17.0/video.js”></script> </body> </html>

    After the file has been saved (no need to restart the server), by navigating to address of the server, http://192.168.1.18/, we can see the new homepage in action


    Some small tweaks

    Since we are planning to broadcast our video over the Internet, we should make the server publicly reachable. To keep it simple, we should consider setting up port forwarding and the Dynamic DNS as described in this post.

    In summary, if the router supports the UPnP protocol, we can use the command line utility upnpc to forward the HTTP port directly from the server. If not, we can manually configure the router. sudo apt install miniupnpcupnpc -a server_ipserver_portexternal_port tcpupnpc -a 192.168.1.18 80 8282 tcp

    This way the server will be reachable from anywhere at http://public_ip_address:8282/ or http://myserver.dyndns.org:8282/.

    As discussed, HLS is continuously writes files to disk while updating the playlist and the fragments. This consumes resources and can dramatically reduce the life of the SD card used by the server as storage. A better solution is to use a ramdisk to temporary store those files.

    Examine the available memory to find out how much we can use. free -h

    Examine the typical HLS disk usage to find out how much memory we expect to need. sudo du -sh /tmp/hls/

    Create a folder where to mount the ramdisk. sudo mkdir -p /mnt/ramdisk

    Add an entry to fstab to configure the ramdisk (50M is enough for this example). sudo nano /etc/fstabproc /proc proc defaults 0 0 PARTUUID=4b551375-01 /boot vfat defaults 0 2 PARTUUID=4b551375-02 / ext4 defaults,noatime 0 1 tmpfs /mnt/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=50M 0 0

    Reboot the server. sudo reboot

    Verify that the ramdisk was mounted. sudo df -hFilesystem Size Used Avail Use% Mounted on /dev/root 3.4G 1.7G 1.6G 52% / devtmpfs 87M 0 87M 0% /dev tmpfs 215M 0 215M 0% /dev/shm tmpfs 86M 632K 86M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 50M 0 50M 0% /mnt/ramdisk /dev/mmcblk0p1 253M 49M 204M 20% /boot tmpfs 43M 0 43M 0% /run/user/1000

    Change the nginx configuration so that HLS files will be saved in /mnt/ramdisk/hls instead of in /tmp/hls. sudo nano /etc/nginx/nginx.confrtmp { server { listen 1935; application live { live on; hls on; hls_path /mnt/ramdisk/hls; } } }

    Change the nginx configuration so that the HTTP server will know where to find the HLS files. sudo nano /etc/nginx/sites-enabled/default location /hls { types { application/vnd.apple.mpegurl m3u8; } root /mnt/ramdisk; add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; }

    Restart the server. sudo nginx -s reload

    Verify that the ramdisk is now used. sudo df -hFilesystem Size Used Avail Use% Mounted on /dev/root 3.4G 1.7G 1.6G 52% / devtmpfs 87M 0 87M 0% /dev tmpfs 215M 0 215M 0% /dev/shm tmpfs 86M 632K 86M 1% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 50M 12M 39M 24% /mnt/ramdisk /dev/mmcblk0p1 253M 49M 204M 20% /boot tmpfs 43M 0 43M 0% /run/user/1000

    Your server should now run much smoother!

  • Setup Home WiFi Audio System

    Build home MPD wifi audio system, by combine:

    • Active Speaker
    • Wifi Router with usb port, and support openwrt
    • USB sound card

    Upgrade openwrt to the latest version

    SSH log into openwrt

    ######################################
    ######### Repository #################
    
    cp /etc/opkg/distfeeds.conf  /etc/opkg/distfeeds.conf.bak
    sed -i "s#downloads.openwrt.org#mirrors.ustc.edu.cn/openwrt#g" /etc/opkg/distfeeds.conf
    #sed -i "s#downloads.openwrt.org#mirrors.tuna.tsinghua.edu.cn/openwrt#g" /etc/opkg/distfeeds.conf
    #sed -i "s#downloads.openwrt.org#mirrors.aliyun.com/openwrt#g" /etc/opkg/distfeeds.conf
    #sed -i "s#downloads.openwrt.org#mirrors.cloud.tencent.com/openwrt#g" /etc/opkg/distfeeds.conf
    
    opkg update
    
    
    ######################################
    ########## pulseaudio ################
    
    opkg install kmod-input-core
    opkg install kmod-sound-core
    opkg install kmod-usb-audio
    opkg install pulseaudio-daemon
    
    
    #########################################
    ########## Sound Blaster ################
    # opkg install kmod-ac97
    # opkg install kmod-sound-ens1371
    
    
    ########## AC 97 ########################
    #opkg install kmod-sound-cs5535audio 
    
    
    ####### Motherboard Sound Card ##########
    #opkg install  kmod-sound-i8x0
    
    ############ Soc Sound Card #############
    #opkg install  kmod-sound-soc-core 
    
    
    
    ##### Editor ############################ 
    # opkg install nano
    
    
    ###########  Utility  ###################
    #opkg install usbutils
    #opkg install alsa-utils
    
    
    ### Allow module load ###
    sed -i "s/--disallow-module-loading//"   /etc/init.d/pulseaudio
    
    ### Load TCP module ###
    sed -i "s/load-module module-native-protocol-unix/load-module module-native-protocol-tcp auth-anonymous=1/"  /etc/pulse/system.pa
    
    
    
    
    
    ### Firewall ###
    sh -c " cat >/etc/config/firewall " << EOF
    
    
    ######  ssh port ##################
    config redirect
           option src              wan
           option src_dport        22
           option dest             lan
           option dest_ip          192.168.1.1
           option dest_port        22
           option proto            tcp
    
    ###### pulseaudio port ############
    config redirect
           option src              wan
           option src_dport        4713
           option dest             lan
           option dest_ip          192.168.1.1
           option dest_port        4713
           option proto            tcp
    
    ###### Http Port ##################
    onfig redirect
            option src 'wan'
            option src_dport '80'
            option dest 'lan'
            option dest_ip '192.168.1.1'
            option dest_port '80'
            option proto 'tcp'
    
    EOF
    
    
    
    /etc/init.d/firewall   restart
    /etc/init.d/pulseaudio restart
    
    
    
    
    ######################################
    ######################################
    ########## WiFI Relay ################
    opkg install relayd
    opkg install luci-proto-relay
    
    
    # From web admin portal, setup new wireless wan port for 5G and 2G separately:
    # http://192.168.1.1/cgi-bin/luci/
    ### Network
    ### Wireless
    ### Scan
    ### Selected your existed SSID, Joining Network
    ### ## Replace wireless configuration  = yes
    ### ## Create / Assign firewall-zone   = LAN
    ### Go to Network/Interface
    ### Set the IP of  wireless wan, as normal

    Login into your MPD system, add the following block into the the mpd.conf file:

    audio_output {
    
     type "pulse"
    
     name " Wifi Router"
    
     server "IP_OF_WIFI_ROUTER:4713" 
    
    }

    Now, you can find the “Wifi Router” option item, from Outputs/Server properties/M.A.L.P, suppose M.A.L.P apk installed android handset

  • Web audio codec guide

    https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs

    Type

    audio/ogg

    codecs= FLAC

    codecs= Opus

    codecs= Vorbis

    audio/mp4

    codecs= AAC

    codecs= FLAC

    codecs= mp3

    codecs= Opus

    codecs= ALAC

    audio/wave

    audio/wav

    audio/x-wav

    audio/x-pn-wav

    audio/mp3

    audio/mpeg

    audio/webm

    codecs= Opus

    codecs= Vorbis

    audio/3gpp

    audio/3gpp2

    audio/aac

    audio/flac

    audio/x-flac

    Ogg/opus is great for music over internet:

    High quality, Simple software implementation, and Free.

    but not support by iPad/iPhone

    Mp4/AAC LC is the best selection for music over internet for Apple mobile product.

    In LAN, we can select Loseloss codec:

    Android: Ogg/FLAC

    iPad/iPhone: Mp4/ALAC

  • crtmpserver配置文件详解

    http://www.cnblogs.com/zjoch/p/3277198.html

     

     

    crtmpserver配置文件详解

     

    Configuration file

    配置文件

     

    The configuration file is actually a lua script which must contain an

    object called configuration.

    This will be read by the server and used to fully configure the server.

    Besides this object called

    configuration you can have functions, include other lua libraries, etc.

    In the end, you have to

    make the configuration object available. The rest of this section will

    explain the structue of

    configuration object in great detail. But first, let’s take an bird-eye

    view.

     

    配置文件实际上是一个Lua脚本,它包含至少一个configuration的对象,

    从而为程序提供灵活的扩展和定制功能。

    除了configuration对象外,还可以有函数,Lua库等。

     

     

    Main structure

    主结构

     

    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

    配置日志追加的容器 <http://wiki.rtmpd.com/documentation#logappenders>

    applications   object yes     Will hold a collection of loaded applications.

    Besides that, it will also hold few other values. More detailsbelow

    配置加载各种应用的容器 <http://wiki.rtmpd.com/documentation#applications>

     

    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

    配置文件加载后,首先做的就是对配置文件进行校验,

    如果配置文件有错误,将会有错误提示并停止启动,可进行修改后再启动

    <http://wiki.rtmpd.com/faq#qi_run_server_but_it_silently_shutdown_what_is_wrong>

    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”

    }

    },

     

     

    logAppenders structure

    key type    mandatory  description

    name    string yes     The name of the appender. Is usually used inside

    pretty print routines

    追加器的名字.

    type    string yes     The type of the appender. It can

    be console, coloredConsole or file. console and

    coloredConsole will output to console. The difference between them is

    that coloredConsole

    will also apply a color to the message, depending on the log level.

    Quite useful when eye-balling the console.

    file log appender will output everything on the specified file

    追加器的类型

    可以是控制台,带颜色控制台或文件;

    控制台和带颜色控制台 都会将日志消息输出到控制台,

    不同之处在于带颜色控制台会依据日志级别进行颜色标记;

    文件类型则会将所有消息输出到指定的文件;

    level   number yes     The log level used. The values are presented just

    below. Any message having having a log level

    less or equal to this value will be logged. The rest are discarded.

    Example: setting level to 0, will only log FATAL errors.

    Setting it to 3, will only log FATAL, ERROR, WARNING and INFO

     

     

    日志的级别

    可见下表中的级别定义;

    只有小于或等于这个级别的日志消息会被记录,高于这个级别则都被丢弃;

    例如:

    级别为0时,只记录 FATAL 消息;

    级别为3时,只记录 FATAL, ERROR, WARNING, INFO 消息;

    fileName   string yes     If the type of appender is a file, this will

    contain the path of the file

    如果追加器类型为文件,则在此处指定日志文件和路径

     

    Log levels

    Name    Value

    0   FATAL

    1   ERROR

    2   WARNING

    3   INFO

    4   DEBUG

    5   FINE

    6   FINEST

     

    Observation: When daemon mode is set to true, all console appenders will

    be ignored.

    (Read the explanation for daemon setting here

    <http://wiki.rtmpd.com/documentation#main_structure>)

    注意:

    当使用后台模式时,所有的控制台追加消息将会被忽略。

     

     

     

    应用

    Applications

     

    This section is where all the applications inside the server are placed.

    It holds the attributes of each application that the server will use to

    launch them.

    Each application may have specific attributes that it requires to

    execute its own functionality.

    这部分用来配置各种应用,并设置这些应用的属性;

    每个应用的属性都对应了这个应用的指定功能;

    applications=

    {

    rootDirectory=”applications”,

    {

    — settings for application 1

    — content removed for clarity

    },

    {

    — settings for application 2

    — content removed for clarity

    },

    {

    — settings for application 3

    — content removed for clarity

    }

    }

     

     

    Applications Structure

    key type    mandatory  description

    rootDirectory string true    The folder containing applications

    subfolders. If this path begins with a / or \ (depending on the OS),

    than is treated as an absolute path. Otherwise is treated as a path

    relative to the run-time directory

    (the place where you started the server)

    这个目录包含了应用的子目录;

    如果路径以 / 或 \ 开始, 则视其为绝对路径,否则视为启动服务时所在的相对

    路径;

     

    Following the rootDirectory, there is a collection of applications. Each

    application has

    its properties contained in an object. See details below

    rootDirectory 之后,是应用的集合;每个应用都定义了一个有特定属性的对象;

    细节如下所示; <http://wiki.rtmpd.com/documentation#application_definition>

     

     

     

    应用定义

    Application Definition

     

    This is where the settings of an application are defined. We will

    present only the

    settings common to all applications. Later on, we will also explain the

    settings particular to certain

    applications Since revision 790 there is a new cool feature:

    mediaStorage; with this feature

    basicaly an application may have multiple mediaFolder’s and .seek/.meta

    files are now stored into

    separate folder from media file that are streamed.

    这些目录用来定义应用.

    自从790版本后,添加了一新的功能:mediaStorage;

    这个功能能使应用可以有多个mediaFolder,

    并且可以将.seek/.meta文件和媒体文件分开存储在不同的文件夹中;

     

     

    {

    name=”flvplayback”,

    protocol=”dynamiclinklibrary”,

    description=”FLV Playback Sample”,

    default=false,

    validateHandshake=true,

    enableCheckBandwidth=true,

    — this settings are now part of mediaStorage setting

    — keyframeSeek=true,

    — seekGranularity=1.5,

    — clientSideBuffer=12,

    — generateMetaFiles=true,

    — renameBadFiles=true,

    aliases=

    {

    “simpleLive”,

    “vod”,

    “live”,

    “WeeklyQuest”,

    “SOSample”,

    “oflaDemo”,

    “chat”,

    },

    acceptors =

    {

    {

    — acceptor 1

    — content removed for clarity

    },

    {

    — acceptor 2

    — content removed for clarity

    },

    {

    — acceptor n

    — content removed for clarity

    },

    },

    — new feature mediaStorage

    mediaStorage = {

    namedStorage1={

    description=”Main storage”,

    mediaFolder=”/usr/main_storage/media”, — only this parameter IS

    MANDATORY

    metaFolder=”/usr/main_storage/metadata”, — if you have static

    large file to stream it is good to know that for a file around 500MB

    — it’s .seek file has

    around 16MB; so it would be preffer to designate metafolder into a system

    — partition which has

    enough space… for no surprises… 🙂

    statsFolder=”/usr/main_storage/statsFolder”,

    enableStats=true,

    clientSideBuffer=16,

    keyframeSeek=false, — should crtmpdserver DO SEEK ONLY IN

    key-frame (true/false)?

    — very useful to know in situations like

    play/pause/resume (meaning pause/seek/play)

    seekGranularity=1,

    generateMetaFiles=false,

    renameBadFiles=false,

    },

    –[[{

    — here is another example of storage; it does not start with

    name={…}

    description=”Second storage of same application”,

    mediaFolder=”/usr/second_storage/media/flv”,

    metaFolder=”/usr/second_storage/metadata”,

    statsFolder=”/usr/second_storage/statsFolder”,

    },]]–

    },

    externalStreams =

    {

    {

    — stream 1

    — content removed for clarity

    },

    {

    — stream 2

    — content removed for clarity

    },

    {

    — stream n

    — content removed for clarity

    },

    },

    authentication=

    {

    — content removed for clarity

    }

    }

     

     

     

     

     

    Application Structure

    key type    mandatory  description

    name    string yes     Name of application.

     

    应用的名称

    protocol   string yes     Type of application. The

    value dynamiclinklibrary means the application is a shared library.

    应用的类型

    值为 dynamiclinklibrary 意即 应用是一个共享库

    description    string no You can put a description of the application here.

    应用的描述信息

    default    boolean    no This flag designates the default application.

    The default application is responsible in analyzing the connectrequest

    and distribute the future connection to the correct application.

    这个标志指定了默认应用;

    默认应用负责分析连接请求并将连接分配到正确的应用

    validateHandshake boolean    no Tells the server to validate the

    client’s handshake before going further.

    This is optional with a default value of true. If this is true and the

    handshake fails,

    the connection is dropped. If this is false, handshake validation will

    not be enforced

    and all the connections are accepted no matter if they are correctly

    hand shaking or not.

    通知服务器在进行下一步前要对客户端的握手进行验证;

    这是一个可选项,其默认值为真。

    如果这个值为真 且 握手失败,服务器就放弃这个连接。

    如果这个值为假,则不会进行强制的握手验证,所有的连接都会被接受;

    keyframeSeek   boolean    no This instructs the streamer to seek only on

    key frames. In case of live streaming, this is discarded.

    这个属性指定了流生成器只在关键帧搜索,

    如果是直播流,则忽略这个值

    seekGranularity    double no The seek resolution/granularity value in

    seconds. Values are between 0.1 and 600.

    For example, if granularity is 10 seconds, and a seek to t=2:34 is

    desired, the seek

    will actually go to t=2:30.

    60seconds is recommended for full length movies and 1 second for video

    clips.

    搜索的精细度,以秒为单位, 值域定义在 0.1 ~ 600;

    例如:

    如果粒度定义为10秒,并期望定位到 t= 2:34;

    则实际上是会定位到 t= 2:30.

    60秒被认定为完整的电影长度,1秒为电影片断;

    clientSideBuffer   double no The amount of client side buffer that will

    be maintained for each connection.

    Values are between 5 and30 seconds.

    每个连接在客户端的缓冲秒数,值定义在5 ~ 30 秒;

    generateMetaFiles boolean    no This will generate seek/meta files on

    application startup.

    在应用启动前生成 seek/meta文件

    renameBadFiles boolean    no If this flag is true and the media file

    can’t be parsed, the media file will be renamed to *.bad.

    Otherwise it will be left alone.

    如果这上值为真且媒体文件是不能被解析的,则媒体文件被重命名为 *.bad,

    否则这样的文件将不做处理

    aliases    object no The application will also be known by this name.

    应用的别名

    acceptors object no Acceptors hold the service that will be hosted to

    the server. An application can have its own acceptor,

    but this is not entirely required, and can be optional.

    接受器保持这个服务并让服务器托管;

    应用可以有它自己的接受器,但这个是可选的;

    externalStreams    object no

    authentication object no

    mediaFolder    string yes     When define mediaStorage this field is

    mandatory as it points out physical location of media files.

    当定义了 mediaStorage时,这个域用来指定媒体文件的物理位置;

    metaFolder string no It holds the location where .seek/.meta files

    created from files inside mediaFolder are stored.

    指定用来存放 .seek/.meta文件的位置;

    statsFolder    string no Location for stats files.

    服状态文件的位置

     

    Acceptor Structure

    key type    mandatory  description

    ip string yes     The IP where the service is located. 0.0.0.0 means all

    interfaces and all IPs.

    服务所在的IP, 0.0.0.0表示所有接口和所有IP;

    port    string yes     Port number that the service will listen to.

    服务监听的端口号

    protocol   string yes     The protocol stack handled by

    the ip:port combination.

    对应 ip:port的服务的协议

  • VMware Storage Best Practices

    Patrick Carmichael   – Escalation Engineer, Global Support Services.