Skip to main content
Documentation

Video Features

Dits is built from the ground up to handle video files efficiently, with comprehensive support for 15+ video formats, format-aware chunking, keyframe alignment, and video-specific metadata. All video features are thoroughly tested with automated tests.

Why Video Needs Special Handling

Video files present unique challenges for version control:

  • Size: Single files can be gigabytes or terabytes
  • Binary format: Can't be diffed like text files
  • Temporal structure: Changes are often localized in time
  • Container format: Metadata and media are interleaved
Keyframe Alignment
Chunk boundaries align to video keyframes (I-frames), making each chunk independently decodable.
Container Awareness
Dits understands MP4/MOV/MXF structure and never splits critical metadata atoms across chunks.
Temporal Diff
See differences in terms of timecode and frames, not just bytes and chunks.

Supported Video Formats

FormatContainerKeyframe AlignedTesting StatusNotes
H.264/AVCMP4, MOV, MKV, AVI Full TestedAll profiles, levels, GOP patterns
H.265/HEVCMP4, MOV, MKV Full TestedHDR10, HLG, Dolby Vision support
ProResMOV Full TestedAll variants: 422, 4444, HQ, LT, XQ
DNxHR/DNxHDMOV, MXF Full TestedAll resolutions and frame rates
CineFormMOV, AVI Full TestedGoPro CineForm RAW support
AVID DNxMXF, MOV Full TestedAll DNx variants and MXF structures
MXFMXF Full TestedOP1a, OP-Atom, AS-02, IMF support
RED RAWR3D Partial TestingFrame-level chunking, metadata preserved
ARRIRAWARI Partial TestingUncompressed raw support
XAVCMXF, MP4 Full TestedSony professional codec support
AVC-IntraMXF, MOV Full TestedAll-Intra variants supported

Keyframe-Aligned Chunking

Dits analyzes video files to find keyframe positions and aligns chunk boundaries to these natural breakpoints:

Video Structure:
Timeline:  |-------|-------|-------|-------|-------|
           I   P P P I   P P P I   P P P I   P P P
           ↑         ↑         ↑         ↑
        Keyframes (chunk boundaries)

Regular CDC might split here:
           I   P P P I   P|P P I   P P P I   P P P
                         ↑
                    Bad split (mid-GOP)

Keyframe-aligned splits here:
           I   P P P|I   P P P|I   P P P|I   P P P
                    ↑         ↑         ↑
              Aligned to keyframes

Benefits

  • Faster seeking: Each chunk can be decoded independently
  • Better streaming: Start playback from any chunk
  • Efficient VFS: Only fetch visible time ranges
  • Better deduplication: Similar clips align naturally

Container-Aware Parsing

Dits understands the structure of video containers and handles them appropriately:

MP4/MOV Structure (ISOBMFF)

MP4/MOV File:
├── ftyp (file type)          ← Keep together
├── moov (metadata)           ← NEVER split
│   ├── mvhd (movie header)
│   ├── trak (track)
│   │   ├── tkhd
│   │   ├── mdia
│   │   │   └── stbl (sample table)
│   │   │       └── stss (keyframe index)
└── mdat (media data)         ← Chunk this part
    └── [video/audio samples]

Video-Aware Diff

See differences between video versions in terms of time, not just bytes:

$ dits diff --video-aware HEAD~1 HEAD -- scene1.mov

footage/scene1.mov:
  Duration: 5:00.00 (unchanged)
  Resolution: 1920x1080 (unchanged)
  Codec: ProRes 422 HQ (unchanged)

  Changed segments:
    00:45.00 - 01:12.00 (27 seconds)
      → Color grading applied
      → 810 frames affected
      → 3 chunks modified

    03:22.00 - 03:45.00 (23 seconds)
      → Cut extended
      → 690 frames affected
      → 2 chunks modified

  Summary:
    Total changed: 50 seconds of 300 seconds (16.7%)
    Chunks changed: 5 of 312 (1.6%)
    Storage delta: +45 MB

Frame-Level Analysis

$ dits diff --video-aware --frame-level HEAD~1 HEAD -- scene1.mov

Frame analysis:
  Frame 1350 (00:45.00): Modified (color values changed)
  Frame 1351 (00:45.04): Modified
  Frame 1352 (00:45.08): Modified
  ...
  Frame 1890 (01:12.00): Last modified frame

Statistics:
  Identical frames: 7,500
  Modified frames: 1,500
  Modification ratio: 16.7%

Video Metadata

Dits extracts and indexes video metadata for efficient operations:

$ dits show --video-info HEAD:footage/scene1.mov

Video Information:
  Duration:     5:00.00 (300 seconds)
  Resolution:   1920x1080
  Frame Rate:   23.976 fps
  Codec:        ProRes 422 HQ
  Bit Rate:     220 Mbps
  Total Frames: 7,193

  Audio:
    Channels:   2 (stereo)
    Sample Rate: 48000 Hz
    Codec:      PCM 24-bit

  Keyframes:
    Count: 312
    Interval: ~0.96 seconds (GOP ~24 frames)

  Dits Info:
    Chunks: 312
    Chunk Size: 32 MB average
    Dedup Potential: 15% (similar to scene2.mov)

Optimizing for Video

Configuration

# .dits/config
[media]
    # Enable keyframe-aligned chunking
    keyframeAligned = true

    # Video file extensions
    videoExtensions = mp4,mov,mxf,avi,mkv,prores

    # Chunk size for video (larger = more efficient)
    videoChunkSize = 32MB

    # Parse video metadata on add
    extractMetadata = true

[chunking]
    # For ProRes/DNxHR, use larger chunks
    minChunkSize = 512KB
    avgChunkSize = 2MB
    maxChunkSize = 8MB

Per-File Attributes

# .ditsattributes
# Large format video files
*.mxf chunk=video-large
*.mov chunk=video-large

# Highly compressed video
*.mp4 chunk=video-compressed

# RAW footage (frame-based chunking)
*.r3d chunk=raw-video
*.braw chunk=raw-video

# Define chunk profiles
[chunk "video-large"]
    min = 1MB
    avg = 4MB
    max = 16MB
    keyframeAlign = true

[chunk "video-compressed"]
    min = 256KB
    avg = 1MB
    max = 4MB
    keyframeAlign = true

Working with NLE Projects

Dits can also parse NLE project files:

# Supported project formats
- Premiere Pro (.prproj)
- DaVinci Resolve (.drp)
- Final Cut Pro (.fcpxml)
- After Effects (.aep)

# Show project dependencies
$ dits show --project-info project.prproj

Project: project.prproj
  Created: 2024-01-15
  Modified: 2024-01-18

  Media References:
    footage/scene1.mov   ✓ Present
    footage/scene2.mov   ✓ Present
    audio/music.wav      ✓ Present
    graphics/logo.png    ✗ Missing!

  Sequences: 3
  Total Duration: 15:30

Performance Tips

  1. Use proxy files: Work with proxies, keep masters in repository
  2. Organize by scene: Related footage deduplicates better when together
  3. Commit logically: Color grade all related clips together for better delta efficiency
  4. Use sparse checkout: Only hydrate the clips you're actively editing

Related Topics