|
| 1 | +# Apple TV Format Support - Gaps and Action Items |
| 2 | + |
| 3 | +**Purpose:** Document which formats are supported on Apple TV (native + transcoding) and what remains unsupported. Identify actionable improvements. |
| 4 | + |
| 5 | +**Reference:** Device profile `appletv_v1`, evaluator `src/lib/server/capability/evaluator.ts`, artifact builder `src/lib/server/artifactBuilder.ts`. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 1. Current Support Matrix |
| 10 | + |
| 11 | +### Video |
| 12 | + |
| 13 | +| Format | Native | Transcode | Notes | |
| 14 | +|--------|--------|-----------|-------| |
| 15 | +| H.264 | ✓ | - | Full support | |
| 16 | +| HEVC (incl. Main10) | ✓ | - | Full support | |
| 17 | +| VP9 | - | ✓ → H.264 | `MAJESTIC_VIDEO_TRANSCODE_POLICY=opt_in` | |
| 18 | +| AV1 | - | ✓ → H.264 | Same policy | |
| 19 | +| Dolby Vision P7 (HEVC) | - | ✓ → HEVC HDR10 | Same policy | |
| 20 | +| MPEG-2 | - | ✓ → H.264 | `MAJESTIC_VIDEO_TRANSCODE_POLICY=opt_in` | |
| 21 | +| MPEG-4 Part 2 | - | ✓ → H.264 | Same | |
| 22 | +| VC-1 | - | ✓ → H.264 | Same | |
| 23 | +| ProRes | - | ✓ → H.264 | `MAJESTIC_VIDEO_TRANSCODE_POLICY=opt_in` | |
| 24 | + |
| 25 | +### HDR |
| 26 | + |
| 27 | +| Format | Native | Transcode | Notes | |
| 28 | +|--------|--------|-----------|-------| |
| 29 | +| SDR | ✓ | - | Full support | |
| 30 | +| HDR10 | ✓ | - | Full support | |
| 31 | +| HLG | ✓ | - | Full support | |
| 32 | +| Dolby Vision P5 | ✓ | - | Full support | |
| 33 | +| Dolby Vision P7 | - | ✓ → HDR10 | Via video transcode | |
| 34 | +| HDR10+ | ✓ | - | Apple TV 4K 3rd gen (2022+); older models may fall back to HDR10 | |
| 35 | + |
| 36 | +### Audio |
| 37 | + |
| 38 | +| Format | Native | Transcode | Notes | |
| 39 | +|--------|--------|-----------|-------| |
| 40 | +| AAC | ✓ | - | Full support | |
| 41 | +| AC3 | ✓ | - | Full support | |
| 42 | +| EAC3 | ✓ | - | Full support | |
| 43 | +| TrueHD / TrueHD Atmos | - | ✓ → EAC3/AAC | `MAJESTIC_PLAYBACK_POLICY=adaptive`, MKV/M2TS/TS only | |
| 44 | +| DTS / DTS-HD MA | - | ✓ → EAC3/AAC | Same | |
| 45 | +| FLAC | - | ✓ → EAC3/AAC | Same (adaptive), MKV/M2TS/TS only | |
| 46 | +| Opus | - | ✓ → EAC3/AAC | Same (adaptive), MKV/M2TS/TS only | |
| 47 | +| PCM | - | ✓ → EAC3/AAC | Same (adaptive), MKV/M2TS/TS/WebM only | |
| 48 | + |
| 49 | +### Containers |
| 50 | + |
| 51 | +| Container | Native | Artifact / Transcode | Notes | |
| 52 | +|-----------|--------|---------------------|-------| |
| 53 | +| MP4, MOV, M4V | ✓ | - | Direct play | |
| 54 | +| MKV | - | ✓ remux / adaptive | Copy or transcode audio | |
| 55 | +| M2TS, TS | - | ✓ remux / adaptive | Same | |
| 56 | +| WebM | - | ✓ remux / adaptive / transcode | Remux when H.264+compatible audio; transcode when VP9/AV1 | |
| 57 | +| AVI | - | ✓ remux / adaptive / transcode | Same as MKV; DivX/Xvid → transcode | |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 2. Gaps Summary |
| 62 | + |
| 63 | +| Category | Missing Formats | Impact | |
| 64 | +|----------|-----------------|--------| |
| 65 | +| **Video** | - | (ProRes now supported via transcode) | |
| 66 | +| **HDR** | - | (HDR10+ now in profile) | |
| 67 | +| **Audio** | - | (PCM now supported via adaptive) | |
| 68 | +| **Container** | - | (AVI now supported via artifact path) | |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## 3. Actionable Items |
| 73 | + |
| 74 | +### High impact, moderate effort |
| 75 | + |
| 76 | +| # | Action | Scope | Notes | |
| 77 | +|---|--------|-------|-------| |
| 78 | +| 1 | **FLAC / Opus audio transcode** | Extend adaptive path | ✓ Done. FLAC and Opus use same adaptive flow as TrueHD/DTS. MKV/M2TS/TS only. | |
| 79 | +| 2 | **WebM container remux** | Add WebM to artifact containers | ✓ Done. WebM + H.264 + AAC → remux to MP4. WebM + VP9/AV1 → transcode path. | |
| 80 | +| 3 | **HDR10+ support** | Device profile | ✓ Done. Added `hdr10+` to device profile. Apple TV 4K 3rd gen supports it. Probe detects via side_data. | |
| 81 | + |
| 82 | +### Medium impact, higher effort |
| 83 | + |
| 84 | +| # | Action | Scope | Notes | |
| 85 | +|---|--------|-------|-------| |
| 86 | +| 4 | **MPEG-2 / VC-1 video transcode** | Extend transcode path | ✓ Done. MPEG-2, VC-1, MPEG-4 Part 2 → H.264 when opt_in. | |
| 87 | +| 5 | **MPEG-4 Part 2 transcode** | Same as above | ✓ Done (in #4). | |
| 88 | +| 6 | **PCM audio handling** | Adaptive path | ✓ Done. PCM uses same adaptive flow as FLAC/Opus. Probe normalizes pcm_s16le, pcm_s24le, etc. | |
| 89 | + |
| 90 | +### Lower priority |
| 91 | + |
| 92 | +| # | Action | Scope | Notes | |
| 93 | +|---|--------|-------|-------| |
| 94 | +| 7 | **ProRes transcode** | Video transcode path | ✓ Done. ProRes → H.264 when opt_in. | |
| 95 | +| 8 | **AVI container** | Remux or transcode | ✓ Done. AVI added to artifact path. DivX/Xvid (MPEG-4) uses transcode. | |
| 96 | +| 9 | **WebM + H.264 remux** | Container support | Depends on #2; add WebM to containers and remux when video/audio compatible. | |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## 4. Implementation Order (Recommended) |
| 101 | + |
| 102 | +1. **FLAC / Opus audio** - Extend `hasAppleTVCompatibleAudio` and adaptive path. Low risk, high value for music/documentary content. |
| 103 | +2. **WebM container** - Add to profile and remux path. Enables WebM + H.264 direct remux. |
| 104 | +3. **MPEG-2 / VC-1 video** - Add to transcode path. Covers DVD/Blu-ray legacy. |
| 105 | +4. **HDR10+** - Verify Apple TV support; add to profile or transcode if needed. |
| 106 | +5. **PCM** - Document behavior and optionally add transcode. |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## 5. Non-Goals (Explicitly Deferred) |
| 111 | + |
| 112 | +- Real-time transcoding (all transcoding is pre-built artifacts) |
| 113 | +- ProRes as first-class target (encode to ProRes) |
| 114 | +- Dolby Atmos metadata preservation (we output EAC3 5.1, not Atmos) |
| 115 | +- Subtitle extraction (PGS → SRT) in artifact path |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## 6. Hardware Video Encoding |
| 120 | + |
| 121 | +When transcoding (VP9/AV1/DV P7/MPEG-2/VC-1/ProRes → H.264 or HEVC HDR10), the server prefers hardware encoders when available: |
| 122 | + |
| 123 | +| Platform | H.264 | HEVC (DV P7) | |
| 124 | +|----------|-------|--------------| |
| 125 | +| macOS | VideoToolbox (`h264_videotoolbox`) | VideoToolbox (`hevc_videotoolbox`) | |
| 126 | +| NVIDIA | NVENC (`h264_nvenc`) | NVENC (`hevc_nvenc`) | |
| 127 | +| Linux (Intel/AMD) | VAAPI (`h264_vaapi`) | VAAPI (`hevc_vaapi`) | |
| 128 | +| Fallback | libx264 | libx265 | |
| 129 | + |
| 130 | +- **`MAJESTIC_USE_HARDWARE_VIDEO`** (default: `true`) - Set to `0` or `false` to force software encoding. Use if hardware fails (e.g. macOS sandbox error `-12908`). |
| 131 | +- **`MAJESTIC_VAAPI_DEVICE`** (Linux) - DRI render node for VAAPI. Default: `/dev/dri/renderD128`. Override for multi-GPU systems. |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +## 7. References |
| 136 | + |
| 137 | +- `docs/REMUX-ON-THE-FLY-DESIGN.md` - Artifact flow, audio policy |
| 138 | +- `docs/PLAYBACK.md` - Philosophy, no silent transcode |
| 139 | +- `src/lib/server/capability/deviceProfile.ts` - Apple TV profile |
| 140 | +- `src/lib/server/capability/evaluator.ts` - Compatibility logic |
0 commit comments