This project enables educators to upload PowerPoint presentations (PPTs) along with optional images and automatically generates videos from the uploaded content. The project consists of a Django application for managing educator uploads and a FastAPI-based microservice for GPU-accelerated video generation.
- Upload Management: Educators can upload PPTs and optional images through a web interface.
- Background Video Generation: Videos are generated asynchronously from the uploaded content, with the option to leverage GPU acceleration.
- Celery Task Queue: Asynchronous task handling using Celery with RabbitMQ as the message broker.
- Django Integration: The generated videos are linked to the educator's upload and stored in Django's media directory.
- Temporary Directory Management: Temporary directories are used for processing and cleaned up after each request.
- Node Media Server: Serves the generated videos for streaming to students.
- Tailwind CSS: Used for styling the web interface.
- Student Access: Students can consume content uploaded by educators.
├── GenerationServer # FastAPI service for video generation
│ ├── gpu_env.yaml # Conda environment for GPU
│ ├── app.py # FastAPI app for handling video generation requests
│ └── ...
├── edu_project/ # Django project directory
├── home/ # Django app for educator uploads and student content consumption
├── media/ # Directory where generated videos are stored
├── static/ # Static files for the web UI
├── templates/ # HTML templates for the web UI
├── requirements.txt # Python dependencies for Django app
├── manage.py # Django management script
├── media_server.js # Node.js media server for streaming videos
└── README.md # Project readme file
- Python (>=3.10) for Django
- Python (>=3.7) for GPU services
- Django (>=4.0)
- Celery (>=5.2)
- RabbitMQ (>=3.9)
- FastAPI (>=0.85)
- CUDA (for GPU acceleration)
To leverage GPU acceleration, you'll need CUDA drivers and the dependencies listed in the GenerationServer/conda-gpu_env.yaml
file.
-
Clone the Repository:
git clone <repository_url> cd <project_directory>
-
Set up the Virtual Environment and Install Dependencies:
python -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Apply Database Migrations:
python manage.py migrate
-
Create a Superuser for Django Admin:
python manage.py createsuperuser
-
Run the Django Development Server:
python manage.py runserver
Access the Django app at http://localhost:8000
.
-
Navigate to the Generation Server:
cd GenerationServer
-
Set Up the Conda Environment:
Install the required GPU dependencies via conda:
conda env create -f conda-gpuenv.yaml conda activate gpuenv
-
Run the FastAPI Video Generation Service:
uvicorn app:app --host 127.0.0.1 --port 8080
The FastAPI server will now be ready to process video generation requests.
-
Install Node.js:
If you haven't already, install Node.js from the official website.
-
Run the Media Server:
In the project root, run the media server using:
node media_server.js
The media server will serve the generated videos for streaming.
-
Install RabbitMQ:
Install RabbitMQ according to your OS. For Ubuntu, use:
sudo apt-get install rabbitmq-server sudo systemctl enable rabbitmq-server sudo systemctl start rabbitmq-server
-
Run Celery Worker:
In the project root, start a Celery worker to process background tasks:
celery -A edu_project worker --loglevel=info
-
Run Celery Beat (Optional):
If you're using scheduled tasks, start the Celery beat scheduler:
celery -A edu_project beat --loglevel=info
-
Install Tailwind CSS:
Navigate to the project directory where your
package.json
is located and run:npm install
-
Build Tailwind CSS:
To build the CSS file, use the command:
npx tailwindcss build -i static/css/input.css -o static/css/output.css --watch
This will compile your Tailwind CSS styles and watch for changes.
-
Educator Upload: Educators upload their PowerPoint presentations and optional images using the web UI.
-
Background Video Generation: Uploaded files are sent to the FastAPI service for video generation, which runs asynchronously.
-
Viewing Generated Videos: Once the video is generated, students can stream the videos via the Node media server.
We welcome contributions! Please follow these steps to contribute:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Push to your branch.
- Open a pull request.
Please ensure that your code adheres to the project's coding standards and passes all tests.
This project is licensed under the MIT License. See the LICENSE
file for more information.