This repository contains a full stack application that generates subtitles for an uploaded video using artificial intelligence. The frontend is built using Next.Js and the backend is built using Flask and Celery with the help of ffmpeg and OpenAI's Open Source Whisper models.
To run this application, you need to have Node.js, Python, and ffmpeg installed on your system. Follow the instructions below to install the necessary dependencies:
- Install dependencies by running the command
npm install
- Run the React app using the command
npm run dev
- Install ffmpeg on your system. To do so, follow the appropriate instructions based on your operating system:
- On Ubuntu or Debian:
sudo apt update && sudo apt install ffmpeg
- On Arch Linux:
sudo pacman -S ffmpeg
- On macOS using Homebrew:
brew install ffmpeg
- On Windows using Chocolatey:
choco install ffmpeg
- On Windows using Scoop:
scoop install ffmpeg
- On Ubuntu or Debian:
- Install the necessary Python dependencies by running the command
pip install -r requirements.txt
- Run the Flask API using the command
python generate_subs.py
- Run Celery worker nodes using the following command:
- On a Windows machine:
python -m celery -A generate_subs.celery worker --pool=solo -l info
- On other operating systems:
python -m celery -A generate_subs.celery worker -l info
- On a Windows machine:
- Before deploying using docker-compose, make sure to set the environment variables correctly for all the services
- Run the application using Docker using the following command:
docker-compose up --build -d
To use the application, follow the steps below:
- Upload a video file using the frontend interface
- Wait for the subtitle generation process to complete
- View the generated subtitles on the frontend
If you'd like to contribute to this project, please fork the repository and make changes as you'd like. Pull requests are welcome!