StreamPack¶
What is StreamPack?¶
StreamPack is a professional-grade tool for converting video files into HLS (HTTP Live Streaming) format with automatic optimization, hardware acceleration support, and dynamic bitrate adjustment. It transforms any video file into adaptive bitrate streams perfect for web streaming, mobile apps, and content delivery networks.
Key Benefits
- 🚀 Automatic optimization - No manual bitrate calculations needed
- ⚡ Hardware acceleration - Uses VideoToolbox, NVENC, QuickSync when available
- 🎯 Intelligent quality - Dynamic bitrate adjustment based on input video
- 🔧 Developer friendly - Clean Python API and comprehensive CLI
Quick Example¶
from streampack import MediaConverter
# Basic conversion
converter = MediaConverter()
results = converter.convert('input.mp4', 'output_directory')
print(f"✅ Conversion completed!")
print(f"📋 Master playlist: {results['master_playlist']}")
print(f"⚡ Processing speed: {results['processing_speed_mbps']:.2f} MB/s")
from streampack import MediaConverter, HLSConfig
# Custom configuration
config = HLSConfig(
segment_duration=4, # 4-second segments
preset='medium', # Better quality
max_workers=6, # Parallel processing
convert_subtitles=True # Include subtitles
)
converter = MediaConverter(config)
results = converter.convert('movie.mp4', 'streaming_output', ['720p', '1080p'])
Key Features¶
🎬 Professional Quality¶
- Adaptive bitrate streaming with multiple quality levels
- Dynamic bitrate adjustment based on input video characteristics
- Intelligent resolution ladder generation for optimal streaming
- Audio track preservation with language detection
- Subtitle conversion to WebVTT format
🚀 High Performance¶
- Hardware encoder detection (VideoToolbox, NVENC, QuickSync, VAAPI, AMF)
- Multi-threaded processing utilizing all CPU cores
- Optimized FFmpeg parameters for streaming performance
- Memory-efficient processing for large video files
- Progress tracking with ETA calculation
🛠️ Developer Experience¶
- Clean class-based architecture for easy integration
- Comprehensive CLI with 20+ options and detailed help
- Rich console logging with beautiful progress bars
- JSON configuration support for reproducible builds
- Extensive documentation and examples
🌐 Cross-Platform¶
- Python 3.8+ support across platforms
- macOS, Windows, Linux compatibility
- Hardware acceleration on all major platforms
- FFmpeg integration with automatic encoder detection
Output Structure¶
StreamPack generates a complete streaming package:
output_directory/
├── master.m3u8 # Master playlist (entry point)
├── 720p/
│ ├── playlist.m3u8 # 720p video playlist
│ ├── chunk_000.ts # Video segments
│ ├── chunk_001.ts
│ └── ...
├── 1080p/
│ ├── playlist.m3u8 # 1080p video playlist
│ ├── chunk_000.ts
│ └── ...
├── audio_english/
│ ├── playlist.m3u8 # English audio playlist
│ ├── chunk_000.ts
│ └── ...
├── audio_spanish/ # Additional language tracks
│ └── ...
├── english.vtt # Subtitle files
├── spanish.vtt
└── ...
Why Choose StreamPack?¶
Feature | StreamPack | Other Tools |
---|---|---|
Automatic Optimization | ✅ Dynamic bitrate adjustment | ❌ Manual configuration required |
Hardware Acceleration | ✅ Auto-detection & fallback | ⚠️ Manual setup needed |
Developer API | ✅ Clean Python classes | ❌ Command-line only |
Progress Tracking | ✅ Rich console with ETA | ❌ Basic or no feedback |
Multi-threading | ✅ Parallel processing | ⚠️ Single-threaded |
Documentation | ✅ Comprehensive docs | ❌ Minimal documentation |
Configuration | ✅ JSON + CLI options | ❌ Limited options |
Subtitle Support | ✅ WebVTT conversion | ⚠️ Basic or missing |
Real-World Use Cases¶
Web Streaming Platform
Convert user uploads to multiple quality levels for adaptive streaming:
Mobile App Backend
Optimize videos for mobile consumption with smaller segments:
Batch Processing Pipeline
Process multiple videos in a content delivery workflow:
Getting Started¶
Ready to start converting videos? Choose your path:
-
Quick Start
Get up and running in 5 minutes with our quick start guide
-
Installation
Install StreamPack via pip or from source
-
CLI Reference
Explore all command-line options and examples
-
Python API
Integrate HLS conversion into your Python applications
Community & Support¶
- 📖 Documentation: Comprehensive guides and API reference
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 🤝 Contributing: See our Contributing Guide
*Star this project on [GitHub](https://github.com/aniketsarkar/streampack) if you find it useful!*