Skip to content

About

Transform Static Slides into Dynamic Videos Instantly

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

66 Commits

Folders and files

Repository files navigation

Language / Idioma / 语言: English | 中文 | Português

AIVidFromPPT

An AI video generation service based on FastAPI that supports a complete workflow from PPT to video, including PPT parsing, text-to-speech, video synthesis, and virtual human functionality.

This project provides API interface services for the Maker platform. After deployment, you need to configure the public network address to the Maker's HOST ENDPOINT node to call this service's API interfaces in Maker workflows.

✨ Features

  • 📄 PPT Parsing & Processing - Convert PPT/PPTX files to images with context management
  • 🔊 Text-to-Speech (TTS) - Support for multiple TTS providers with automatic subtitle generation
  • 📤 File Upload Management - Upload, download, and manage various file types
  • 🎬 Video Synthesis - Combine images, audio, subtitles, and virtual human videos into complete videos
  • 👤 Virtual Human Synthesis - Generate virtual human videos with lip-sync based on text

🚀 Quick Start

Requirements

  • Python 3.11+
  • Docker (optional, for containerized deployment)

Source Code Setup

  1. Clone the repository
git clone <repository-url>
cd hackathon-AIVidFromPPT
  1. Install system dependencies

The project requires the following system tools. Install them according to your operating system:

macOS

# Install using Homebrew
brew install libreoffice poppler ffmpeg fontconfig

Linux (Ubuntu/Debian)

sudo apt-get update
sudo apt-get install -y \
    libreoffice \
    libreoffice-writer \
    libreoffice-impress \
    poppler-utils \
    ffmpeg \
    fontconfig

Windows

  • LibreOffice: Download and install from official website
  • Poppler: Download from GitHub, extract and add to PATH
  • FFmpeg: Download from official website, extract and add to PATH
  • Fontconfig: Usually included in the system

Notes:

  • libreoffice - For converting PPT/PPTX files to images
  • poppler-utils - For PDF processing and image extraction
  • ffmpeg - For video and audio processing
  • fontconfig - For font management (Chinese font support)
  1. Create virtual environment
conda create -n aividfromppt python=3.11 -y
conda activate aividfromppt
  1. Install Python dependencies
cd server
pip install -r requirements.txt
  1. Configure environment variables

Create a .env file (or copy from .env.example):

OPENAI_API_KEY=your-openai-api-key-here
  1. Start the service
uvicorn main:app --host 0.0.0.0 --port 8201 --reload
  1. Access API documentation

Open your browser and visit: http://localhost:8201/docs

🐳 Docker Deployment

Server Configuration Recommendations

To ensure stable service operation, it is recommended to use a cloud server with the following configuration:

  • Recommended Configuration: 8 CPU cores + 16GB RAM
  • Minimum Configuration: 4 CPU cores + 8GB RAM
  • Storage: At least 50GB available space (for storing uploaded files and generated videos)

Notes:

  • Video synthesis and virtual human generation are compute-intensive tasks that require sufficient CPU and memory resources
  • Larger memory helps process large PPT files and video files
  • Sufficient storage space is needed to save user-uploaded files and generated videos

Using environment variables

docker run -d \
  --name aividfromppt \
  --restart=always \
  -p 8201:8201 \
  -e OPENAI_API_KEY="your-openai-api-key-here" \
  -v $(pwd)/server/uploads:/app/uploads \
  unhejing/aividfromppt:latest

🌐 Online Service (No Local Deployment Required)

If you don't have a local deployment environment, you can directly use our online service for testing:

  • Service Address: http://154.40.41.212:8201
  • API Documentation: http://154.40.41.212:8201/docs
  • Interactive Documentation: http://154.40.41.212:8201/redoc

Usage Notes:

  • All API endpoints can be accessed directly through the above address
  • When configuring HOST ENDPOINT in the Maker platform, use http://154.40.41.212:8201 as the service address
  • No need to install any dependencies or configure the environment, ready to use out of the box

⚠️ Important Notice: Due to server resource limitations, when using the online service for Maker testing, please ensure that uploaded PPT files do not exceed 5 pages to ensure stable service operation.

📚 API Documentation

All API endpoints follow RESTful conventions with base path /api/v1.

PPT Parsing & Processing (/api/v1/pptToImg)

  • POST /upload - Upload PPT/PPTX file and convert to images
  • GET /image - Get converted images
  • POST /context - Add context data
  • PUT /context - Update context data
  • DELETE /context - Delete context data
  • GET /context/{uuid} - Get context data

Text-to-Speech (/api/v1/tts)

  • POST /synthesize - Text-to-speech synthesis
    • Supports OpenAI TTS
    • Automatically generates SRT subtitle files
    • Returns audio file URL and metadata
  • GET /files/{file_path} - Get audio or subtitle files
  • GET /channels - Get list of supported TTS channels

File Upload (/api/v1/upload)

  • POST /file - Upload a single file (max 50MB)
  • POST /files - Upload multiple files
  • GET /files/{file_path} - Get uploaded file
  • DELETE /file/{file_path} - Delete file
  • GET /list - List all uploaded files

Supported file types: images, documents, videos, audio, subtitles, archives, etc.

Video Synthesis (/api/v1/video)

  • POST /synthesize - Synthesize video
    • Supports multi-segment video synthesis
    • Supports overlaying images, audio, subtitles, and virtual human videos
    • Returns video ID and access URL
  • GET /{video_id} - Get video information
  • GET /{video_id}/download - Download video file
  • GET /health - Health check

Virtual Human (/api/v1/virtual)

  • POST /generate-video - Generate virtual human video
    • Generate lip-sync video based on text
    • Supports Chinese and English mixed content
    • Supports gender selection

🛠️ Tech Stack

  • Web Framework: FastAPI
  • Python Version: 3.11
  • Main Dependencies:
    • OpenAI API (TTS)
    • MoviePy (Video processing)
    • PyMuPDF (PDF processing)
    • LibreOffice (PPT conversion)
    • FFmpeg (Video/audio processing)

📁 Project Structure

hackathon-AIVidFromPPT/
├── server/                 # Backend service
│   ├── pptToImg/          # PPT parsing and processing
│   ├── tts/               # Text-to-speech
│   ├── upload/            # File upload management
│   ├── video/             # Video synthesis
│   ├── virtual/           # Virtual human synthesis
│   ├── main.py            # Application entry point
│   └── requirements.txt   # Python dependencies
├── .setup/                # Deployment configuration
│   ├── Dockerfile         # Docker image build
│   └── build_and_push_dockerhub.sh  # Image build script
├── docs/                  # Project documentation
└── README.md              # Project description

📝 Environment Variables

Variable Required Description Default
OPENAI_API_KEY ✅ OpenAI API key None

🔧 Maker Configuration

HOST ENDPOINT Configuration

After deployment, you need to configure the HOST ENDPOINT node in the Maker platform:

  1. Get the public network address of your service (e.g., http://your-domain.com or http://your-ip:8201)
  2. Add a HOST ENDPOINT node in your Maker workflow
  3. Enter the public network address in the node configuration

Configuration example:

Host Endpoint Configuration

Configuration Notes:

  • Enter the public network address in the Template field, e.g., http://154.40.41.212:8201
  • Ensure the service is properly deployed and accessible from the public network
  • After configuration, you can call all API interfaces of this service in Maker workflows

Maker Workflow

We provide a complete Maker workflow configuration file that you can import and use directly:

📄 Download Maker Workflow Source File - Contains complete workflow configuration

Maker Workflow Screenshot

Usage Instructions:

  1. Download the workflow source file AIVidFromPPT.json
  2. Import the workflow in the Maker platform
  3. Modify the service address in the HOST ENDPOINT configuration according to your actual situation
  4. Run the workflow to start using

⚠️ Important Notice: Due to server resource limitations, when testing with the online service, please ensure that uploaded PPT files do not exceed 5 pages.

🎬 Demo Videos

The following are example video results generated by calling this service through the Maker platform:

Note: GitHub README does not support direct video playback. Please click the links below to download and view the videos, or use a Markdown viewer that supports video playback.

Source File

📄 Download Original PPT File - This is the source file used to generate the videos

Chinese Demo

📹 Download Chinese Demo Video

English Demo

📹 Download English Demo Video

Portuguese Demo

📹 Download Portuguese Demo Video

🔗 Related Links

About

Transform Static Slides into Dynamic Videos Instantly

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages