Convert MP4 video files to text using NVIDIA's Whisper Large V3 API and Streamlit.
- 🎬 Upload MP4 video files
- 🎵 Automatic audio extraction
- 🤖 AI-powered transcription using NVIDIA Whisper Large V3
- ⏱️ Timestamp-based segmentation
- 📊 CSV output with structured data
- 💾 Automatic saving to Output folder
- 📥 Download CSV files
- 🎨 Clean and intuitive Streamlit UI
Note: Speaker diarization (voice identification) is NOT supported by the NVIDIA cloud API. Sequential segment numbering is provided for transcript organization only.
- Python 3.8 or higher
- NVIDIA API Key (Get it from NVIDIA Build)
- Git (for cloning NVIDIA Riva Python client)
-
Clone this repository
git clone https://github.com/esaiaswt/MP4AudioToText.git cd MP4AudioToText -
Clone NVIDIA Riva Python client
git clone https://github.com/nvidia-riva/python-clients.git
-
Install dependencies
pip install -r requirements.txt pip install -r python-clients/requirements.txt
-
Configure your API key
Create a
.envfile in the project directory:NVIDIA_API_KEY=your_api_key_hereYou can use
.env.exampleas a template:cp .env.example .env
Then edit
.envwith your actual API key.
-
Run the application
streamlit run app.py
-
Open your browser
The app will automatically open at
http://localhost:8501 -
Upload and transcribe
- Click "Browse files" to upload an MP4 video
- Click "Transcribe Audio" to start the conversion
- Wait for the transcription to complete
- View the results in a structured table format
- Download the CSV file (automatically saved in
Output/folder) - CSV includes: Seconds in video, Speaker Name/Number, Transcribed text
MP4AudioToText/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .env # API key configuration (not in git)
├── .env.example # Template for environment variables
├── .gitignore # Git ignore rules
├── Output/ # Generated CSV files (not in git)
├── python-clients/ # NVIDIA Riva Python client (not in git)
└── README.md # This file
- Upload: User uploads an MP4 video file
- Extract: The app extracts audio from the video as WAV (16-bit, mono, 16kHz) using MoviePy
- Transcribe: Audio is sent to NVIDIA's Whisper API via the official Riva Python client with gRPC
- Process: Results are parsed from JSON with accurate timestamps from the API response
- Save: Transcription is saved as CSV in the
Output/folder (named after the MP4 file) - Display: Results are shown in a table format with download option
The generated CSV file contains three columns:
- Seconds in video: Timestamp (rounded to nearest second) of when the speech segment ends
- Speaker Name/Number: Sequential segment identifier (e.g., Segment 1, Segment 2, etc.). Note that this is NOT actual speaker identification - the NVIDIA cloud API does not support speaker diarization. For true speaker identification, you would need to deploy a self-hosted NVIDIA Riva server.
- Transcribed text: The actual transcribed text for that segment
streamlit- Web UI frameworkpython-dotenv- Environment variable managementmoviepy- Video/audio processingpandas- CSV data handling and table displaypsutil- Process management for quit functionalitykeyboard- Keyboard control for quit functionalitynvidia-riva-client- Official NVIDIA Riva gRPC client (installed via python-clients)
If you get "Python client not found" error:
git clone https://github.com/nvidia-riva/python-clients.git
pip install -r python-clients/requirements.txtMake sure your .env file exists in the project root and contains:
NVIDIA_API_KEY=your_actual_key
If you encounter issues with MoviePy on Windows, you may need to install FFmpeg:
# Using chocolatey
choco install ffmpeg
# Or download from: https://ffmpeg.org/download.htmlEnsure all dependencies are installed:
pip install -r requirements.txt --upgrade⚠️ Never commit your.envfile to version control- The
.gitignorefile is configured to exclude.envautomatically - The
Output/folder (containing transcription results) is also excluded from Git - The
python-clients/folder is also excluded from Git - Keep your NVIDIA API key confidential
- Uses NVIDIA Riva gRPC API via official Python client
- Audio extracted as 16-bit PCM WAV, mono channel, 16kHz sample rate
- Supports automatic punctuation and word-level timestamps
- Speaker diarization enabled with support for up to 5 speakers
- AI-powered speaker identification based on voice characteristics
- Segmented output with ~30 second intervals
- CSV format with rounded timestamps for easy reading
This app uses the NVIDIA Whisper Large V3 API via the official NVIDIA Riva Python Client
This project is open source and available for personal and commercial use.
For issues related to:
- NVIDIA API: Visit NVIDIA Build
- NVIDIA Riva Client: Check python-clients repository
- This application: Open an issue in the repository