Skip to content

akrowczyk/meme-lipsync

Repository files navigation

🎤 Meme Lip Sync Generator

Create hilarious lip-synced meme videos by animating cartoon mouths on any image! Upload a character image and audio, and watch the magic happen.

Meme Lip Sync Generator

✨ Features

  • Two Animation Modes

    • 🎭 Meme Mode - Volume-based mouth animation (instant, works with any audio)
    • 🎤 Precise Mode - Phoneme-accurate lip sync using Rhubarb Lip Sync
  • Smart Audio Handling

    • Upload separate vocal track for precise analysis while playing full song
    • Automatic MP3 to WAV conversion
    • Lyrics support for improved accuracy
  • Easy Positioning

    • Click and drag to position the mouth
    • Adjustable size slider
    • Real-time preview
  • Export Options

    • MP4 (H.264/AAC - universal playback)
    • WebM (VP9 - smaller file size)

🚀 Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/akrowczyk/meme-lipsync.git
    cd meme-lipsync
  2. Install dependencies

    npm install
  3. Download Rhubarb Lip Sync (required for Precise mode)

    Download the latest release for your OS from Rhubarb releases and extract to server/bin/:

    # macOS example
    cd server/bin
    curl -L https://github.com/DanielSWolf/rhubarb-lip-sync/releases/download/v1.14.0/Rhubarb-Lip-Sync-1.14.0-macOS.zip -o rhubarb.zip
    unzip rhubarb.zip
    rm rhubarb.zip
  4. Set up environment (optional)

    cp .env.example .env
    # Edit .env if needed
  5. Start the app

    # Start both frontend and backend
    npm run dev:full
    
    # Or start separately:
    npm run server   # Backend on http://localhost:3001
    npm run dev      # Frontend on http://localhost:5173
  6. Open in browser

    Navigate to http://localhost:5173

📖 Usage

Meme Mode (Easy & Fast)

  1. Upload a character image (PNG recommended)
  2. Upload any audio file (MP3, WAV, OGG)
  3. Select Meme Mode 🎭
  4. Click Start Meme Mode
  5. Position the mouth by clicking on the preview
  6. Adjust size with the slider
  7. Press play to preview
  8. Export as MP4 or WebM

Precise Mode (Accurate Lip Sync)

  1. Upload a character image
  2. Upload your audio (full song with music)
  3. (Optional) Upload an isolated vocal track for better accuracy
  4. (Recommended) Paste the lyrics
  5. Select Precise Mode 🎤
  6. Click Analyze Lip Sync
  7. Position and preview
  8. Export

Tip: For songs with background music, use vocalremover.org to extract vocals for the analysis track.

🎨 Customizing Mouth Sprites

The default cartoon mouth sprites are in public/mouths/. To use custom mouths:

  1. Create 9 PNG images (A.png through H.png + X.png) on a bright green (#00FF00) background
  2. The green will be automatically removed (chroma key)
  3. Place them in public/mouths/

Mouth Shape Reference

Shape Sound Description
A P, B, M Closed lips
B EE Teeth showing
C EH, AE Open oval
D AH Wide open
E OH Rounded
F OO, W Puckered
G F, V Teeth on lip
H L Tongue visible
X Rest Neutral/closed

🛠️ Tech Stack

  • Frontend: React + Vite
  • Backend: Node.js + Express
  • Lip Sync: Rhubarb Lip Sync
  • Audio/Video: ffmpeg, Web Audio API, MediaRecorder API

📁 Project Structure

meme-lipsync/
├── public/
│   └── mouths/          # Mouth sprite images
├── server/
│   ├── bin/             # Rhubarb binary (not in repo)
│   ├── uploads/         # Temporary uploaded files
│   ├── index.js         # Express server
│   └── rhubarbService.js # Rhubarb CLI wrapper
├── src/
│   ├── components/      # React components
│   ├── App.jsx          # Main app component
│   └── index.css        # Global styles
├── .env.example         # Environment template
└── package.json

🤝 Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

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

🙏 Acknowledgments


Made with ❤️ and way too many late nights

About

Create hilarious lip-synced meme videos by animating cartoon mouths on any image! Upload a character image and audio, and watch the magic happen.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors