diff --git a/scripts/dev-env.ps1 b/scripts/dev-env.ps1 index a95f629..0d9cc13 100644 --- a/scripts/dev-env.ps1 +++ b/scripts/dev-env.ps1 @@ -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"