From 95b83c28b25e5e037d630930f654fee8f9459e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Sat, 21 Jun 2025 09:21:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init/7.srs.sh | 2 +- init/volumes/srs/conf/srs.conf | 65 ++++++++++++++++------------------ 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/init/7.srs.sh b/init/7.srs.sh index e177c2f..0a24431 100755 --- a/init/7.srs.sh +++ b/init/7.srs.sh @@ -76,7 +76,7 @@ docker run -d \ --network $NETWORK \ --memory $SRS_MEMORY \ --restart unless-stopped \ - --env CANDIDATE=$CANDIDATE \ + --env CANDIDATE=139.224.117.253 \ -p ${SRS_RTMP_PORT}:1935 \ -p ${SRS_RTC_PORT}:8000/udp \ -p 1985:1985 \ diff --git a/init/volumes/srs/conf/srs.conf b/init/volumes/srs/conf/srs.conf index 781bd0d..9293fc5 100644 --- a/init/volumes/srs/conf/srs.conf +++ b/init/volumes/srs/conf/srs.conf @@ -1,7 +1,12 @@ listen 1935; max_connections 1000; -srs_log_tank console; daemon off; +srs_log_tank console; + +http_api { + enabled on; + listen 1985; +} http_server { enabled on; @@ -9,49 +14,41 @@ http_server { dir ./objs/nginx/html; } -rtc_server { - enabled on; - listen 8000; +srt_server { + enabled on; + listen 10080; + maxbw 1000000000; + connect_timeout 4000; + peerlatency 0; + recvlatency 0; } +rtc_server { + enabled on; + # Listen at udp://8000 + listen 8000; + # + # The $CANDIDATE means fetch from env, if not configed, use * as default. + # + # The * means retrieving server IP automatically, from all network interfaces, + # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate + candidate $CANDIDATE; +} + +# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026 vhost __defaultVhost__ { - - dvr { - enabled on; - #all表示录制所有视频流,也可以按频道录制 - #规则为/,例:live/stream1 live/stream2 - #规则为/,例:live/stream1 live/stream2 - dvr_apply all; - #dvr计划 - dvr_plan segment; - #录制的路径,详细配置规则见附录三 - dvr_path ./objs/nginx/html/record/[2006][01][02]/[app][stream]/[timestamp].flv; - #segment方式录制时间设置,单位: s - dvr_duration 900; - #开启按关键帧且flv - dvr_wait_keyframe on; - #时间戳抖动算法。full使用完全的时间戳矫正; - #zero只是保证从0开始;off不矫正时间戳。 - time_jitter full; + srt { + enabled on; } - - rtc { enabled on; - # 开启rtc录制 + # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc rtmp_to_rtc on; + # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp rtc_to_rtmp on; } - http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } - - hls { - enabled on; - hls_path ./objs/nginx/html; - hls_fragment 10; - hls_window 60; - } -} +} \ No newline at end of file