ruvnet/RuView · error · ValueError

FPS must be between 1 and 60

Error message

FPS must be between 1 and 60

What it means

Pydantic v1 @validator on StreamingConfig.fps in archive/v1/src/config/domains.py. It enforces 1 <= fps <= 60 and the field is typed int (default 30). Values outside the range raise ValueError, surfaced as pydantic.ValidationError during StreamingConfig construction or when loading the 'streaming' section of a domain config file.

Source

Thrown at archive/v1/src/config/domains.py:215

    
    # Compression settings
    compression_enabled: bool = Field(default=True, description="Enable compression")
    compression_level: int = Field(default=5, description="Compression level (1-9)")
    
    # WebSocket settings
    ping_interval: int = Field(default=60, description="Ping interval in seconds")
    timeout: int = Field(default=300, description="Connection timeout in seconds")
    max_connections: int = Field(default=100, description="Maximum concurrent connections")
    
    # Data filtering
    min_confidence: float = Field(default=0.5, description="Minimum confidence for streaming")
    include_metadata: bool = Field(default=True, description="Include metadata in stream")
    
    @validator("fps")
    def validate_fps(cls, v):
        """Validate FPS value."""
        if not 1 <= v <= 60:
            raise ValueError("FPS must be between 1 and 60")
        return v
    
    @validator("compression_level")
    def validate_compression_level(cls, v):
        """Validate compression level."""
        if not 1 <= v <= 9:
            raise ValueError("Compression level must be between 1 and 9")
        return v


class AlertConfig(BaseModel):
    """Configuration for alerts and notifications."""
    
    # Alert types
    enable_pose_alerts: bool = Field(default=False, description="Enable pose-based alerts")
    enable_activity_alerts: bool = Field(default=False, description="Enable activity-based alerts")
    enable_zone_alerts: bool = Field(default=False, description="Enable zone-based alerts")
    enable_system_alerts: bool = Field(default=True, description="Enable system alerts")

View on GitHub (pinned to 4685618388)

Solutions

  1. Set fps to an integer within 1-60 (e.g., 30 or 60)
  2. For fractional rates, pick the nearest supported integer (29.97 -> 30)
  3. To disable streaming, use the service lifecycle (do not start it) rather than fps=0
  4. If >60 fps is a hard requirement, change the validator bound and verify the pipeline actually sustains it

Example fix

# before
streaming = StreamingConfig(fps=0)

# after
streaming = StreamingConfig(fps=30)
Defensive patterns

Strategy: validation

Validate before calling

fps = cfg.get("fps", 30)
assert isinstance(fps, int) and 1 <= fps <= 60, f"fps must be int in 1-60, got {fps!r}"

Type guard

def is_valid_fps(v) -> bool:
    return isinstance(v, int) and not isinstance(v, bool) and 1 <= v <= 60

Try / catch

from pydantic import ValidationError
try:
    streaming = StreamingConfig(**cfg["streaming"])
except ValidationError as e:
    if any(err["loc"][-1] == "fps" for err in e.errors()):
        raise ValueError("streaming.fps must be an integer between 1 and 60") from e
    raise

Prevention

When it happens

Trigger: fps=0 (attempting to disable streaming); fps=120 (high-framerate camera setups); fps values above 60 for smoother playback; fractional rates like 29.97 rejected or coerced because the field is int, not float.

Common situations: Porting broadcast/camera configs that assume NTSC 29.97 fps; trying to pause a stream by setting fps to 0; performance tuning that raises fps without knowing the cap.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/3e2df6d550f421c7. Report an issue: GitHub.