-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
417aaf6
commit 1abb724
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/bin/bash | ||
|
||
# Define colors for logging | ||
GREEN='\033[0;32m' | ||
RED='\033[0;31m' | ||
NC='\033[0m' # No Color | ||
|
||
# Echo function with color | ||
cecho () { | ||
color=$1 | ||
shift | ||
echo -e "${color}$@${NC}" | ||
} | ||
|
||
# Function to check if file exists before removing | ||
safe_rm() { | ||
if [ -e "$1" ]; then | ||
rm "$1" | ||
cecho $GREEN "Removed $1" | ||
else | ||
cecho $RED "$1 not found, skipping removal" | ||
fi | ||
} | ||
|
||
# Check if arguments are provided for gtt-s.py | ||
if [ $# -eq 0 ]; then | ||
cecho $RED "Usage: $0 <arguments for gtt-s.py>" | ||
exit 1 | ||
fi | ||
|
||
# Main script | ||
cecho $GREEN "Starting script..." | ||
|
||
# Run gtt-s.py with arguments | ||
cecho $GREEN "Running gtt-s.py..." | ||
python gtt-s.py $* | ||
cecho $GREEN "gtt-s.py completed." | ||
|
||
ls | ||
|
||
# Convert rec16.mp3 to rec16.wav | ||
cecho $GREEN "Converting rec16.mp3 to rec16.wav..." | ||
ffmpeg -i rec16.mp3 -ar 16000 rec16.wav | ||
cecho $GREEN "Conversion complete." | ||
|
||
ls | ||
|
||
# Run main script with model and input file | ||
cecho $GREEN "Running main script..." | ||
./main -m models/ggml-large-v1.bin rec16.wav -ojf | ||
cecho $GREEN "Main script completed." | ||
|
||
ls | ||
|
||
# Run consolidator script | ||
cecho $GREEN "Running consolidator script..." | ||
python consolidator.py > /dev/null 2>&1 | ||
cecho $GREEN "Consolidator script completed." | ||
|
||
ls | ||
|
||
cecho $GREEN "Fetching and Chopping BG Video..." | ||
python get-background.py | ||
cecho $GREEN "BG Video Processed" | ||
|
||
ls | ||
|
||
cecho $GREEN "Layering Captions on Segment.mp4..." | ||
python captions.py | ||
cecho $GREEN "Captions Layered Successfully" | ||
|
||
ls | ||
|
||
cecho $GREEN "Merging Audio with Captioned Video..." | ||
python merge-audio.py | ||
cecho $GREEN "Merged Audio Successfully" | ||
|
||
ls | ||
|
||
cecho $RED "Cleaning Up" | ||
safe_rm "rec16.wav" | ||
safe_rm "rec16.mp3" | ||
safe_rm "rec16.wav.json" | ||
safe_rm "consolidated.json" | ||
safe_rm "./output/segment.mp4" | ||
safe_rm "output_with_captions.mp4" | ||
|
||
ls | ||
|
||
cecho $GREEN "Script finished." |