Skip to content

Add configurable spec compliance mode for track property validation #64

@TimGels

Description

@TimGels

Problem

The current UI allows setting properties that violate the Matroska specification:

Current UI Issues:

  • Audio tracks show "Forced Flag" option (spec: forced applies only to subtitles)
  • Video tracks show "Forced Flag" option (spec: forced applies only to subtitles)
  • Subtitle tracks missing "Default Flag" option (spec: default applies to all track types)

Specification vs Implementation:

Property Matroska Spec v4 mkvpropedit Tool
FlagDefault (0x88) Valid for audio/subtitle/video track types Accepts for all track types ✓
FlagForced (0x55AA) "Applies only to subtitles" Accepts for all track types ⚠️

References:

Root Cause

mkvpropedit is intentionally permissive - it's a low-level EBML editing tool that doesn't enforce semantic rules. It allows setting any valid EBML element regardless of spec semantics.

Players ignore semantically invalid flags - Even if you set f lag-forced on an audio track, players won't honor it because the spec says it only applies to subtitles.

Proposed Solution

Add a Spec Compliance Mode setting with two options:

Option 1: "Strict (Spec-Compliant)" [DEFAULT] ✅

  • Follow Matroska v4 specification semantics
  • Show only spec-valid properties per track type:
    • Audio: Default flag, Language, Track name, Codec
    • Video: Default flag, Language, Track name, Codec
    • Subtitle: Default flag, Forced flag, Language, Track name, Codec

Benefits:

  • Guides users toward correct usage
  • Produces files that players handle as expected
  • Prevents confusion about why forced flags don't work on audio/video

Option 2: "Permissive (Tool-Compatible)" ⚠️

  • Match mkvpropedit's capabilities exactly
  • Show all properties for all track types (regardless of spec)
  • For advanced users who know what they're doing

Benefits:

  • Maximum flexibility
  • Allows edge cases (legacy files, experimental usage)
  • Matches underlying tool capabilities

UI Changes Required

  1. SettingsPage.xaml - Add new setting:

    <ComboBox Header="Spec Compliance Mode">
      <ComboBoxItem Content="Strict (Spec-Compliant) [Recommended]" IsSelected="True"/>
      <ComboBoxItem Content="Permissive (Tool-Compatible)"/>
    </ComboBox>
  2. Track Validation UI - Conditionally show/hide properties based on mode:

    • Audio Track section (lines 163-224): Hide "Forced Flag" in Strict mode
    • Video Track section (lines 226-268): Hide "Forced Flag" in Strict mode
    • Subtitle Track section (lines 270+): Add "Default Flag" (show in both modes)
  3. Models - Add to \ValidationSettings.cs:

    public enum SpecComplianceMode
    {
        Strict,      // Spec-compliant (default)
        Permissive   // Tool-compatible
    }
    
    public SpecComplianceMode ComplianceMode { get; set; } = SpecComplianceMode.Strict;

Implementation Considerations

  1. Default behavior: Strict mode should be default to guide users correctly
  2. Warning text: Show info icon explaining what each mode means
  3. Backward compatibility: Existing user settings remain valid in both modes
  4. Validation: All existing validation rules work in both modes (they check consistency, not spec compliance)
  5. Command generation: Both modes generate valid mkvpropedit commands (tool accepts both)

Scope

This is a UI/configuration enhancement only:

  • ✅ Affects which properties are shown in Settings page
  • ✅ Affects which validation severities user can configure
  • ❌ Does NOT affect validation rules (they already work correctly)
  • ❌ Does NOT affect command generation (mkvpropedit accepts both)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions