fix(codec): improve video streaming with VP8 fallback and larger buffers
Adjust video codec and buffering configuration for better streaming performance: Changes: - BlockVP8: false (was true) - Allow VP8 fallback for ad segments - Prevents playback interruptions when ads use VP8 codec - VP8 is lower priority but still useful for compatibility - VideoBufferSizeMB: 64 MB (was 16 MB) - Larger buffer handles bursty Twitch/AV1 segments better - Reduces buffering events during variable bitrate streams - QueueBufferTimeSec: 20 seconds (was 10 seconds) - More buffering time for smooth playback - Better tolerance for network jitter Updated documentation in CONFIG.md to reflect new defaults. This improves video streaming reliability, particularly for platforms like Twitch that may mix different codecs for content and ads.
- commit
- 8654af746c37606931096294901b02c3ee9e0ce4
- author
- bnema · · 2025-11-18 18:06 UTC
- parent
- 5879e38
- signature
- GPG Unverified
2B82207D370127A0The key is unknown
2 files · +6 -6
M docs/CONFIG.md +3 -3
| @@ -152,11 +152,11 @@ border = "#363636" | |||
| 152 | 152 | | `codec_preferences.preferred_codecs` | string | `"av1,h264"` | Comma-separated | Codec priority order | | |
| 153 | 153 | | `codec_preferences.force_av1` | bool | `false` | - | Force AV1 codec | | |
| 154 | 154 | | `codec_preferences.block_vp9` | bool | `false` | - | Block VP9 codec | | |
| 155 | - | | `codec_preferences.block_vp8` | bool | `true` | - | Block VP8 codec | | |
| 155 | + | | `codec_preferences.block_vp8` | bool | `false` | - | Block VP8 codec | | |
| 156 | 156 | | `codec_preferences.av1_hardware_only` | bool | `false` | - | Disable AV1 software fallback | | |
| 157 | 157 | | `codec_preferences.disable_vp9_hardware` | bool | `false` | - | Disable VP9 hardware accel | | |
| 158 | - | | `codec_preferences.video_buffer_size_mb` | int | `16` | > 0 | Video buffer size in MB | | |
| 159 | - | | `codec_preferences.queue_buffer_time_sec` | int | `10` | > 0 | Queue buffer time in seconds | | |
| 158 | + | | `codec_preferences.video_buffer_size_mb` | int | `64` | > 0 | Video buffer size in MB | | |
| 159 | + | | `codec_preferences.queue_buffer_time_sec` | int | `20` | > 0 | Queue buffer time in seconds | | |
| 160 | 160 | | `codec_preferences.custom_user_agent` | string | Chrome UA | any | Custom user agent string | | |
| 161 | 161 | | `codec_preferences.av1_max_resolution` | string | `"1080p"` | `720p`, `1080p`, `1440p`, `4k`, `unlimited` | Max AV1 resolution | | |
| 162 | 162 | | `codec_preferences.disable_twitch_codec_control` | bool | `true` | - | Disable codec control on Twitch | | |
| @@ -152,11 +152,11 @@ border = "#363636" | |||||
| 152 | | `codec_preferences.preferred_codecs` | string | `"av1,h264"` | Comma-separated | Codec priority order | | 152 | | `codec_preferences.preferred_codecs` | string | `"av1,h264"` | Comma-separated | Codec priority order | | ||
| 153 | | `codec_preferences.force_av1` | bool | `false` | - | Force AV1 codec | | 153 | | `codec_preferences.force_av1` | bool | `false` | - | Force AV1 codec | | ||
| 154 | | `codec_preferences.block_vp9` | bool | `false` | - | Block VP9 codec | | 154 | | `codec_preferences.block_vp9` | bool | `false` | - | Block VP9 codec | | ||
| 155 | - | | `codec_preferences.block_vp8` | bool | `true` | - | Block VP8 codec | | 155 | + | | `codec_preferences.block_vp8` | bool | `false` | - | Block VP8 codec | |
| 156 | | `codec_preferences.av1_hardware_only` | bool | `false` | - | Disable AV1 software fallback | | 156 | | `codec_preferences.av1_hardware_only` | bool | `false` | - | Disable AV1 software fallback | | ||
| 157 | | `codec_preferences.disable_vp9_hardware` | bool | `false` | - | Disable VP9 hardware accel | | 157 | | `codec_preferences.disable_vp9_hardware` | bool | `false` | - | Disable VP9 hardware accel | | ||
| 158 | - | | `codec_preferences.video_buffer_size_mb` | int | `16` | > 0 | Video buffer size in MB | | 158 | + | | `codec_preferences.video_buffer_size_mb` | int | `64` | > 0 | Video buffer size in MB | |
| 159 | - | | `codec_preferences.queue_buffer_time_sec` | int | `10` | > 0 | Queue buffer time in seconds | | 159 | + | | `codec_preferences.queue_buffer_time_sec` | int | `20` | > 0 | Queue buffer time in seconds | |
| 160 | | `codec_preferences.custom_user_agent` | string | Chrome UA | any | Custom user agent string | | 160 | | `codec_preferences.custom_user_agent` | string | Chrome UA | any | Custom user agent string | | ||
| 161 | | `codec_preferences.av1_max_resolution` | string | `"1080p"` | `720p`, `1080p`, `1440p`, `4k`, `unlimited` | Max AV1 resolution | | 161 | | `codec_preferences.av1_max_resolution` | string | `"1080p"` | `720p`, `1080p`, `1440p`, `4k`, `unlimited` | Max AV1 resolution | | ||
| 162 | | `codec_preferences.disable_twitch_codec_control` | bool | `true` | - | Disable codec control on Twitch | | 162 | | `codec_preferences.disable_twitch_codec_control` | bool | `true` | - | Disable codec control on Twitch | | ||
M internal/config/defaults.go +3 -3
| @@ -124,11 +124,11 @@ func DefaultConfig() *Config { | |||
| 124 | 124 | PreferredCodecs: "av1,h264", // AV1 first, but allow VP9 fallback for higher resolutions | |
| 125 | 125 | ForceAV1: false, // Use smart AV1 negotiation instead of forcing | |
| 126 | 126 | BlockVP9: false, // Allow VP9 for higher resolutions | |
| 127 | - | BlockVP8: true, // Still block VP8 as it's outdated | |
| 127 | + | BlockVP8: false, // Allow VP8 fallback for ad segments (lower priority) | |
| 128 | 128 | AV1HardwareOnly: false, // Allow software AV1 fallback | |
| 129 | 129 | DisableVP9Hardware: false, // Allow VP9 hardware for high res content | |
| 130 | - | VideoBufferSizeMB: 16, // Larger buffer for AV1 streams | |
| 131 | - | QueueBufferTimeSec: 10, // More buffering time for smooth playback | |
| 130 | + | VideoBufferSizeMB: 64, // Larger buffer for bursty Twitch/AV1 segments | |
| 131 | + | QueueBufferTimeSec: 20, // More buffering time for smooth playback | |
| 132 | 132 | CustomUserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15", // WebKitGTK default (same as Epiphany) | |
| 133 | 133 | AV1MaxResolution: "1080p", // Optimal AV1 up to 1080p, fallback to VP9 for higher res | |
| 134 | 134 | DisableTwitchCodecControl: true, // Disable codec control on Twitch by default (prevents theater/fullscreen freezing) | |
| @@ -124,11 +124,11 @@ func DefaultConfig() *Config { | |||||
| 124 | PreferredCodecs: "av1,h264", // AV1 first, but allow VP9 fallback for higher resolutions | 124 | PreferredCodecs: "av1,h264", // AV1 first, but allow VP9 fallback for higher resolutions | ||
| 125 | ForceAV1: false, // Use smart AV1 negotiation instead of forcing | 125 | ForceAV1: false, // Use smart AV1 negotiation instead of forcing | ||
| 126 | BlockVP9: false, // Allow VP9 for higher resolutions | 126 | BlockVP9: false, // Allow VP9 for higher resolutions | ||
| 127 | - | BlockVP8: true, // Still block VP8 as it's outdated | 127 | + | BlockVP8: false, // Allow VP8 fallback for ad segments (lower priority) |
| 128 | AV1HardwareOnly: false, // Allow software AV1 fallback | 128 | AV1HardwareOnly: false, // Allow software AV1 fallback | ||
| 129 | DisableVP9Hardware: false, // Allow VP9 hardware for high res content | 129 | DisableVP9Hardware: false, // Allow VP9 hardware for high res content | ||
| 130 | - | VideoBufferSizeMB: 16, // Larger buffer for AV1 streams | 130 | + | VideoBufferSizeMB: 64, // Larger buffer for bursty Twitch/AV1 segments |
| 131 | - | QueueBufferTimeSec: 10, // More buffering time for smooth playback | 131 | + | QueueBufferTimeSec: 20, // More buffering time for smooth playback |
| 132 | CustomUserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15", // WebKitGTK default (same as Epiphany) | 132 | CustomUserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15", // WebKitGTK default (same as Epiphany) | ||
| 133 | AV1MaxResolution: "1080p", // Optimal AV1 up to 1080p, fallback to VP9 for higher res | 133 | AV1MaxResolution: "1080p", // Optimal AV1 up to 1080p, fallback to VP9 for higher res | ||
| 134 | DisableTwitchCodecControl: true, // Disable codec control on Twitch by default (prevents theater/fullscreen freezing) | 134 | DisableTwitchCodecControl: true, // Disable codec control on Twitch by default (prevents theater/fullscreen freezing) | ||