config: Add 1 and update 4 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s

This commit is contained in:
Your Name
2025-09-01 21:22:28 +12:00
parent d0e4beaa50
commit a4418ec61f
5 changed files with 62 additions and 2 deletions

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
# MediaMTX - RTSP/HLS/WebRTC streaming server
mediamtx:

View File

@@ -36,6 +36,8 @@ webrtcAllowOrigin: '*'
paths:
# Main court camera stream
court_main:
# Note: Password with special characters should be URL-encoded in service.env
# e.g., ! becomes %21, @ becomes %40, etc.
source: rtsp://${CAMERA_USER}:${CAMERA_PASSWORD}@${CAMERA_IP}:${CAMERA_RTSP_PORT}/cam/realmonitor?channel=1&subtype=0
sourceProtocol: tcp
sourceOnDemand: no

View File

@@ -8,6 +8,8 @@ RECORDINGS_FOLDER="/home/dropshell/example-squashkiwi-streaming-recordings"
PROJECT_NAME="sk-streaming"
# Camera Configuration
# Note: If password contains special characters (! @ # $ & %), they will be automatically URL-encoded
# Or you can manually encode them: ! = %21, @ = %40, # = %23, $ = %24, & = %26
CAMERA_IP=192.168.1.100
CAMERA_USER=admin
CAMERA_PASSWORD=changeme

View File

@@ -9,10 +9,20 @@ _check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER" "CAMERA_IP" "COURT_I
# shellcheck disable=SC2046
create_items $(get_squashkiwi_streaming_paths) || _die "Failed to create directories"
mkdir -p "${RECORDINGS_FOLDER}"
mkdir -p "${LOCAL_DATA_FOLDER}/config"
mkdir -p "${LOCAL_DATA_FOLDER}/config/overlay"
mkdir -p "${LOCAL_DATA_FOLDER}/config/web"
# Copy configuration files
cp -r "${SCRIPT_DIR}/config/"* "${LOCAL_DATA_FOLDER}/config/" || _die "Failed to copy config files"
# URL-encode the camera password if it contains special characters
if [[ "${CAMERA_PASSWORD}" == *[!\@\#\$\&\%]* ]]; then
echo "Note: Camera password contains special characters. Encoding for RTSP URL..."
CAMERA_PASSWORD_ENCODED=$(echo -n "${CAMERA_PASSWORD}" | sed 's/!/%21/g; s/@/%40/g; s/#/%23/g; s/\$/%24/g; s/&/%26/g; s/%/%25/g')
export CAMERA_PASSWORD="${CAMERA_PASSWORD_ENCODED}"
fi
# Test Docker
_check_docker_installed || _die "Docker test failed, aborting installation..."

View File

@@ -0,0 +1,48 @@
#!/bin/bash
# Test camera RTSP connection
# shellcheck disable=SC1091
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CAMERA_IP" "CAMERA_USER" "CAMERA_PASSWORD" "CAMERA_RTSP_PORT" "LOCAL_DATA_FOLDER"
echo "Testing camera connection..."
echo "Camera IP: ${CAMERA_IP}"
echo "Camera User: ${CAMERA_USER}"
echo "RTSP Port: ${CAMERA_RTSP_PORT}"
# URL-encode the password if it contains special characters
ENCODED_PASSWORD=$(echo -n "${CAMERA_PASSWORD}" | sed 's/!/%21/g; s/@/%40/g; s/#/%23/g; s/\$/%24/g; s/&/%26/g')
RTSP_URL="rtsp://${CAMERA_USER}:${ENCODED_PASSWORD}@${CAMERA_IP}:${CAMERA_RTSP_PORT}/cam/realmonitor?channel=1&subtype=0"
echo ""
echo "Testing RTSP URL (password hidden): rtsp://${CAMERA_USER}:****@${CAMERA_IP}:${CAMERA_RTSP_PORT}/cam/realmonitor?channel=1&subtype=0"
# Test with ffprobe
echo ""
echo "Testing with ffprobe..."
docker run --rm --network host \
linuxserver/ffmpeg:latest \
ffprobe -v error -show_streams -select_streams v:0 \
"${RTSP_URL}" 2>&1 | head -20
if [ $? -eq 0 ]; then
echo "✓ Camera connection successful!"
else
echo "✗ Camera connection failed"
echo ""
echo "Trying alternative RTSP paths..."
# Try without subtype parameter
ALT_URL="rtsp://${CAMERA_USER}:${ENCODED_PASSWORD}@${CAMERA_IP}:${CAMERA_RTSP_PORT}/cam/realmonitor?channel=1"
docker run --rm --network host linuxserver/ffmpeg:latest \
ffprobe -v error "${ALT_URL}" 2>&1 | head -5
# Try simple path
SIMPLE_URL="rtsp://${CAMERA_USER}:${ENCODED_PASSWORD}@${CAMERA_IP}:${CAMERA_RTSP_PORT}/"
docker run --rm --network host linuxserver/ffmpeg:latest \
ffprobe -v error "${SIMPLE_URL}" 2>&1 | head -5
fi
echo ""
echo "Checking MediaMTX container logs..."
docker logs "${PROJECT_NAME}-mediamtx" --tail 20 2>&1 | grep -E "(ERR|WARN|connected|disconnected|error)"