Video Transcoding
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Video transcoding converts videos to different formats, resolutions, and bitrates. This guide covers FFmpeg, cloud services, and optimization for building video processing pipelines that create multiple quality levels for adaptive streaming.
Why This Matters
Video transcoding is critical for video platforms as it directly impacts:
- User Experience: Adaptive streaming across network conditions
- Cost: Optimized file sizes reduce bandwidth/storage costs
- Compatibility: Support for various devices and platforms
- Quality: Consistent quality across all content
Core Concepts
- Codecs: H.264, H.265 (HEVC), VP9, AV1
- Resolution: 1080p, 720p, 480p, 360p
- Bitrate: Quality vs file size trade-off
- CRF (Constant Rate Factor): Quality control
- Two-pass Encoding: Precise bitrate control
- Hardware Acceleration: GPU-based encoding
- Adaptive Streaming: Multiple quality levels
Inputs / Outputs / Contracts
Skill Composition
- Depends on: None
- Compatible with: None
- Conflicts with: None
- Related Skills: None
Quick Start / Implementation Example
- Review requirements and constraints
- Set up development environment
- Implement core functionality following patterns
- Write tests for critical paths
- Run tests and fix issues
- Document any deviations or decisions
# Example implementation following best practices
def example_function():
# Your implementation here
pass
Assumptions
- Sufficient storage for temporary files
- FFmpeg installed and accessible
- Network connectivity for cloud services
- Hardware acceleration available (optional)
Compatibility
| Codec |
Browser Support |
Mobile |
Hardware |
| H.264 |
Excellent |
Excellent |
Excellent |
| H.265 |
Good |
Good |
Good |
| VP9 |
Good |
Limited |
Limited |
| AV1 |
Limited |
Limited |
Limited |
Test Scenario Matrix (QA Strategy)
| Type |
Focus Area |
Required Scenarios / Mocks |
| Unit |
Core Logic |
Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration |
DB / API |
All external API calls or database connections must be mocked during unit tests |
| E2E |
User Journey |
Critical user flows to test |
| Performance |
Latency / Load |
Benchmark requirements |
| Security |
Vuln / Auth |
SAST/DAST or dependency audit |
| Frontend |
UX / A11y |
Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives
- Always create multiple resolutions for adaptive streaming
- Use CRF for quality control
- Enable hardware acceleration when available
- Monitor transcoding jobs for failures
- Clean up temporary files after processing
- Use queues for async processing
Definition of Done (DoD) Checklist
Anti-patterns / Pitfalls
- ⛔ Don't: Log PII, catch-all exception, N+1 queries
- ⚠️ Watch out for: Common symptoms and quick fixes
- 💡 Instead: Use proper error handling, pagination, and logging
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: video-transcoding3description: Video transcoding converts videos to different formats, resolutions, Use when this capability is needed.4---56# Video Transcoding78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Video transcoding converts videos to different formats, resolutions, and bitrates. This guide covers FFmpeg, cloud services, and optimization for building video processing pipelines that create multiple quality levels for adaptive streaming.1819## Why This Matters20Video transcoding is critical for video platforms as it directly impacts:21- **User Experience**: Adaptive streaming across network conditions22- **Cost**: Optimized file sizes reduce bandwidth/storage costs23- **Compatibility**: Support for various devices and platforms24- **Quality**: Consistent quality across all content2526---2728## Core Concepts291. **Codecs**: H.264, H.265 (HEVC), VP9, AV1302. **Resolution**: 1080p, 720p, 480p, 360p313. **Bitrate**: Quality vs file size trade-off324. **CRF (Constant Rate Factor)**: Quality control335. **Two-pass Encoding**: Precise bitrate control346. **Hardware Acceleration**: GPU-based encoding357. **Adaptive Streaming**: Multiple quality levels3637## Inputs / Outputs / Contracts38#3940## Skill Composition41* **Depends on**: None42* **Compatible with**: None43* **Conflicts with**: None44* **Related Skills**: None4546## Quick Start / Implementation Example47481. Review requirements and constraints492. Set up development environment503. Implement core functionality following patterns514. Write tests for critical paths525. Run tests and fix issues536. Document any deviations or decisions5455```python56# Example implementation following best practices57def example_function():58 # Your implementation here59 pass60```616263## Assumptions64- Sufficient storage for temporary files65- FFmpeg installed and accessible66- Network connectivity for cloud services67- Hardware acceleration available (optional)6869## Compatibility70| Codec | Browser Support | Mobile | Hardware |71|-------|-----------------|---------|-----------|72| H.264 | Excellent | Excellent | Excellent |73| H.265 | Good | Good | Good |74| VP9 | Good | Limited | Limited |75| AV1 | Limited | Limited | Limited |7677---7879## Test Scenario Matrix (QA Strategy)8081| Type | Focus Area | Required Scenarios / Mocks |82| :--- | :--- | :--- |83| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |84| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |85| **E2E** | User Journey | Critical user flows to test |86| **Performance** | Latency / Load | Benchmark requirements |87| **Security** | Vuln / Auth | SAST/DAST or dependency audit |88| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |899091## Technical Guardrails & Security Threat Model9293### 1. Security & Privacy (Threat Model)94* **Top Threats**: Injection attacks, authentication bypass, data exposure95- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII96- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager97- [ ] **Authorization**: Validate user permissions before state changes9899### 2. Performance & Resources100- [ ] **Execution Efficiency**: Consider time complexity for algorithms101- [ ] **Memory Management**: Use streams/pagination for large data102- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks103104### 3. Architecture & Scalability105- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection106- [ ] **Modularity**: Decouple logic from UI/Frameworks107108### 4. Observability & Reliability109- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`110- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`111- [ ] **Error Handling**: Standardized error codes, no bare except112- [ ] **Observability Artifacts**:113 - **Log Fields**: timestamp, level, message, request_id114 - **Metrics**: request_count, error_count, response_time115 - **Dashboards/Alerts**: High Error Rate > 5%116117118## Agent Directives1191. Always create multiple resolutions for adaptive streaming1202. Use CRF for quality control1213. Enable hardware acceleration when available1224. Monitor transcoding jobs for failures1235. Clean up temporary files after processing1246. Use queues for async processing125126## Definition of Done (DoD) Checklist127128- [ ] Tests passed + coverage met129- [ ] Lint/Typecheck passed130- [ ] Logging/Metrics/Trace implemented131- [ ] Security checks passed132- [ ] Documentation/Changelog updated133- [ ] Accessibility/Performance requirements met (if frontend)134135136## Anti-patterns / Pitfalls137138* ⛔ **Don't**: Log PII, catch-all exception, N+1 queries139* ⚠️ **Watch out for**: Common symptoms and quick fixes140* 💡 **Instead**: Use proper error handling, pagination, and logging141142143## Reference Links & Examples144145* Internal documentation and examples146* Official documentation and best practices147* Community resources and discussions148149150## Versioning & Changelog151152* **Version**: 1.0.0153* **Changelog**:154 - 2026-02-22: Initial version with complete template structure155156---157> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.158<!-- tomevault:4.0:skill_md:2026-04-13 -->