Professional video processing pipeline with AI analysis, 360° processing, and adaptive streaming capabilities. ✨ Core Features: • AI-powered content analysis with scene detection and quality assessment • Next-generation codec support (AV1, HEVC, HDR10) • Adaptive streaming (HLS/DASH) with smart bitrate ladders • Complete 360° video processing with multiple projection support • Spatial audio processing (Ambisonic, binaural, object-based) • Viewport-adaptive streaming with up to 75% bandwidth savings • Professional testing framework with video-themed HTML dashboards 🏗️ Architecture: • Modern Python 3.11+ with full type hints • Pydantic-based configuration with validation • Async processing with Procrastinate task queue • Comprehensive test coverage with 11 detailed examples • Professional documentation structure 🚀 Production Ready: • MIT License for open source use • PyPI-ready package metadata • Docker support for scalable deployment • Quality assurance with ruff, mypy, and pytest • Comprehensive example library From simple encoding to immersive experiences - complete multimedia processing platform for modern applications.
58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
"""Tests for configuration module."""
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
from pydantic import ValidationError
|
|
|
|
from video_processor.config import ProcessorConfig
|
|
|
|
|
|
def test_default_config():
|
|
"""Test default configuration values."""
|
|
config = ProcessorConfig()
|
|
|
|
assert config.storage_backend == "local"
|
|
assert config.output_formats == ["mp4"]
|
|
assert config.quality_preset == "medium"
|
|
assert config.thumbnail_timestamps == [1]
|
|
assert config.generate_sprites is True
|
|
|
|
|
|
def test_config_validation():
|
|
"""Test configuration validation."""
|
|
# Test empty output formats
|
|
with pytest.raises(ValidationError):
|
|
ProcessorConfig(output_formats=[])
|
|
|
|
# Test valid formats
|
|
config = ProcessorConfig(output_formats=["mp4", "webm", "ogv"])
|
|
assert len(config.output_formats) == 3
|
|
|
|
|
|
def test_base_path_resolution():
|
|
"""Test base path is resolved to absolute path."""
|
|
relative_path = Path("relative/path")
|
|
config = ProcessorConfig(base_path=relative_path)
|
|
|
|
assert config.base_path.is_absolute()
|
|
|
|
|
|
def test_custom_config():
|
|
"""Test custom configuration values."""
|
|
config = ProcessorConfig(
|
|
storage_backend="local",
|
|
base_path=Path("/custom/path"),
|
|
output_formats=["mp4", "webm"],
|
|
quality_preset="high",
|
|
thumbnail_timestamps=[1, 30, 60],
|
|
generate_sprites=False,
|
|
)
|
|
|
|
assert config.storage_backend == "local"
|
|
assert config.base_path == Path("/custom/path").resolve()
|
|
assert config.output_formats == ["mp4", "webm"]
|
|
assert config.quality_preset == "high"
|
|
assert config.thumbnail_timestamps == [1, 30, 60]
|
|
assert config.generate_sprites is False
|