Jelajahi Sumber

fix(stream): update push scripts with correct RTSP URLs and unified ffmpeg params

- push_stream_anpviz.sh: Use correct RTSP path /Streaming/Channels/101
- push_stream_ct-ip500.sh: Use Dahua-style path /cam/realmonitor?channel=1&subtype=0
- push_stream_svbc.sh: Add Bearer token, remove -vf scale (let ffmpeg handle)
- Unified ffmpeg parameters across all scripts (WHIP protocol)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
yb 1 Minggu lalu
induk
melakukan
d61ef32137

+ 7 - 11
go_stream/push_stream_anpviz.sh

@@ -1,15 +1,12 @@
 #!/bin/bash
 
-# SVBC 摄像头 (SD10POE-5MP) 推流到 Cloudflare Stream
-# 摄像头 IP: 192.168.0.246
-# 默认账号: admin/admin
-# 默认端口: 554
-# 默认通道: 1
-# 默认流媒体服务器: rtsp://admin:admin@192.168.0.246:554/1
-# 默认推流地址: https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278b188b443e8a6c5503kb51e49994b6fd9e56b6f1fdfcd339fe6/webRTC/publish
-# 默认推流密钥: ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-
+# ANPVIZ 摄像头推流到 Cloudflare Stream (WHIP 协议)
+# 摄像头 IP: 192.168.0.96
+# 账号: admin / 123456
+# 编码: H.265 (需要转码为 H.264)
+# RTSP 路径: /Streaming/Channels/101
 
-RTSP_URL="rtsp://admin:admin@192.168.0.246:554/1"
+RTSP_URL="rtsp://admin:123456@192.168.0.96:554/Streaming/Channels/101"
 WHIP_URL="https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278b188b443e8a6c5503kb51e49994b6fd9e56b6f1fdfcd339fe6/webRTC/publish"
 BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
 
@@ -17,7 +14,6 @@ BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
     -rtsp_transport tcp \
     -i "$RTSP_URL" \
     -map 0:v:0 -map "0:a?" \
-    -vf "scale=1280:960" \
     -c:v libx264 \
     -preset veryfast \
     -tune zerolatency \
@@ -26,6 +22,6 @@ BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
     -pix_fmt yuv420p \
     -g 30 -keyint_min 30 \
     -b:v 2500k -maxrate 2500k -bufsize 5000k \
-    -c:a opus -ac 2 -strict -2 -ar 48000 -b:a 128k \
+    -c:a opus -strict -2 -ar 48000 -b:a 128k \
     -f whip "$WHIP_URL" \
     -headers "Authorization: Bearer $BEARER_TOKEN"

+ 7 - 11
go_stream/push_stream_ct-ip500.sh

@@ -1,15 +1,12 @@
 #!/bin/bash
 
-# SVBC 摄像头 (SD10POE-5MP) 推流到 Cloudflare Stream
-# 摄像头 IP: 192.168.0.246
-# 默认账号: admin/admin
-# 默认端口: 554
-# 默认通道: 1
-# 默认流媒体服务器: rtsp://admin:admin@192.168.0.246:554/1
-# 默认推流地址: https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278b188b443e8a6c5503kb51e49994b6fd9e56b6f1fdfcd339fe6/webRTC/publish
-# 默认推流密钥: ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-
+# CT-IP500 摄像头推流到 Cloudflare Stream (WHIP 协议)
+# 摄像头 IP: 192.168.0.100
+# 账号: admin / admin
+# 编码: H.264 (640x480)
+# RTSP 路径: /cam/realmonitor?channel=1&subtype=0 (大华风格)
 
-RTSP_URL="rtsp://admin:admin@192.168.0.246:554/1"
+RTSP_URL="rtsp://admin:admin@192.168.0.100:554/cam/realmonitor?channel=1&subtype=0"
 WHIP_URL="https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278b188b443e8a6c5503kb51e49994b6fd9e56b6f1fdfcd339fe6/webRTC/publish"
 BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
 
@@ -17,7 +14,6 @@ BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
     -rtsp_transport tcp \
     -i "$RTSP_URL" \
     -map 0:v:0 -map "0:a?" \
-    -vf "scale=1280:960" \
     -c:v libx264 \
     -preset veryfast \
     -tune zerolatency \
@@ -26,6 +22,6 @@ BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
     -pix_fmt yuv420p \
     -g 30 -keyint_min 30 \
     -b:v 2500k -maxrate 2500k -bufsize 5000k \
-    -c:a opus -ac 2 -strict -2 -ar 48000 -b:a 128k \
+    -c:a opus -strict -2 -ar 48000 -b:a 128k \
     -f whip "$WHIP_URL" \
     -headers "Authorization: Bearer $BEARER_TOKEN"

+ 8 - 10
go_stream/push_stream_svbc.sh

@@ -1,22 +1,19 @@
 #!/bin/bash
 
-# SVBC 摄像头 (SD10POE-5MP) 推流到 Cloudflare Stream
+# SVBC 摄像头 (SD10POE-5MP) 推流到 Cloudflare Stream (WHIP 协议)
 # 摄像头 IP: 192.168.0.246
-# 默认账号: admin/admin
-# 默认端口: 554
-# 默认通道: 1
-# 默认流媒体服务器: rtsp://admin:admin@192.168.0.246:554/1
-# 默认推流地址: https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278b188b443e8a6c5503kb51e49994b6fd9e56b6f1fdfcd339fe6/webRTC/publish
-# WHIP URL 本身已包含认证信息,不需要额外 Bearer Token
+# 账号: admin / admin
+# 编码: H.265 (2560x1920,需要转码为 H.264)
+# RTSP 路径: /1
 
 RTSP_URL="rtsp://admin:admin@192.168.0.246:554/1"
 WHIP_URL="https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278b188b443e8a6c5503kb51e49994b6fd9e56b6f1fdfcd339fe6/webRTC/publish"
+BEARER_TOKEN="ZrpMoQ15dCCe6rX0pKINzcb0eNdakSih-TmQrbq-"
 
 /usr/local/ffmpeg-whip/bin/ffmpeg \
     -rtsp_transport tcp \
     -i "$RTSP_URL" \
     -map 0:v:0 -map "0:a?" \
-    -vf "scale=1280:720" \
     -c:v libx264 \
     -preset veryfast \
     -tune zerolatency \
@@ -25,5 +22,6 @@ WHIP_URL="https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/8c108b4025d3278
     -pix_fmt yuv420p \
     -g 30 -keyint_min 30 \
     -b:v 2500k -maxrate 2500k -bufsize 5000k \
-    -an \
-    -f whip "$WHIP_URL"
+    -c:a opus -strict -2 -ar 48000 -b:a 128k \
+    -f whip "$WHIP_URL" \
+    -headers "Authorization: Bearer $BEARER_TOKEN"