# 4K HDR Quick Reference Card ## 🎬 New Feature Summary | Feature | Status | Details | |---------|--------|---------| | `--r 2160` flag | βœ… NEW | Enable 4K/HDR mode with source validation | | HDR detection | βœ… NEW | Auto-detects BT.2020 + SMPTE2084 color space | | 8-channel audio | βœ… NEW | Allowed on 4K (max for 2160p) | | High bitrate (640k) | βœ… NEW | Available for 4K multi-channel audio | | Color profiles | βœ… NEW | HDR10 flags applied to ffmpeg output | | Default 4K downscale | βœ… UNCHANGED | Still downscales to 1080p without flag | | 720p/1080p audio | βœ… UNCHANGED | Logic preserved as-is | --- ## ⚑ Quick Commands ### Enable 4K Processing ```bash python main.py "path\to\4k" --r 2160 ``` ### Test 4K File (15 min) ```bash python main.py "path\to\4k" --r 2160 --test ``` ### Batch Process Mixed Content ```bash python main.py --paths-file batch.txt # batch.txt: # P:\4k_content --r 2160 # P:\1080p_content --r 1080 ``` ### With CQ Override ```bash python main.py "path\to\4k" --r 2160 --cq 25 ``` --- ## πŸ” Detection Logic ### When Processing with `--r 2160` ``` Source Resolution | Decision | Output ───────────────────────────────────────────────────── β‰₯ 2160p (4K+) | βœ… Process 4K | 4K output < 2160p (1080p, etc) | ⏭️ SKIP | Not encoded ``` ### HDR Detection ``` Color Space | Transfer | HDR? | Notes ───────────────────────────────────────────────────── BT.2020 | SMPTE2084 (PQ) | βœ… | HDR10 BT.2020 | Other | ❌ | 4K SDR rec709 | Any | ❌ | Standard ``` --- ## πŸ“Š Audio Channel Limits ``` Resolution β”‚ Max Channels β”‚ Examples ─────────────┼──────────────┼───────────────────────── 720p β”‚ 2 β”‚ Stereo only 1080p β”‚ 6 β”‚ 5.1, 6.0, reduced 7.1β†’6 4K (2160p) β”‚ 8 β”‚ 7.1, 8 channels, full ``` --- ## πŸ’Ύ Audio Bitrate Caps ``` Resolution β”‚ Stereo (2ch) β”‚ Multi-ch (6ch) β”‚ Multi-ch (8ch) ─────────────┼───────────────┼────────────────┼────────────── 720p β”‚ 192 kbps β”‚ β€” β”‚ β€” 1080p β”‚ 192 kbps β”‚ 448 kbps max β”‚ β€” 4K β”‚ 192 kbps β”‚ 640 kbps max β”‚ 640 kbps max ``` --- ## πŸŽ₯ Encoder Selection (Auto) ``` Source Bit Depth | Selected Encoder | Profile ────────────────────────────────────────────────── ≀ 8-bit | AV1 NVENC | 8-bit yuv420p β‰₯ 10-bit | HEVC NVENC | 10-bit p010le ``` --- ## 🌈 HDR Color Profile Application When HDR detected and source is 4K: ``` ffmpeg flags added: -color_space bt2020_ncl (BT.2020 color space) -color_primaries bt2020 (BT.2020 primaries) -color_trc smpte2084 (PQ tone mapping) ``` Result: **HDR10 compatible output** --- ## βœ… Validation Flow ``` --r 2160 specified? ↓ YES β†’ Check source height β‰₯ 2160p? β”‚ ↓ β”‚ YES β†’ βœ… Process as 4K β”‚ β”‚ Detect HDR β”‚ β”‚ Allow 8ch audio β”‚ β”‚ Allow 640kbps β”‚ ↓ β”‚ NO β†’ ⏭️ Skip (notify user) β”‚ NO β†’ Use default/explicit resolution (backward compatible) ``` --- ## πŸ“‹ Console Output Signs ### βœ… 4K Processing Active ``` 🎬 HDR content detected (BT.2020 + SMPTE2084) πŸ“‹ Target: 2160p (4K passthrough) πŸŽ™οΈ Stream #0: 8chβ†’8ch | Output: EAC3 640kbps πŸ“Ή Video: HEVC NVENC | 2160p HDR color profile: BT.2020 + SMPTE2084 (HDR10) ``` ### ⚠️ Skipping Non-4K ``` ⏭️ Skipping: --r 2160 requested but source is only 1080p (not 4K) ``` ### πŸ“Š 4K SDR (No HDR) ``` πŸ“‹ Target: 2160p (4K passthrough) πŸŽ™οΈ Stream #0: 8chβ†’8ch | Output: EAC3 640kbps πŸ“Ή Video: HEVC NVENC | 2160p (No HDR color profile message = SDR content) ``` --- ## 🚫 Common Mistakes ### ❌ Using `--r 2160` on 1080p ```bash python main.py "path\to\1080p" --r 2160 # Result: ⏭️ Skipped "not 4K" ``` **Fix**: Omit `--r 2160` or use `--r 1080` ### ❌ Expecting automatic 4K ```bash python main.py "path\to\4k" # Result: 🎬 Encoded as 1080p (default) ``` **Fix**: Add `--r 2160` to enable 4K mode ### ❌ 8-channel on 1080p ```python # Config allows 640kbps high bitrate # But 1080p limits to 448kbps + 6ch max ``` **Result**: Automatically downmixed to 6ch at 448kbps --- ## 🎯 Decision Tree ``` Is source 4K? β”œβ”€ NO β†’ Use default logic (downscale to 1080p) └─ YES β†’ Want 4K output? β”œβ”€ NO β†’ Omit --r 2160 (downscale to 1080p) └─ YES β†’ Use --r 2160 β”œβ”€ Detect HDR color space β”œβ”€ Apply HDR profiles (if detected) β”œβ”€ Allow 8-channel audio β”œβ”€ Allow 640kbps bitrate └─ βœ… Encode at 4K ``` --- ## πŸ“ˆ Performance Notes | Task | Approx Time | Notes | |------|------------|-------| | 1080p encode | 30-60 min | Single movie | | 4K encode | 2-3 hours | 4-6x slower than 1080p | | 4K test mode | 15 min | First 15 minutes only | --- ## πŸ”§ Config Adjustment (Optional) ### For Higher 4K Quality ```xml 23 ``` ### For Smaller 4K Files ```xml 512000 ``` --- ## πŸ“š Documentation Files | File | Purpose | |------|---------| | `IMPLEMENTATION_COMPLETE.md` | Full technical summary | | `IMPLEMENTATION_SUMMARY_4K_HDR.md` | Feature details | | `AUDIO_CONFIG_GUIDE.md` | Audio bitrate guide | | `4K_HDR_CLI_REFERENCE.md` | CLI examples | | (this file) | Quick reference | --- ## ✨ Key Points to Remember 1. βœ… **Opt-in**: Use `--r 2160` to enable 4K (not automatic) 2. βœ… **Validated**: Non-4K sources automatically skipped 3. βœ… **Smart Audio**: Channels/bitrate auto-optimized per resolution 4. βœ… **HDR Aware**: Detects & preserves HDR color metadata 5. βœ… **Compatible**: Works with all existing features 6. βœ… **No Breaking Changes**: All previous commands work unchanged --- **Last Updated**: 2026-05-17 **Status**: Production Ready βœ