Files
taoyao/taoyao-signal-server/taoyao-server/src/main/resources/application.yml
2023-07-16 09:47:09 +08:00

268 lines
6.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server:
port: 8888
http2:
enabled: true
tomcat:
thread:
max: 256
min-spare: 8
remoteip:
host-header: X-Forwarded-Host
port-header: X-Forwarded-Port
protocol-header: X-Forwarded-Proto
remote-ip-header: X-Forwarded-For
# 服务前缀
# servlet:
# context-path: /taoyao
spring:
# 快速启动
# main:
# lazy-initialization: true
profiles:
active: dev
application:
name: taoyao-signal-server
servlet:
multipart:
max-file-size: 256MB
max-request-size: 256MB
task:
execution:
pool:
core-size: 8
max-size: 128
keep-alive: 60s
queue-capacity: 100000
allow-core-thread-timeout: true
shutdown:
await-termination: true
await-termination-period: 60s
thread-name-prefix: ${spring.application.name}-
scheduling:
pool:
size: 4
shutdown:
await-termination: true
await-termination-period: 60s
thread-name-prefix: ${spring.application.name}-scheduling-
taoyao:
url: https://gitee.com/acgist/taoyao
name: 桃夭信令服务
version: 1.0.0
description: 桃夭WebRTC信令服务
# 全局超时时间
timeout: 5000
# ID生成策略
id:
max-index: 999999
server-index: 0
min-client-index: 10000
max-client-index: 99999
# 媒体配置
media:
# 视频配置
# 宽度
min-width: 720
max-width: 4096
# 高度
min-height: 480
max-height: 2160
# 帧率
min-frame-rate: 15
max-frame-rate: 45
# 视频码率
min-video-bitrate: 800
max-video-bitrate: 1600
# 音频配置
# 采样位数(位深)
min-sample-size: 16
max-sample-size: 16
# 采样率
min-sample-rate: 8000
max-sample-rate: 48000
# 音频码率
min-audio-bitrate: 96
max-audio-bitrate: 256
# ABR CBR VBR
# 默认音频
audio:
format: OPUS
bitrate: 96
sample-size: 16
sample-rate: 48000
# 默认视频
video:
format: H264
bitrate: 1200
frame-rate: 24
resolution: 1920*1080
# 音频质量
audios:
# 超清
fd-audio:
format: OPUS
bitrate: 256
sample-size: 16
sample-rate: 48000
# 高清
hd-audio:
format: OPUS
bitrate: 128
sample-size: 16
sample-rate: 32000
# 标清
sd-audio:
format: OPUS
bitrate: 96
sample-size: 16
sample-rate: 16000
# 视频质量
videos:
# 4KUD=UHD=4K
ud-video:
format: H264
bitrate: 1800
frame-rate: 45
resolution: 4096*2160
# 2KQD=QHD=2K
qd-video:
format: H264
bitrate: 1600
frame-rate: 30
resolution: 2560*1440
# 超清视频FD=FHD=1080P
fd-video:
format: H264
bitrate: 1200
frame-rate: 24
resolution: 1920*1080
# 高清视频HD=720P
hd-video:
format: H264
bitrate: 1000
frame-rate: 18
resolution: 1280*720
# 标清视频SD=480P
sd-video:
format: H264
bitrate: 800
frame-rate: 15
resolution: 720*480
# FFmpeg配置
ffmpeg:
# 录像地址
host: 127.0.0.1
# 最小端口
min-port: 50000
# 最大端口
max-port: 59999
# 录像帧率
frame-rate: ${taoyao.media.video.frame-rate:24}
# 录像命令
record: ffmpeg -y -protocol_whitelist "file,rtp,udp" -thread_queue_size 1024 -c:a libopus -c:v libvpx -r:v %d -i %s -c:a aac -c:v h264 %s
# 预览命令
preview: ffmpeg -y -i %s -ss %d -vframes 1 -f image2 %s
# 时长命令
duration: ffprobe -i %s -show_entries format=duration
# 录像SDPVP8 | H264
record-sdp: |
v=0
o=- 0 0 IN IP4 127.0.0.1
s=TaoyaoRecord
t=0 0
m=audio %d RTP/AVP 100
c=IN IP4 0.0.0.0
a=rtcp:%d
a=rtpmap:100 OPUS/48000/2
a=recvonly
m=video %d RTP/AVP 101
c=IN IP4 0.0.0.0
a=rtcp:%d
a=rtpmap:101 VP8/90000
a=recvonly
# 预览时间
preview-time: 4
# 时长提取
duration-regex: .*duration\=([0-9\.]+).*
# 存储目录
storage-path: /data/taoyao/storage
# 图片存储目录
storage-image-path: /data/taoyao/storage/image
# 视频存储目录
storage-video-path: /data/taoyao/storage/video
# Socket信令
socket:
enabled: true
host: 0.0.0.0
port: 9999
encrypt: DES
encrypt-secret: 2SPWy+TF1zM=
timeout: ${taoyao.timeout}
queue-size: 100000
min-thread: 4
max-thread: 128
thread-name-prefix: ${spring.application.name}-signal-
keep-alive-time: 60000
buffer-size: 2048
max-buffer-size: 32768
# 脚本配置
script:
enabled: true
system-reboot: reboot
system-shutdown: shutdown now
platform-reboot: systemctl restart taoyao-signal-server
platform-shutdown: systemctl stop taoyao-signal-server
# WebRTC配置
webrtc:
# 是否终端加密E2E
encrypt: false
# STUN服务
stun:
- host: stun1.l.google.com
port: 19302
- host: stun2.l.google.com
port: 19302
- host: stun3.l.google.com
port: 19302
- host: stun4.l.google.com
port: 19302
# TURN服务
turn:
# - host: 192.168.1.110
# port: 3478
# username: taoyao
# password: taoyao
# - host: 192.168.8.110
# port: 3478
# username: taoyao
# password: taoyao
# 地址重写
rewrite:
enabled: true
prefix: 24
# 重写规则
rule:
# - network: 192.168.1.0
# inner-host:
# outer-host:
# - network: 192.168.8.0
# inner-host:
# outer-host:
# 安全配置
security:
enabled: true
realm: taoyao
permit:
- /
- /error
- /index.html
- /favicon.ico
username: taoyao
password: taoyao
# 定时任务
scheduled:
# 清理房间无效资源
room: 0 0/5 * * * ?
# 清理无效终端连接
client: 0 * * * * ?