Skip to content

Commit

Permalink
time waste ho raha hai yaar
Browse files Browse the repository at this point in the history
  • Loading branch information
theSoberSobber committed Mar 1, 2024
1 parent 417aaf6 commit 1abb724
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions generate-with-extra-logging.sh
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."

0 comments on commit 1abb724

Please sign in to comment.