This project provides a tool for extracting audio from video files and then transcribing the extracted audio into text. It utilizes moviepy
for video processing, pydub
for audio handling, and the openai
API for transcribing audio.
- Introduction
- Installation
- Usage
- Features
- Dependencies
- Configuration
- Documentation
- Examples
- Troubleshooting
- Contributors
- License
pip install moviepy pydub python-dotenv openai
Note: Ensure you have Python installed on your system.
To use this tool:
- Set your OpenAI API key in a
.env
file. - Run the script with your video file path.
- Extracts audio from video files.
- Splits audio into manageable chunks.
- Uses OpenAI for accurate audio transcription.
- Saves the transcript to a text file.
- moviepy
- pydub
- python-dotenv
- openai
Create a .env
file in your project root with the following content:
open_ai_API_KEY='Your-OpenAI-API-Key'
The tool is divided into two main functions:
extract_audio_from_video(video_path, audio_path)
: Extracts audio from the provided video file.extract_text_from_audio(audio_file_path)
: Transcribes the audio into text.
To transcribe a video, run the script as follows:
video_path = 'path_to_your_video.mkv'
audio_path = 'output_audio.mp3'
extract_audio_from_video(video_path, audio_path)
transcript = extract_text_from_audio(audio_path)
- Ensure all dependencies are installed.
- Check if the
.env
file is correctly configured. - it requires open_ai_API_KEY= 'Your-OpenAI-API-Key' in .env file
- Make sure the video and audio paths are correct.
List of contributors (if any).
Specify the license under which your project is released.