A web application that uses Kaltura and AWS Bedrock (Claude 3) to analyze videos and enable interactive conversations with their content. The application provides video analysis, topic extraction, and AI-powered chat capabilities.
-
Video Management
- Search Kaltura videos by category or text
- Browse recent videos with thumbnails and descriptions
- Multi-video selection for batch analysis
-
AI Analysis
- Deep content analysis using AWS Bedrock (Claude 3)
- Topic extraction and importance scoring
- Key moment detection with timestamps
- Comprehensive video summaries
-
Interactive Interface
- Clean, responsive design using PicoCSS
- Tabbed analysis view (Summary, Insights, Topics, Key Moments)
- Interactive topic visualization
- Video segment preview with thumbnails
- Real-time chat with video content
- Dark theme support
- Python 3.9 or higher
- Kaltura account with API access
- AWS account with Bedrock access (Claude 3 model)
- Clone the repository:
git clone [your-repo-url]
cd video-explorer
- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Set up configuration:
cp .env.example .env
Edit .env
with your credentials:
- Get Kaltura credentials from your Kaltura Management Console
- Get AWS credentials with Bedrock access from AWS Console
- Run the application:
python main.py
- Open http://localhost:8000 in your browser
The .env
file supports the following configuration options:
# Kaltura Configuration
KALTURA_PARTNER_ID=your_partner_id
KALTURA_SECRET=your_secret_key
KALTURA_SERVICE_URL=https://cdnapisec.kaltura.com
KALTURA_SESSION_DURATION=86400
# AWS Configuration
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1 # Region where Bedrock is available
# Server Configuration
HOST=0.0.0.0
PORT=8000
# Analysis Configuration
MODEL_ID=anthropic.claude-3-sonnet-20240229-v1:0
MODEL_TIMEOUT=60
MODEL_MAX_TOKENS=4000
MODEL_CHUNK_SIZE=24000
MODEL_TEMPERATURE=0
PAGE_SIZE=10
# Logging Configuration
LOG_LEVEL=INFO # Main application log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
KALTURA_LOG_LEVEL=WARNING # Kaltura client log level
AWS_LOG_LEVEL=WARNING # AWS/boto3 log level
HTTP_LOG_LEVEL=WARNING # HTTP client log level
LITELLM_LOG_LEVEL=WARNING # LiteLLM log level
- Python: Core application runtime
- Kaltura API: Video content management and delivery
- AWS Bedrock: AI analysis using Claude 3 model
- litellm: LLM integration layer
- instructor: Structured outputs from LLM responses
- HTML/JavaScript: Pure JavaScript for interactivity
- PicoCSS: Minimal, semantic CSS framework
- Responsive Design: Mobile-first approach
- Dynamic UI: Real-time updates and animations
The application uses a robust, configurable logging system with the following features:
- Color-coded log levels: Different colors for DEBUG, INFO, WARNING, ERROR, and CRITICAL logs
- Timestamps: Precise timestamps for each log entry
- Source location: File names and line numbers for easy debugging
- Configurable levels: Separate log levels for main application and third-party libraries
- Structured format: Consistent log format across all components
- Third-party integration: Controlled logging for Kaltura, AWS, HTTP, and LiteLLM
Example log output:
2024-03-20 10:15:30.123 [INFO] main:125 - Starting video analysis...
2024-03-20 10:15:30.456 [DEBUG] kaltura_utils:89 - Successfully retrieved video metadata
2024-03-20 10:15:31.789 [WARNING] main:256 - Processing delay detected
2024-03-20 10:15:32.012 [ERROR] main:789 - Failed to process video segment
- Parallel processing of video analysis
- Intelligent chunking for long videos
- In-memory caching of analysis results
- Real-time progress tracking
- Structured AI responses for consistent output
- Comprehensive logging system
GET /
: Main application interfaceGET /api/videos
: Search and list videosPOST /api/analyze
: Analyze selected videosGET /api/analysis-progress/{task_id}
: Check analysis progressPOST /api/chat
: Chat with analyzed video content
# Run with auto-reload
python main.py
video-explorer/
├── main.py # Application logic and API endpoints
├── kaltura_utils.py # Kaltura integration utilities
├── logger_config.py # Logging configuration
├── static/
│ └── style.css # Application styling
├── templates/
│ └── index.html # Frontend interface
└── requirements.txt # Python dependencies
- Chrome/Edge (latest 2 versions)
- Firefox (latest 2 versions)
- Safari (latest 2 versions)
- Mobile browsers (iOS Safari, Android Chrome)
Contributions are welcome! Please feel free to submit a Pull Request.
- 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
This project is licensed under the MIT License - see the LICENSE file for details.