# config.xml - Audio Bucket Configuration Guide ## Audio Bucket Structure The audio buckets in `config.xml` define the bitrate tiers used for audio encoding based on channel count. ### Current Configuration ```xml ``` ## Bitrate Usage by Resolution and Channels ### Stereo (2 Channels) - All Resolutions - **720p**: Up to `high` (192 kbps) if needed - **1080p**: Up to `high` (192 kbps) if needed - **4K (2160p)**: Up to `high` (192 kbps) if needed Stereo bitrates are the same across all resolutions. ### Multi-Channel (6+ Channels) #### 1080p (Max 6 channels) - **Minimum**: `low` (384 kbps) - **Default**: `medium` (448 kbps) - **Maximum**: `medium` (448 kbps) ⚠️ **High tier NOT used** Reason: Balanced compression for 1080p file size #### 4K / 2160p (Max 8 channels) - **Minimum**: `low` (384 kbps) - **Default**: `medium` (448 kbps) - **Maximum**: `high` (640 kbps) ✅ **High tier NOW available** Reason: 4K containers larger; can better accommodate higher quality audio #### 720p (Max 2 channels) - Uses stereo bitrate tier (2 channels) - Never uses multi-channel tier ## Audio Encoder Selection ### Stereo (2 channels) - **Codec**: AAC - **Use Case**: Commentary tracks, all 720p sources - **Quality**: ~128-192 kbps depending on source ### Multi-Channel (6+ channels) - **Codec**: EAC3 (Enhanced AC-3) - **Use Case**: Main audio tracks with surround sound - **Quality Tiers**: - Low: Aggressive compression, smaller files - Medium: Balanced quality/size (default) - High: High fidelity (4K only) ## Configuration Recommendations ### For 4K HDR Content ```xml 384000 448000 640000 ``` ### For Bandwidth-Conscious Setup Reduce high tier if needed: ```xml 384000 384000 448000 ``` ### For Maximum Quality Increase all tiers: ```xml 448000 512000 768000 ``` ## How the Selection Works ### Example 1: 6-Channel Audio on 1080p 1. Detected: 6 channels, 500 kbps bitrate, 1080p resolution 2. Channel clamping: 6 ≤ 6 (max for 1080p) → stays 6ch 3. Bitrate selection: 500 kbps, 1080p max is `medium` (448 kbps) → uses 448 kbps 4. Output: EAC3 codec, 6 channels, 448 kbps ### Example 2: 8-Channel Audio on 4K 1. Detected: 8 channels, 640 kbps bitrate, 4K resolution 2. Channel clamping: 8 ≤ 8 (max for 4K) → stays 8ch 3. Bitrate selection: 640 kbps is exactly `high` → uses 640 kbps 4. Output: EAC3 codec, 8 channels, 640 kbps ### Example 3: 8-Channel Audio on 1080p 1. Detected: 8 channels, 640 kbps bitrate, 1080p resolution 2. Channel clamping: 8 > 6 (max for 1080p) → **downmix to 6ch** 3. Bitrate selection: 640 kbps → clamped to `medium` (448 kbps) for 1080p 4. Output: EAC3 codec, 6 channels, 448 kbps (downmixed) ## Key Takeaways - ✅ Stereo bitrates remain unchanged across all resolutions - ✅ Multi-channel at 1080p: Max `medium` (448 kbps), no downmixing below 6ch - ✅ Multi-channel at 4K: Can use `high` (640 kbps) for 6-8 channels - ✅ Audio channels automatically clamped: 720p→2ch, 1080p→6ch, 4K→8ch - ✅ Bitrate selection respects both detected quality and resolution ceiling