A Streamlit web application that transcribes YouTube videos and generates summaries using OpenAI's Whisper model and Hugging Face's transformers. The app provides dual methods for transcription: direct audio processing with Whisper and youtube-transcript-api
.
- Dual Transcription Methods:
- Primary: OpenAI's Whisper model for audio transcription
- Fallback:
youtube-transcript-api
- Text Summarization: Generate concise summaries using Hugging Face transformers
- Clean Interface: User-friendly UI built with Streamlit
- Error Handling: Automatic fallback system if primary method fails
- Progress Tracking: Real-time status updates during processing
- Clone the repository:
git clone https://github.com/rajeshai/Youtube-Transcription.git
cd Youtube-Transcription
- Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install required packages:
pip install -r requirements.txt
- Run the app:
streamlit run app.py
- Open your browser and go to
http://localhost:8501
Create a requirements.txt
file with these dependencies:
streamlit
openai-whisper
pytubefix
transformers
torch
youtube_transcript_api
- Launch the application
- Enter a YouTube URL in either the Transcription or Summary tab
- Click the respective button to get either:
- Full video transcription
- Summarized content
-
Transcription Process:
- First attempts to download audio using
pytubefix
and transcribe with Whisper - If that fails, automatically switches to
youtube-transcript-api
- Shows clear status messages throughout the process
- First attempts to download audio using
-
Summarization Process:
- Processes transcribed text using Hugging Face's summarization pipeline
- Handles long transcripts by chunking text into manageable segments
- Combines summaries for a coherent final output
- YouTube may occasionally block
pytubefix
andyoutube-transcript-api
requests - Some videos might not have available transcripts through YouTube's API
- Processing long videos may take additional time
- Summarization quality depends on transcript accuracy
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- OpenAI Whisper for audio transcription
- Hugging Face Transformers for text summarization
- Streamlit for the web interface
- YouTube Transcript API for the fallback transcription method
Note: Please ensure you comply with YouTube's terms of service when using this application.