Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raheesahmed/video_description_generator
This Python script processes a video file, generates a compelling description, creates a voiceover script in the style of David Attenborough, and synthesizes the voiceover using OpenAI's Text-to-Speech API.
https://github.com/raheesahmed/video_description_generator
openai openai-api openai-chatgpt openai-tts openai-vision opencv
Last synced: 9 days ago
JSON representation
This Python script processes a video file, generates a compelling description, creates a voiceover script in the style of David Attenborough, and synthesizes the voiceover using OpenAI's Text-to-Speech API.
- Host: GitHub
- URL: https://github.com/raheesahmed/video_description_generator
- Owner: RaheesAhmed
- Created: 2024-08-11T21:58:00.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T22:33:35.000Z (5 months ago)
- Last Synced: 2024-11-06T12:38:52.026Z (about 2 months ago)
- Topics: openai, openai-api, openai-chatgpt, openai-tts, openai-vision, opencv
- Language: Python
- Homepage:
- Size: 2.43 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.MD
Awesome Lists containing this project
README
# Video Description and Voiceover Generator
This Python script processes a video file, generates a compelling description, creates a voiceover script in the style of David Attenborough, and synthesizes the voiceover using OpenAI's Text-to-Speech API.
## Features
- Extracts frames from a video file
- Generates a video description using GPT-4 Vision
- Creates a voiceover script in David Attenborough's style
- Synthesizes the voiceover using OpenAI's Text-to-Speech API## Prerequisites
Before running the script, make sure you have the following installed:
- Python 3.x
- OpenCV (`opencv-python`)
- OpenAI Python library
- Requests libraryClone the Repo:
```
git clone https://github.com/RaheesAhmed/video_description_generator.git
```Navigate to the Directory:
```
cd video_description_generator
```You can install the required libraries using pip:
```
pip install opencv-python openai requests
```## Setup
1. Clone this repository or download the script.
2. Set up your OpenAI API key as an environment variable in `.env` file :
```
OPENAI_API_KEY='your-api-key-here'
```## Usage
1. Place your video file in the `data` directory and name it `bison.mp4`, or modify the script to use a different file path.
2. Run the script:
```
python main.py
```The script will:
1. Extract frames from the video
2. Generate a video description
3. Create a voiceover script
4. Synthesize the voiceover audio## Output
The script will print:
- The number of frames extracted from the video
- The generated video description
- The voiceover scriptThe synthesized audio will be available as a binary object, which can be saved to a file or played using appropriate audio libraries.
## Note
This script uses OpenAI's GPT-4 Vision model and Text-to-Speech API, which may incur costs. Make sure you're aware of the pricing and your usage limits.