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
Comprehensive Testing
All listed formats are thoroughly tested with automated test suites covering chunking, keyframe alignment, roundtrip integrity, and Git operations on video files.
| Format | Container | Keyframe Aligned | Testing Status | Notes |
|---|---|---|---|---|
| H.264/AVC | MP4, MOV, MKV, AVI | Full | Tested | All profiles, levels, GOP patterns |
| H.265/HEVC | MP4, MOV, MKV | Full | Tested | HDR10, HLG, Dolby Vision support |
| ProRes | MOV | Full | Tested | All variants: 422, 4444, HQ, LT, XQ |
| DNxHR/DNxHD | MOV, MXF | Full | Tested | All resolutions and frame rates |
| CineForm | MOV, AVI | Full | Tested | GoPro CineForm RAW support |
| AVID DNx | MXF, MOV | Full | Tested | All DNx variants and MXF structures |
| MXF | MXF | Full | Tested | OP1a, OP-Atom, AS-02, IMF support |
| RED RAW | R3D | Partial | Testing | Frame-level chunking, metadata preserved |
| ARRIRAW | ARI | Partial | Testing | Uncompressed raw support |
| XAVC | MXF, MP4 | Full | Tested | Sony professional codec support |
| AVC-Intra | MXF, MOV | Full | Tested | All-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 keyframesBenefits
- 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]Protected Metadata
Dits never chunks through the
moov atom. Splitting metadata would render the file unplayable. Only the mdat(media data) section is chunked.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 MBFrame-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 = 8MBPer-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 = trueWorking 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:30Performance Tips
- Use proxy files: Work with proxies, keep masters in repository
- Organize by scene: Related footage deduplicates better when together
- Commit logically: Color grade all related clips together for better delta efficiency
- Use sparse checkout: Only hydrate the clips you're actively editing