Skip to main content

A tool to convert a PowerPoint (PPT or PPTX) to a video with voice that reads the notes for each slide.

Project description

ppt2video

A tool that converts a PowerPoint (PPT) to a video with voice narration (reading the notes from each slide)

This tool reads the note contents from each slide using Google TTS and converts the PPT to an MP4 video.

Installation

pip install ppt2video

Usage

  • Step 1: Place your PPT file (or .pptx) into a specific folder (e.g., data/ppt/your_ppt_name.pptx).

  • Step 2: Open your PowerPoint software and save the slides as images (e.g., PNG) to a specific folder (usually, data/ppt/your_ppt_name/).

  • Step 3: Set up Google Cloud Authentication to access the note contents in your slides:

    • You need to set up authentication using your Google Cloud service account key. Follow these steps:
      • Go to the Google Cloud Console (https://console.cloud.google.com/).
      • Create a new project (or use an existing project).
      • Enable the Text-to-Speech API for that project.
      • Create a Service Account and download the JSON key file.
  • Step 4: Run the code

from ppt2video.tools import *

meta = Meta(
    ppt_file='your_ppt_slide.pptx',  # Name of your PPT file
    image_prefix='slide',  # The prefix for image files (varies depending on the PowerPoint language version)
    google_application_credentials='/config/google_cloud.json'  # Location and filename of your Google Cloud service account key
)

# Run the conversion
ppt_to_video(meta)

Additional settings

You may adjust additional settings as follows:

    # PPT settings
    ppt_file: str 
    ppt_path: str = 'data/ppt/'  # Directory for the PPT and image files
    image_prefix: str = 'slide'  # The prefix for image file names (used when saving slides as images)
    image_extension: str = 'PNG'  # The image file format (default is PNG)
    ppt_extension: str = '.pptx'  # The PowerPoint file extension

    # Google TTS settings
    voice_enabled: bool = True  # Enable or disable voice narration
    google_application_credentials: str = None  # Location of the Google API key (downloaded as JSON)
    voice_path: str = 'data/voice/'  # Directory to save the generated audio files
    max_size: int = 4500  # Maximum text size limit for a single Google TTS API request (default 5000)
    slide_break: float = 2  # Time delay (in seconds) between slides
    line_break: float = 0.7  # Time delay (in seconds) when there's a line break in the text (e.g., '\n')
    lang: str = 'E'  # Language setting: 'E' for English, 'K' for Korean 
    wave: bool = False  # Whether to use Wavenet voices (True or False)

    # MoviePy video settings
    fps: int = 24  # Frames per second for the video

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppt2video-0.1.7.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

ppt2video-0.1.7-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file ppt2video-0.1.7.tar.gz.

File metadata

  • Download URL: ppt2video-0.1.7.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for ppt2video-0.1.7.tar.gz
Algorithm Hash digest
SHA256 95757dda8852913bc5ec8b1c849c7cb4273d816eb44b0aff6d3d579cc8fefaf3
MD5 440b746cc36da595e120780c71e81587
BLAKE2b-256 439ac517bf5a565fd79fbff793caa31cbec624c2175ac3be899a29ac5d862f51

See more details on using hashes here.

File details

Details for the file ppt2video-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ppt2video-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for ppt2video-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c3ad088459c551db4193d0aeabbeae338a924ed5197e12cc91dce9dbe3b9d0aa
MD5 3b19dc6c3e0cafd4aecd80dfe030446c
BLAKE2b-256 de842b9eca50cbbc309989e3f4eac4e5570fc5c5db2f4c99f96d758691164bc4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page