Built by Metorial, the integration platform for agentic AI.

Learn More

Yash Kavaiya/mcp-video-gen

Video Generation Tool

    Server Summary

    • Automated video creation

    • CSV file processing

    • Text-to-Speech narration

    • Multi-language support

    • Engaging video presentation generation

MCQ Video Generator šŸŽ¬ ✨

Transform your multiple-choice questions into engaging video presentations

Python Version License

šŸ“‹ Overview

The MCQ Video Generator is a powerful tool designed to automatically convert CSV-formatted multiple-choice questions into professional video presentations with synchronized audio narration. Perfect for educators, trainers, and content creators looking to enhance learning materials without the hassle of manual video editing.

✨ Features

  • šŸŽ„ Automated Video Creation - Transform CSV files of MCQs into complete videos
  • šŸ”Š Text-to-Speech Narration - Automatic audio generation for all text elements
  • 🌐 Multi-language Support - Compatible with various languages through gTTS
  • šŸŽØ Customizable Styling - Control colors, fonts, and dimensions
  • šŸ”„ Batch Processing - Process multiple questions in a single run

šŸ› ļø Installation

Prerequisites

  • Python 3.12 or higher
  • Required font file (default: HindVadodara-Light.ttf)

Setup

  1. Clone the repository
git clone https://github.com/yourusername/mcp-video-gen.git
cd mcp-video-gen
  1. Install the required dependencies
pip install -e .
# or
pip install pandas pillow gtts moviepy
  1. Install additional MCP dependencies
pip install mcp[cli]>=1.6.0

šŸš€ Usage

Basic Usage

python main.py

As an MCP Tool

This tool is designed to work within the MCP (Machine Control Protocol) framework:

from mcp.server.fastmcp import FastMCP
from main import create_mcq_video

# Create an MCP server
mcp = FastMCP("mcq_video_generator")

# Example usage
result = await create_mcq_video(
    csv_file_path="your_questions.csv",
    output_filename="my_quiz_video.mp4"
)

šŸ“Š Input Format

Your CSV file should contain columns for questions and answer options. Example format:

QuestionABCDAnswer
What is 1+1?A. 1B. 2C. 3D. 4Ans: B. 2
Capital of France?A. LondonB. BerlinC. ParisD. RomeAns: C. Paris

āš™ļø Configuration Options

ParameterDescriptionDefault
csv_file_pathPath to input CSV fileRequired
output_filenameName for final video"Gyan_Dariyo_final_video.mp4"
languageLanguage code for TTS"en"
font_pathPath to font file"HindVadodara-Light.ttf"
font_sizeText size on slides70
img_widthVideo width (pixels)1920
img_heightVideo height (pixels)1080
bg_color_rgbBackground color(0, 127, 215)
font_color_rgbText color(255, 255, 255)

šŸ“‹ Process Flow

graph TD
    A[Load CSV Data] --> B[Generate Images]
    B --> C[Create TTS Audio]
    C --> D[Combine into Video Clips]
    D --> E[Concatenate Final Video]
    E --> F[Output MP4 File]

šŸ” Technical Details

The tool performs the following steps:

  1. šŸ“‘ Reads MCQ data from a CSV file
  2. šŸ–¼ļø Generates an image for each MCQ with proper text formatting
  3. šŸŽ™ļø Creates audio narration using Google's Text-to-Speech (gTTS)
  4. šŸŽžļø Combines each image and audio into individual video clips
  5. šŸŽ¬ Concatenates all clips into a final video presentation

āš ļø Troubleshooting

Common Issues

  • Font Not Found Error: Ensure the specified font file exists in the working directory
  • Empty CSV Error: Verify your CSV file contains valid data
  • Audio Generation Failure: Check internet connection (required for gTTS)

Font Requirements

The default font is set to "HindVadodara-Light.ttf". If you use a different font:

result = await create_mcq_video(
    csv_file_path="questions.csv",
    font_path="path/to/your/font.ttf"
)

šŸ“ License

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

šŸ‘„ Contributing

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


Made with ā¤ļø for educators and content creators