A collection of useful command-line utilities for video/audio processing and transcription.
A shell script that calculates and displays the total duration of video files in a directory.
Features:
- Supports multiple video formats: MP4, MKV, MOV, WebM
- Parallel processing for faster execution
- Unicode-aware filename display with proper truncation
- Formatted duration output (HH:MM:SS)
- Individual file durations plus total duration
Usage:
./mp4len [directory]If no directory is specified, it processes the current directory.
Example Output:
File Duration
---------------------------------------- --------
movie1.mp4 01:23:45
very_long_filename_that_gets_trunca... 02:15:30
short.mkv 00:45:12
---------------------------------------- --------
Total: 04:24:27
A Python command-line interface for transcribing audio and video files using Deepgram's speech-to-text API.
Features:
- Transcribe individual files or entire directories
- Generate SRT subtitles or plain text transcripts
- Support for MP3 audio files and MP4/WebM/MKV video files
- Enhanced video processing: Audio extraction from video files for transcription
- Batch processing with concurrent execution
- Multiple Deepgram model support
- Configurable language and model options
- Automatic cleanup of temporary files
Setup:
- Install dependencies:
pip install -r deepgram-cli/requirements.txt - Set up API key:
echo "DEEPGRAM_API_KEY=your_key" > deepgram-cli/.env - Install FFmpeg (required for video processing)
Usage:
cd deepgram-cli
./deepgram_cli.py -f audio.mp3 # Generate subtitles for audio
./deepgram_cli.py -f audio.mp3 -t # Generate transcript only
./deepgram_cli.py -v video.mp4 # Generate subtitles for video
./deepgram_cli.py -v /path/to/directory # Process all video files in directory
./deepgram_cli.py -f /path/to/directory # Process all MP3s in directoryVideo Processing Workflow:
When using the -v flag with video files (MP4/WebM/MKV), the tool performs:
- Extracts audio from video using FFmpeg
- Sends audio to Deepgram for transcription
- Generates SRT subtitle file alongside the original video
- Automatically cleans up temporary audio files
- Outputs separate SRT file that can be used with any video player
- mp4len: zsh, ffprobe (from FFmpeg)
- deepgram-cli: Python 3.6+, Deepgram API key, FFmpeg (for video processing)