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).

    • If not using Windows, you may save the slides as images (e.g., png) to the folder data/ppt/your_ppt_name/.
  • Step 2: 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 3: Run the code

from ppt2video.tools import *

meta = Meta(
    ppt_file='your_ppt_slide.pptx',  # Name of your PPT file
    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:

class Meta:
    # 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 
    ppt_extension: str = '.pptx'  # The PowerPoint file extension
    convert_slides_upto_slide_no: int = 0   # Convert to video only slide number upto this
    save_slide_images: bool = True # Save slides automatically from PPT, although there are already saved slides (works only under windows, if you have PowerPoint software)

    # 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 = 1.0  # Time delay (in seconds) between slides
    line_break: float = 0.5  # 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 = True  # Whether to use Wavenet voices (True or False)
    wave_E: str = 'D'
    wave_K: str = 'C'
    speaking_rate_EN: float = 1.1 # English 
    speaking_rate_KR: float = 1.2 # Korean

    # MoviePy video settings
    fps: int = 24  # Frames per second for the video
    fade_duration: float = 0.15 # Slide fade duration
    fade_after_slide: list = field(default_factory=list) # fade effect after given slide number: starting from 0
    target_slide_for_video: list = field(default_factory=list)
    video_file_path: list = field(default_factory=list)
    video_height_scale: list = field(default_factory=list)
    video_location: list = field(default_factory=list)
    video_interrupt: bool = False

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.15.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppt2video-0.1.15-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ppt2video-0.1.15.tar.gz
  • Upload date:
  • Size: 8.2 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.15.tar.gz
Algorithm Hash digest
SHA256 563bbd6f73004139074d381f903600a4be000ccc3c0692a6e4f2ad0f82ea8923
MD5 1db62635c196733a124d2d52d7b66256
BLAKE2b-256 37d761564476c295b0e4bf4d3e241ca47a7c8c777f164c2d8fbd1281c93257c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppt2video-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 8.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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 ec2bd1c61cddbf8a69d4555608551586b3b3b28594a34a2b4459e68b67f69b7b
MD5 a20dc400e4fe29c75e45a79d4ae6a288
BLAKE2b-256 73039a89ffb524e140844d513f38363305ecb0ed9ac4c054dc587f34c5f3deb9

See more details on using hashes here.

Supported by

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