Welcome to Gpt-Video-Summarizer, a tool for transforming lengthy video content into concise, digestible summaries. Whether you're a student, researcher, or content creator, this tool streamlines the process by leveraging cutting-edge AI models. It utilizes existing YouTube subtitles or extracts audio from videos, transcribing it into an SRT file using OpenAI's Whisper model, and then crafts a summary with GPT-4 Turbo.
- Audio Extraction: Seamlessly extracts audio from youtube or mp4 videos of any length,
- AI-Powered Transcription: Converts audio to text using OpenAI's Whisper model with your own api key.
- Intelligent Summarization: Generates insightful summaries with OpenAI's GPT model.
- Flexible Output: Save transcripts and summaries in various formats.
- Clipboard Integration: Instantly copy summaries for quick access.
- Python: Version 3.8 or later.
- Libraries:
moviepy
,openai
,python-dotenv
,pytubefix
,validators
,pyperclip
.
-
Clone the Repository:
git clone <repository-url> cd <repository-directory> cp .env.example .env
-
Add OpenAI API Key:
Add your OpenAI API key to the
.env
file. -
Install it as package (Optional):
pip install .
-
Run the Script: Pass the URL to the script or follow the interactive prompt.
gpt-video-summarize https://www.youtube.com/watch?v=MkTw3_PmKtc
-
Alternative Command with Parameters:
gpt-video-summarize --video-url <video-url> --detail 0.1 --language English --template markdown
You can also set preferences in config.py and run the script with
python -m src/main.py
video-url
: The URL or local path of the video you wish to summarize.detail
: [0,1] One means more detailed.language
: Desired language for the summary.template
: Choose a template for summarization. ["Text", "Markdown", "Obsidian", "CSV"]careful-words
: Specify words to handle with care in the transcript.
- Transcript: Saved as
SRT
. - Summary: Saved as
TXT
.
Transcript (SRT Format):
1
00:00:00,000 --> 00:00:02,000
This is an example transcript line.
Summary (TXT Format):
## Summary
- Main point 1...
- Main point 2...
This project is licensed under the MIT License. See the LICENSE file for more details.
- OpenAI: For the Whisper and GPT models.
- Community: Developers of
moviepy
andpyperclip
for their invaluable libraries.