fix: default video and RTSP target for dev-env script

This commit is contained in:
tian 2026-07-20 14:10:11 +08:00
parent 52940a0c53
commit 7c2ae2e75f

View File

@ -25,7 +25,8 @@ $safesightdConfig = Join-Path $controlDir $SafesightdConfig
$mediaServerConfig = Join-Path $edgeDir $MediaConfig
$mediaServerExe = Join-Path $edgeDir "build\media-server.exe"
$rtspUrl = "rtsp://localhost:8554/cam"
$rtspUrl = "rtsp://10.0.0.49:8554/cam"
$defaultVideo = "C:\Users\Tellme\Pictures\人脸库\reg_008_unk_011_多人_正面_黑色鞋_白色鞋_1.mp4"
function Write-Banner {
param([string]$Text)
@ -65,10 +66,11 @@ function Invoke-Start {
# 2. ffmpeg push
Write-Banner "2/5 RTSP 推流 (ffmpeg)"
if ($VideoFile -and (Test-Path $VideoFile)) {
$ffArgs = @("-re", "-stream_loop", "-1", "-i", $VideoFile,
$videoToUse = if ($VideoFile -and (Test-Path $VideoFile)) { $VideoFile } elseif (Test-Path $defaultVideo) { $defaultVideo } else { $null }
if ($videoToUse) {
$ffArgs = @("-re", "-stream_loop", "-1", "-i", $videoToUse,
"-c", "copy", "-rtsp_transport", "tcp", "-f", "rtsp", $rtspUrl)
Write-Host " 视频文件: $VideoFile"
Write-Host " 视频文件: $videoToUse"
} else {
# Try to find a webcam
$webcam = (& $ffmpeg -list_devices true -f dshow -i dummy 2>&1 |
@ -148,6 +150,7 @@ function Invoke-Start {
# Summary
Write-Banner "全部启动完成"
Write-Host " RTSP 输入: $rtspUrl"
Write-Host " 默认视频: $defaultVideo"
Write-Host " 管理端: http://localhost:18080"
Write-Host " 视频监控: http://localhost:18080/ui/monitor"
Write-Host " MinIO: http://localhost:9001"