分类: Uncategorized

  • videojs of piwigo

    Install:

    Suppose that the piwigo have been installed at the dir of

    PIWIGO_DIR=/opt/local/data/www/gallery,

    wget -O piwigo-videojs.zip https://github.com/xbgmsharp/piwigo-videojs/archive/master.zip
    
    unzip piwigo-videojs.zip
    
    sudo mv    piwigo-videojs-master ${PIWIGO_DIR}/piwigo-videojs
    sudo chown ${PHP_USER}  -R       ${PIWIGO_DIR}/piwigo-videojs
    sudo chgrp ${PHP_GROUP} -R       ${PIWIGO_DIR}/piwigo-videojs

    Customize bin path

    Suppose that ffmpeg,mediainfo,exiftool,ffprobe have been installed at /opt/local/bin/

    Add the following line into the file of ${PIWIGO_DIR}/include/config_default.inc.php

    $conf['vjs_mediainfo_dir']='/opt/local/bin/';
    $conf['vjs_exiftool_dir']='/opt/local/bin/';
    $conf['vjs_ffprobe_dir']='/opt/local/bin/';
    $conf['ffmpeg_dir']='/opt/local/bin/';

    Update media info of your video

    Go to the admin page of your gallery,

    Select the album with video ,

    Edit the album,

    Manager the image of the album

    Select video file

    Launch the videos batch operation

  • Play DSD dff file within MPD daemon

    To support play DSD dff file inrealtime mode, we must add dsdiff plugin in mpd config file.

    decoder {
      plugin “ffmpeg”
      enable “yes”
    }

    decoder {
      plugin “dsdiff”
      enable “yes”
    }

    cat mpd.conf

    music_directory     “/music”
    playlist_directory “/opt/local/run/mpd/playlists”
    db_file            “/opt/local/run/mpd/database”
    log_file       “/opt/local/run/mpd/log”
    pid_file       “/opt/local/run/mpd/mpd.pid”
    state_file         “/opt/local/run/mpd/state”
    sticker_file      “/opt/local/run/mpd/sticker.sql”

    user           “root”
    group          “root”
    bind_to_address         “any”
    #bind_to_address       “localhost”
    bind_to_address         “/opt/local/run/mpd/socket”
    port           “6600”


    # default=notice
    # secure=info

    log_level      “default”
    #log_level              “secure”
    #log_level              “verbose”
    #log_level              “warning”
    #log_level              “error”



    restore_paused         “no”
    save_absolute_paths_in_playlists  “no”
    metadata_to_use  “artist,album,title,track,name,genre,date,composer,performer,disc”

    auto_update        “yes”
    auto_update_depth      “8”


    follow_outside_symlinks        “yes”
    follow_inside_symlinks      “yes”



    zeroconf_enabled       “yes”
    zeroconf_name          “Music Player @ %h”


    #password                        “password@read,add,control,admin”
    default_permissions         “read,add,control,admin”



    #database {
    #       plugin “proxy”
    #       host “other.mpd.host”
    #       port “6600”
    #}


    decoder {
      plugin “ffmpeg”
      enable “yes”
    }

    decoder {
      plugin “dsdiff”
      enable “yes”
    }


    #input {
    #        plugin “curl”
    #       proxy “proxy.isp.com:8080”
    #       proxy_user “user”
    #       proxy_password “password”
    #}


    #audio_output {
    #   type       “alsa”
    #   name       “ALSA”
    #   device     “hw:0,0”   # optional
    #   mixer_type      “hardware” # optional
    #   mixer_device   “default”  # optional
    #   mixer_control  “PCM”      # optional
    #   mixer_index “0”     # optional
    #}

    #audio_output {
    #    type                    “fifo”
    #    name                    “my_fifo”
    #    path                    “/tmp/mpd.fifo”
    #    format                  “44100:16:2”
    #}


    # creative usb card
    #audio_output {
    #        type            “alsa”
    #        name            “MP3”
    #        device          “hw:CARD=MP3,DEV=0”
    #        mixer_type      “software”      # optional
    #}


    #audio_output {
    #        type            “alsa”
    #        name            “TerraTec”
    #        device          “iec958:CARD=Device,DEV=0”
    #        mixer_type      “software”      # optional
    #}

    #audio_output {
    #        type            “alsa”
    #        name            “C-Media”
    #        device          “iec958:CARD=Set,DEV=0”
    #        mixer_type      “hardware”      # optional
    #}

    # Via Winner AD-86D amplifer
    audio_output {
            type            “alsa”
            name            “Audio”
            device          “hw:CARD=AUDIO,DEV=0”
            mixer_type      “software”    
    }



    # via Jack Daemon
    #audio_output {
    #        type “jack”
    #        name “My Jack Output”
    #        mixer_type      “software”
    #}



    #
    # An example of an OSS output:
    #
    #audio_output {
    #   type       “oss”
    #   name       “My OSS Device”
    ##  device     “/dev/dsp” # optional
    ##  mixer_type      “hardware” # optional
    ##  mixer_device   “/dev/mixer”   # optional
    ##  mixer_control  “PCM”      # optional
    #}
    #
    # An example of a shout output (for streaming to Icecast):
    #
    #audio_output {
    #   type       “shout”
    #   encoder    “vorbis”       # optional
    #   name       “My Shout Stream”
    #   host       “localhost”
    #   port       “8000”
    #   mount      “/mpd.ogg”
    #   password   “hackme”
    #   quality    “5.0”
    #   bitrate    “128”
    #   format     “44100:16:1”
    ##  protocol   “icecast2”     # optional
    ##  user       “source”       # optional
    ##  description “My Stream Description”    # optional
    ##  url     “http://example.com”   # optional
    ##  genre      “jazz”         # optional
    ##  public     “no”           # optional
    ##  timeout    “2”        # optional
    ##  mixer_type      “software”     # optional
    #}
    #
    # An example of a recorder output:
    #
    #audio_output {
    #   type       “recorder”
    #   name       “My recorder”
    #   encoder    “vorbis”       # optional, vorbis or lame
    #   path       “/opt/local/run/mpd/recorder/mpd.ogg”
    ##  quality    “5.0”          # do not define if bitrate is defined
    #   bitrate    “128”          # do not define if quality is defined
    #   format     “44100:16:1”
    #}
    #
    # An example of a httpd output (built-in HTTP streaming server):
    #
    #audio_output {
    #   type       “httpd”
    #   name       “My HTTP Stream”
    #   encoder    “vorbis”       # optional, vorbis or lame
    #   port       “8000”
    #   bind_to_address “0.0.0.0”      # optional, IPv4 or IPv6
    ##  quality    “5.0”          # do not define if bitrate is defined
    #   bitrate    “128”          # do not define if quality is defined
    #   format     “44100:16:1”
    #   max_clients “0”        # optional 0=no limit
    #}
    #
    # An example of a pulseaudio output (streaming to a remote pulseaudio server)
    #
    #audio_output {
    #   type       “pulse”
    #   name       “My Pulse Output”
    ##  server     “remote_server”    # optional
    ##  sink       “remote_server_sink”   # optional
    #}
    #
    # An example of a winmm output (Windows multimedia API).
    #
    #audio_output {
    #   type       “winmm”
    #   name       “My WinMM output”
    ##  device     “Digital Audio (S/PDIF) (High Definition Audio Device)” # optional
    #       or
    ##  device     “0”     # optional
    ##  mixer_type “hardware” # optional
    #}
    #
    # An example of an openal output.
    #
    #audio_output {
    #   type       “openal”
    #   name       “My OpenAL output”
    ##  device     “Digital Audio (S/PDIF) (High Definition Audio Device)” # optional
    #}
    #
    # An example of an sndio output.
    #
    #audio_output {
    #   type       “sndio”
    #   name       “sndio output”
    #   mixer_type “hardware”
    #}
    #
    # An example of an OS X output:
    #
    #audio_output {
    #   type       “osx”
    #   name       “My OS X Device”
    ##  device     “Built-in Output”  # optional
    ##  channel_map      “-1,-1,0,1”   # optional
    #}
    #
    ## Example “pipe” output:
    #
    #audio_output {
    #   type       “pipe”
    #   name       “my pipe”
    #   command    “aplay -f cd 2>/dev/null”
    ## Or if you’re want to use AudioCompress
    #   command    “AudioCompress -m | aplay -f cd 2>/dev/null”
    ## Or to send raw PCM stream through PCM:
    #   command    “nc example.org 8765”
    #   format     “44100:16:2”
    #}
    #
    ## An example of a null output (for no audio output):
    #
    #audio_output {
    #   type       “null”
    #   name       “My Null Output”
    #   mixer_type      “none”         # optional
    #}
    #
    ###############################################################################


    # Normalization automatic volume adjustments ##################################
    #
    # This setting specifies the type of ReplayGain to use. This setting can have
    # the argument “off”, “album”, “track” or “auto”. “auto” is a special mode that
    # chooses between “track” and “album” depending on the current state of
    # random playback. If random playback is enabled then “track” mode is used.
    # See <http://www.replaygain.org> for more details about ReplayGain.
    # This setting is off by default.
    #
    #replaygain        “album”
    #
    # This setting sets the pre-amp used for files that have ReplayGain tags. By
    # default this setting is disabled.
    #
    #replaygain_preamp     “0”
    #
    # This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
    # By default this setting is disabled.
    #
    #replaygain_missing_preamp “0”
    #
    # This setting enables or disables ReplayGain limiting.
    # MPD calculates actual amplification based on the ReplayGain tags
    # and replaygain_preamp / replaygain_missing_preamp setting.
    # If replaygain_limit is enabled MPD will never amplify audio signal
    # above its original level. If replaygain_limit is disabled such amplification
    # might occur. By default this setting is enabled.
    #
    #replaygain_limit      “yes”
    #
    # This setting enables on-the-fly normalization volume adjustment. This will
    # result in the volume of all playing audio to be adjusted so the output has
    # equal “loudness”. This setting is disabled by default.
    #
    #volume_normalization      “no”
    #
    ###############################################################################

    # Character Encoding ##########################################################
    #
    # If file or directory names do not display correctly for your locale then you
    # may need to modify this setting.
    #
    #filesystem_charset        “UTF-8”
    #
    ###############################################################################

  • Convert   SACD ISO file To DSF file

    Build Tool: sacd_extract:

    wget https://github.com/sacd-ripper/sacd-ripper/archive/refs/tags/0.3.8.tar.gz

    tar xvfz 0.3.8.tar.gz

    cd sacd-ripper-0.3.8/tools/sace_extract

    cmake .

    make

    ls sacd_extract

    sudo cp sacd_extrace /usr/local/bin

    Convert ISO

    sacd_extrace -i sacd_sample.iso -s

    chmod 777 sacd_sample

  • Creating udev rule for USB DAC

    Target:

    Create a new udev rule which will:

    Stop the Jack Daemon if DAC power off

    Start the Jack Daemon if DAC power on

    Identify USB DAC Card:

    Power on USB DAC

    Check the name of USB DAC

    ls -l /proc/asound/
    lrwxrwxrwx 1 root root 5 11月 22 17:55 AUDIO -> card2
    dr-xr-xr-x 3 root root 0 11月 16 18:43 card0
    dr-xr-xr-x 4 root root 0 11月 16 18:43 card1
    dr-xr-xr-x 4 root root 0 11月 22 17:55 card2
    -r–r–r– 1 root root 0 11月 16 16:36 cards
    -r–r–r– 1 root root 0 11月 16 18:43 devices
    lrwxrwxrwx 1 root root 5 11月 16 18:43 Generic -> card0
    -r–r–r– 1 root root 0 11月 16 18:43 hwdep
    -r–r–r– 1 root root 0 11月 16 18:43 modules
    dr-xr-xr-x 2 root root 0 11月 16 18:43 oss
    -r–r–r– 1 root root 0 11月 16 18:43 pcm

    card2 is the name of DAC Card

    ls  /sys/class/sound
    card0  card2      controlC1  hwC0D0  pcmC0D3p  pcmC1D0p  pcmC2D0p
    card1  controlC0  controlC2  hwC1D0  pcmC1D0c  pcmC2D0c  timer
    
    
    

    Get the Attr List of card2

    udevadm info /sys/class/sound/card2
    P: /devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0/sound/card2
    L: 0
    E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0/sound/card2
    E: SUBSYSTEM=sound
    E: USEC_INITIALIZED=523137960408
    E: ID_PATH=pci-0000:00:12.0-usb-0:4:1.0
    E: ID_PATH_TAG=pci-0000_00_12_0-usb-0_4_1_0
    E: ID_FOR_SEAT=sound-pci-0000_00_12_0-usb-0_4_1_0
    E: SOUND_INITIALIZED=1
    E: ID_VENDOR_FROM_DATABASE=Actions Semiconductor Co., Ltd
    E: ID_VENDOR=ACTIONS
    E: ID_VENDOR_ENC=ACTIONS
    E: ID_VENDOR_ID=10d6
    E: ID_MODEL=USB_AUDIO
    E: ID_MODEL_ENC=USB\x20AUDIO
    E: ID_MODEL_ID=dd01
    E: ID_REVISION=0100
    E: ID_SERIAL=ACTIONS_USB_AUDIO_4512482ADF0FEEEE
    E: ID_SERIAL_SHORT=4512482ADF0FEEEE
    E: ID_TYPE=audio
    E: ID_BUS=usb
    E: ID_USB_INTERFACES=:010100:010200:030000:
    E: ID_USB_INTERFACE_NUM=00
    E: ID_USB_DRIVER=snd-usb-audio
    E: ID_ID=usb-ACTIONS_USB_AUDIO_4512482ADF0FEEEE-00
    E: SYSTEMD_WANTS=sound.target
    E: TAGS=:systemd:seat:
    
    udevadm info --path=/sys/class/sound/card2 --attribute-walk
    
    looking at device '/devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0/sound/card2':
        KERNEL=="card2"
        SUBSYSTEM=="sound"
        DRIVER==""
        ATTR{number}=="2"
        ATTR{id}=="AUDIO"
    
      looking at parent device '/devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0':
        KERNELS=="2-4:1.0"
        SUBSYSTEMS=="usb"
        DRIVERS=="snd-usb-audio"
        ATTRS{supports_autosuspend}=="1"
        ATTRS{bInterfaceProtocol}=="00"
        ATTRS{authorized}=="1"
        ATTRS{bNumEndpoints}=="00"
        ATTRS{bInterfaceClass}=="01"
        ATTRS{bInterfaceNumber}=="00"
        ATTRS{bInterfaceSubClass}=="01"
        ATTRS{bAlternateSetting}==" 0"
    
      looking at parent device '/devices/pci0000:00/0000:00:12.0/usb2/2-4':
        KERNELS=="2-4"
        SUBSYSTEMS=="usb"
        DRIVERS=="usb"
        ATTRS{devpath}=="4"
        ATTRS{bDeviceProtocol}=="00"
        ATTRS{bmAttributes}=="c0"
        ATTRS{quirks}=="0x0"
        ATTRS{tx_lanes}=="1"
        ATTRS{product}=="USB AUDIO"
        ATTRS{busnum}=="2"
        ATTRS{bcdDevice}=="0100"
        ATTRS{bNumConfigurations}=="1"
        ATTRS{manufacturer}=="ACTIONS"
        ATTRS{bNumInterfaces}==" 4"
        ATTRS{bDeviceClass}=="00"
        ATTRS{configuration}==""
        ATTRS{maxchild}=="0"
        ATTRS{devnum}=="20"
        ATTRS{serial}=="4512482ADF0FEEEE"
        ATTRS{bMaxPower}=="300mA"
        ATTRS{idVendor}=="10d6"
        ATTRS{bDeviceSubClass}=="00"
        ATTRS{urbnum}=="25748"
        ATTRS{idProduct}=="dd01"
        ATTRS{version}==" 1.00"
        ATTRS{removable}=="unknown"
        ATTRS{authorized}=="1"
        ATTRS{bMaxPacketSize0}=="64"
        ATTRS{speed}=="12"
        ATTRS{rx_lanes}=="1"
        ATTRS{lATTRS{avoid_reset_quirk}=="0"
        ATTRS{bConfigurationValue}=="1"
    
      looking at parent device '/devices/pci0000:00/0000:00:12.0/usb2':
        KERNELS=="usb2"
        SUBSYSTEMS=="usb"DRIVERS=="usb"
        ATTRS{configuration}==""
        ATTRS{idProduct}=="0001"
        ATTRS{version}==" 1.10"
        ATTRS{tx_lanes}=="1"
        ATTRS{bNumInterfaces}==" 1"
        ATTRS{bDeviceClass}=="09"
        ATTRS{removable}=="unknown"
        ATTRS{authorized_default}=="1"
        ATTRS{bDeviceSubClass}=="00"
        ATTRS{interface_authorized_default}=="1"
        ATTRS{busnum}=="2"
        ATTRS{bDeviceProtocol}=="00"
        ATTRS{bMaxPower}=="0mA"
        ATTRS{quirks}=="0x0"
        ATTRS{speed}=="12"
        ATTRS{bcdDevice}=="0419"
        ATTRS{maxchild}=="5"
        ATTRS{idVendor}=="1d6b"
        ATTRS{devpath}=="0"
        ATTRS{manufacturer}=="Linux 4.19.0-9-amd64 ohci_hcd"
        ATTRS{avoid_reset_quirk}=="0"
        ATTRS{bMaxPacketSize0}=="64"
        ATTRS{rx_lanes}=="1"
        ATTRS{bmAttributes}=="e0"
        ATTRS{urbnum}=="511"
        ATTRS{bNumConfigurations}=="1"
        ATTRS{product}=="OHCI PCI host controller"
        ATTRS{serial}=="0000:00:12.0"
        ATTRS{bConfigurationValue}=="1"
        ATTRS{ltm_capable}=="no"
        ATTRS{devnum}=="1"
        ATTRS{authorized}=="1"
    
        
    
    # Get kernel prop
    udevadm monitor --kernel --property --subsystem-match=usb
    monitor will print the received events for:
    KERNEL - the kernel uevent
    
    KERNEL[1083.319560] add      /devices/pci0000:00/0000:00:12.0/usb2/2-4 (usb)
    ACTION=add
    DEVPATH=/devices/pci0000:00/0000:00:12.0/usb2/2-4
    SUBSYSTEM=usb
    DEVNAME=/dev/bus/usb/002/002
    DEVTYPE=usb_device
    PRODUCT=10d6/dd01/100
    TYPE=0/0/0
    BUSNUM=002
    DEVNUM=002
    SEQNUM=2112
    MAJOR=189
    MINOR=129

    Write your udev rule based on selected attrs

    cat /opt/local/libexec/udev/rules.d/99-AD-86d.rules

    ACTION=="add",SUBSYSTEM=="sound",ATTR{id}=="AUDIO",RUN+="/opt/local/bin/add_ad_86d.sh"
    ACTION=="remove",SUBSYSTEM=="usb",ATTRS{idVendor}=="10d6",ATTRS{idProduct}=="dd01",RUN+="/opt/local/bin/remove_ad_86d.sh"
  • BLAKE2 — fast secure hashing

    https://github.com/BLAKE2

    https://blake2.net/

    Including 4 variant:

    BLAKE2b:     64bit CPU,  Single Code

    BLAKE2s:     32bit CPU,  Single Code

    BLAKE2bp:   64bit CPU,  Multi Code

    BLAKE2sp:   32bit CPU,  Multi Code

  • 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的服务的协议

  • Gmail SMTP Port

    1. SMTP 中继服务 – 用于通过验证 IP 地址,进而从您的单位发送邮件。您可以向网域内外的任何人发送邮件。
    2. Gmail SMTP 服务器 – 需要验证您的 Gmail/G Suite 帐户和密码。可向网域内外的任何人发送邮件。
    3. 受限 Gmail SMTP 服务器 – 无需进行身份验证。您只能向 Gmail 或 G Suite 用户发送邮件。

    以下表格可帮助您确定哪个选项最贴近您的需求:

    选项 G Suite SMTP 中继(推荐) Gmail SMTP 服务器 受限 Gmail SMTP 服务器
    SMTP 服务的完全限定域名 smtp-relay.gmail.com smtp.gmail.com aspmx.l.google.com
    配置要求 端口:25、465 或 587
    可选 SSL/TLS。
    需要一个或多个静态 IP 地址。
    端口:465(需要 SSL
    端口:587(需要 TLS)
    允许动态 IP
    端口:25
    无需 TLS
    允许动态 IP
    只能向 Gmail 或 G Suite 用户发送邮件
    yaoqiu身份验证 IP 地址提供身份验证。 需要验证您的完整 Gmail 或 G Suite 电子邮件地址 不需要。
    绕过反垃圾邮件 不。可疑的电子邮件可能被过滤。 不。可疑的电子邮件可能被过滤。 不。可疑的电子邮件可能被过滤。
    发送限制 针对已注册的 G Suite 用户的限制。
    已注册的用户每天最多能够向 10,000 名收件人中继邮件。
    要了解完整的 SMTP 中继限制,请参阅 SMTP 中继服务的发送限制
    2000 封邮件/每天。有关详情,请参阅发送限制 将根据每个用户的接收限制。