-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplice_videos.sh
More file actions
executable file
·100 lines (87 loc) · 3.03 KB
/
Copy pathsplice_videos.sh
File metadata and controls
executable file
·100 lines (87 loc) · 3.03 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
# Teacher Appreciation Video Splicing Tool - Helper Script
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 is required but not installed."
exit 1
fi
# Check if FFmpeg is installed
if ! command -v ffmpeg &> /dev/null; then
echo "Error: FFmpeg is required but not installed."
echo "Please install FFmpeg:"
echo " - macOS: brew install ffmpeg"
echo " - Linux: sudo apt install ffmpeg (Ubuntu/Debian) or sudo yum install ffmpeg (CentOS/RHEL)"
echo " - Windows: Download from FFmpeg.org or install via Chocolatey: choco install ffmpeg"
exit 1
fi
# Default directories
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DEFAULT_INPUT_DIR="$SCRIPT_DIR/input"
DEFAULT_OUTPUT_DIR="$SCRIPT_DIR/output"
DEFAULT_TEMP_DIR="$SCRIPT_DIR/temp"
# Create default directories if they don't exist
mkdir -p "$DEFAULT_INPUT_DIR"
mkdir -p "$DEFAULT_OUTPUT_DIR"
# Display welcome message
echo "========================================================"
echo " Teacher Appreciation Video Splicing Tool"
echo "========================================================"
echo ""
echo "This tool will combine student videos for each teacher."
echo "Videos should be named: teacherfirstname_teacherlastname_studentname.extension"
echo ""
echo "Default directories:"
echo " - Input: $DEFAULT_INPUT_DIR"
echo " - Output: $DEFAULT_OUTPUT_DIR"
echo ""
# Ask for input directory
read -p "Enter input directory [$DEFAULT_INPUT_DIR]: " INPUT_DIR
INPUT_DIR=${INPUT_DIR:-$DEFAULT_INPUT_DIR}
# Ask for output directory
read -p "Enter output directory [$DEFAULT_OUTPUT_DIR]: " OUTPUT_DIR
OUTPUT_DIR=${OUTPUT_DIR:-$DEFAULT_OUTPUT_DIR}
# Ask for normalization preference
read -p "Normalize videos for consistent quality? [Y/n]: " NORMALIZE
NORMALIZE=${NORMALIZE:-Y}
NORMALIZE_FLAG=""
if [[ $NORMALIZE =~ ^[Nn] ]]; then
NORMALIZE_FLAG="--no-normalize"
fi
# Ask about title cards
read -p "Add title cards (teacher intro + student names)? [Y/n]: " TITLE_CARDS
TITLE_CARDS=${TITLE_CARDS:-Y}
TITLE_CARDS_FLAG=""
if [[ $TITLE_CARDS =~ ^[Nn] ]]; then
TITLE_CARDS_FLAG="--no-title-cards"
fi
# Ask to keep temporary files
read -p "Keep temporary files for debugging? [y/N]: " KEEP_TEMP
KEEP_TEMP=${KEEP_TEMP:-N}
KEEP_TEMP_FLAG=""
if [[ $KEEP_TEMP =~ ^[Yy] ]]; then
KEEP_TEMP_FLAG="--keep-temp"
fi
echo ""
echo "Starting video processing..."
echo "This may take some time depending on the number and size of videos."
echo ""
# Run the Python script
python3 "$SCRIPT_DIR/video_splicing.py" \
--input "$INPUT_DIR" \
--output "$OUTPUT_DIR" \
--temp "$DEFAULT_TEMP_DIR" \
$NORMALIZE_FLAG \
$TITLE_CARDS_FLAG \
$KEEP_TEMP_FLAG
# Check if the script ran successfully
if [ $? -eq 0 ]; then
echo ""
echo "Processing complete! Check the output directory:"
echo "$OUTPUT_DIR"
echo ""
echo "Thank you for using the Teacher Appreciation Video Splicing Tool!"
else
echo ""
echo "An error occurred during processing."
echo "Please check the error messages above for more information."
fi