-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·37 lines (31 loc) · 1.07 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
export PYTHONUNBUFFERED=1
# Validate required environment variables
if [ -z "$GENESIS_MODE" ]; then
echo "ERROR: GENESIS_MODE not set (must be 'viewer' or 'streaming')"
exit 1
fi
if [ -z "$STREAM_PREFIX" ]; then
echo "ERROR: STREAM_PREFIX not set"
exit 1
fi
if [ -z "$MEDIAMTX_HOST" ]; then
echo "WARNING: MEDIAMTX_HOST not set, defaulting to 'mediamtx:554'"
export MEDIAMTX_HOST="mediamtx:554"
fi
# Set defaults for encoding parameters
export SIM_STEP_FREQ=${SIM_STEP_FREQ:-100}
export ENCODING_BITRATE=${ENCODING_BITRATE:-4000000}
export ENCODING_FPS=${ENCODING_FPS:-30}
export WORLD_FILE=${WORLD_FILE:-/worlds/headless_camera.gen}
if [ "$GENESIS_MODE" = "viewer" ]; then
echo "Starting Genesis with interactive viewer..."
python3.11 /app/genesis_streamer.py --mode viewer
elif [ "$GENESIS_MODE" = "streaming" ]; then
echo "Starting Genesis in headless streaming mode..."
python3.11 /app/genesis_streamer.py --mode streaming
else
echo "ERROR: GENESIS_MODE must be 'viewer' or 'streaming', got '$GENESIS_MODE'"
exit 1
fi