Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Jan 18, 2026

Summary

Enhances the SaveVideo node with dynamic codec-specific encoding options using DynamicCombo.

Depends on: #11939

Changes

SaveVideo Node Enhancements

  • Uses DynamicCombo for codec selection (auto/h264/vp9)
  • When selecting h264 or vp9, quality and speed inputs appear dynamically
  • Each codec has unique advanced options (hidden by default with advanced=True):
    • h264: Profile (baseline/main/high), Tune (film/animation/grain/etc.)
    • vp9: Row Multi-threading, Tile Columns

New Types

  • VideoSpeedPreset enum with user-friendly names (Fastest, Fast, Balanced, Quality, Best)
  • quality_to_crf() helper function mapping 0-100 quality to codec-appropriate CRF values

Video Encoding

  • Updated VideoFromComponents.save_to() and VideoFromFile.save_to() to accept new parameters
  • Quality maps to CRF internally (h264: 12-40, vp9: 15-50)
  • Speed presets map to FFmpeg presets

Major changes:
- SaveVideo now uses DynamicCombo to show codec-specific encoding options
- When selecting h264 or vp9, quality and speed inputs appear dynamically
- Each codec has unique ADVANCED options (shown in 'Show Advanced' section):
  - h264: Profile (baseline/main/high), Tune (film/animation/grain/etc.)
  - vp9: Row Multi-threading, Tile Columns
- Quality maps to CRF internally with codec-appropriate ranges
- Speed presets map to FFmpeg presets

New types:
- VideoSpeedPreset enum with user-friendly names
- quality_to_crf() helper function

This demonstrates both DynamicCombo (codec-specific inputs) and advanced
widgets (profile/tune/row_mt/tile_columns hidden by default).

Amp-Thread-ID: https://ampcode.com/threads/T-019bce44-e743-7349-8bad-d3027d456fb1
Co-authored-by: Amp <amp@ampcode.com>
@christian-byrne christian-byrne marked this pull request as draft January 18, 2026 01:23
@christian-byrne christian-byrne added preview-cpu Creates a preview ephemeral environment for this PR (CPU only) and removed preview-cpu Creates a preview ephemeral environment for this PR (CPU only) labels Jan 18, 2026
Wrap VideoSpeedPreset conversion in try/except to gracefully handle
invalid speed_str values instead of raising unhandled ValueError.
Logs warning and falls back to None (default) on failure.
Replace silent fallback to libx264 with explicit validation that raises
ValueError for unknown codec types. Prevents silent codec substitution.
- Remove redundant pix_fmt assignment (set once instead of in both branches)
- Remove unnecessary VideoContainer.AUTO check (format already normalized)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview-cpu Creates a preview ephemeral environment for this PR (CPU only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants