Skip to content

peeyuzz/papertok

Repository files navigation

PaperTok: PDF to TikTok Video Generator

PaperTok is a web application that converts PDF content into engaging TikTok-style videos. It automates the process of content extraction, script generation, and video creation, making it easy to transform academic papers, stories, or any PDF document into shareable short-form videos.

Features

  • PDF content extraction
  • AI-powered script generation
  • Text-to-speech conversion
  • Automatic video creation with captions
  • Web interface for easy uploads and downloads

Prerequisites

  • Python 3.7+
  • FFmpeg
  • Gemini API

Installing FFmpeg

FFmpeg is required for video processing. Follow these instructions to install it:

On Windows:

  1. Download FFmpeg from https://ffmpeg.org/download.html
  2. Extract the downloaded archive
  3. Add the FFmpeg bin folder to your system PATH

On macOS (using Homebrew):

brew install ffmpeg

On Linux (Ubuntu/Debian):

sudo apt update
sudo apt install ffmpeg

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/papertok.git
    cd papertok
    
  2. Create a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows, use `.venv\Scripts\activate`
    
  3. Install the required packages:

    pip install -r requirements.txt
    
  4. Set up environment variables:

    • Copy .env.example to .env
    • Fill in the necessary Gemini API key and configurations

Usage

  1. Start the FastAPI web application:

    uvicorn main:app --reload
    
  2. Open a web browser and navigate to http://localhost:8000

  3. Upload a PDF file and follow the on-screen instructions to generate your TikTok video.

Project Structure

  • main.py: Main FastAPI application
  • caption_generator.py: Generates captions for the video
  • script_generator.py: AI-powered script generation from PDF content
  • text_to_speech.py: Converts generated script to speech
  • video_processing.py: Handles video creation and editing
  • utils.py: Utility functions
  • templates/: HTML templates for the web interface
  • static/output/: Static assets and output for generated videos
  • uploads/: Temporary storage for uploaded PDFs
  • pdfs/: Storage for processed PDF files
  • background.mp4: Background video used in the video creation process
  • voiceOver.wav: Audio file generated by text-to-speech
  • script.txt: Contains the script generated from PDF content

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published