-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·56 lines (47 loc) · 1.67 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.67 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Simple start script for Depth Surge 3D
# Usage: ./start.sh START_TIME END_TIME
# Example: ./start.sh 1:18 1:33
INPUT_VIDEO="input_video.mp4"
# Check if input video exists
if [ ! -f "$INPUT_VIDEO" ]; then
echo "Error: $INPUT_VIDEO not found!"
echo "Please place your video file as 'input_video.mp4' in this directory."
exit 1
fi
# Check arguments
if [ $# -ne 2 ]; then
echo "Usage: ./start.sh START_TIME END_TIME"
echo "Example: ./start.sh 1:18 1:33"
echo "Time format: mm:ss or hh:mm:ss"
exit 1
fi
START_TIME=$1
END_TIME=$2
echo "Processing $INPUT_VIDEO from $START_TIME to $END_TIME..."
# Check if uv is available and working
if command -v uv &> /dev/null && uv --version &> /dev/null 2>&1; then
echo "Using uv to run Depth Surge 3D..."
# Test if uv run works (check for lock file issues)
if uv run python --version &> /dev/null; then
uv run python depth_surge_3d.py "$INPUT_VIDEO" -s "$START_TIME" -e "$END_TIME"
else
echo "uv run failed, falling back to virtual environment..."
source .venv/bin/activate
python depth_surge_3d.py "$INPUT_VIDEO" -s "$START_TIME" -e "$END_TIME"
fi
else
echo "Using virtual environment to run Depth Surge 3D..."
# Try .venv first (uv style), then venv (traditional)
if [ -d ".venv" ]; then
source .venv/bin/activate
elif [ -d "venv" ]; then
source venv/bin/activate
else
echo "Error: No virtual environment found. Please run ./setup.sh first."
exit 1
fi
python depth_surge_3d.py "$INPUT_VIDEO" -s "$START_TIME" -e "$END_TIME"
fi
echo "Processing complete!"
echo "Output video saved with audio preserved."