A Python tool for processing video presentations, extracting slides, transcribing audio, and generating comprehensive transcripts with slide descriptions.
lecture2ppt/
├── sample/ # Sample video files
├── output/ # Generated output files (PDFs, transcripts, etc.)
├── temp/ # Temporary files (images, etc.)
└── src/ # Source code
├── main.py # Main processing script
├── merge_transcripts.py # Transcript merging script
└── create_ppt.py # PowerPoint generation script
- Python 3.8+
- OpenAI API key
- Required Python packages (install using
pip install -r requirements.txt
):- moviepy
- openai
- python-dotenv
- opencv-python
- numpy
- Pillow
- PyMuPDF
- python-pptx
- Clone the repository:
git clone https://github.com/yourusername/lecture2ppt.git
cd lecture2ppt
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
The main script processes a video file, extracts slides, and generates transcripts:
python src/main.py sample/test_video.mp4
Optional flags:
--skip-audio-extraction
: Skip audio extraction--skip-audio-transcription
: Skip audio transcription--skip-text-extraction
: Skip text extraction from slides
Combine slide descriptions with audio transcript:
python src/merge_transcripts.py --slide-transcripts output/slide_transcripts.txt --transcript output/transcript.txt --output output/merged_transcript.txt
Generate a PowerPoint presentation with slides and speaker notes:
python src/create_ppt.py --slides-pdf output/slides.pdf --transcript output/transcript.txt --output output/presentation.pptx
All output files are saved in the output/
directory:
slides.pdf
: Extracted slides from the videotranscript.txt
: Audio transcriptionslide_transcripts.txt
: Slide descriptionsmerged_transcript.txt
: Combined slide descriptions and audio transcriptpresentation.pptx
: PowerPoint presentation with slides and speaker notes
To process Tim Urban's TED Talk about procrastination:
- Download the video:
curl -L -o sample/test_video.mp4 "https://download.ted.com/talks/TimUrban_2016-480p.mp4"
- Process the video:
python src/main.py sample/test_video.mp4
- Merge transcripts:
python src/merge_transcripts.py --slide-transcripts output/slide_transcripts.txt --transcript output/transcript.txt --output output/merged_transcript.txt
- Create PowerPoint:
python src/create_ppt.py --slides-pdf output/slides.pdf --transcript output/transcript.txt --output output/presentation.pptx
The script will:
- Extract slides from the video
- Transcribe the audio
- Generate slide descriptions
- Create a merged transcript
- Generate a PowerPoint presentation with slides and corresponding speaker notes
Apache License 2.0