--- name: debug-ffmpeg description: Debug FFmpeg integration and video/audio processing issues. Use when the user encounters FFmpeg errors, audio extraction problems, codec issues, or video processing failures. --- # Debug FFmpeg Skill Troubleshoot FFmpeg-related issues in the video processing pipeline. ## What This Skill Does This skill helps diagnose and fix FFmpeg integration problems through systematic debugging: 1. **Verify FFmpeg Installation**: Check if FFmpeg is accessible and version 2. **Test FFmpeg Commands**: Run diagnostic commands to validate functionality 3. **Analyze Video Files**: Inspect video file properties, codecs, and streams 4. **Debug Processing Errors**: Identify specific issues in video/audio extraction 5. **Provide Solutions**: Offer concrete fixes for common FFmpeg problems ## Diagnostic Steps When invoked, this skill follows this troubleshooting workflow: ### 1. Verify FFmpeg Accessibility ```bash ffmpeg -version ``` Check for: - FFmpeg version and build date - Configuration flags and enabled libraries - Supported codecs and formats ### 2. Inspect Video File Properties For a given video file: ```bash ffmpeg -i ``` This reveals: - Container format (MP4, MKV, AVI, etc.) - Video codec (H.264, H.265, VP9, etc.) - Audio codec (AAC, MP3, Opus, etc.) - Duration, bitrate, resolution - Stream mapping and metadata ### 3. Test Audio Extraction Verify audio can be extracted properly: ```bash ffmpeg -i -vn -acodec pcm_s16le -ar 16000 -ac 1 test_output.wav ``` Parameters: - `-vn`: No video (audio only) - `-acodec pcm_s16le`: 16-bit PCM audio - `-ar 16000`: 16kHz sample rate (Whisper compatible) - `-ac 1`: Mono audio ### 4. Test Video Stream Extraction Check if video streams can be extracted: ```bash ffmpeg -i -an -vcodec copy test_output.mp4 ``` ### 5. Review Processing Logs Check application logs for FFmpeg errors: - Console output from `python cli.py process` - Log files in the project directory - Error messages in transcription pipeline ## Common Issues and Solutions ### FFmpeg Not Found **Symptoms:** - "FFmpeg command not found" - "No such file or directory" - Pipeline fails at audio extraction **Solutions:** - Verify FFmpeg is in system PATH: `which ffmpeg` (Linux/Mac) or `where ffmpeg` (Windows) - Check FFmpeg installation: `ffmpeg -version` - Install/reinstall FFmpeg if missing - Use absolute path in configuration ### Audio Extraction Fails **Symptoms:** - Empty or corrupt audio files - "Invalid data found when processing input" - Zero-byte output files **Solutions:** - Check if video has audio stream: `ffmpeg -i