From 5860c50c593b2b74f5adba7b42a91030c0af6668 Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 20 Jun 2025 15:50:30 +0600 Subject: [PATCH] web/settings/video: add youtube container settings --- web/i18n/en/settings.json | 5 +++- web/src/routes/settings/video/+page.svelte | 28 ++++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/web/i18n/en/settings.json b/web/i18n/en/settings.json index db225e7e..ad852176 100644 --- a/web/i18n/en/settings.json +++ b/web/i18n/en/settings.json @@ -28,9 +28,12 @@ "video.quality.144": "144p", "video.quality.description": "if preferred video quality isn't available, next best is picked instead.", - "video.youtube.codec": "youtube codec and container", + "video.youtube.codec": "preferred youtube video codec", "video.youtube.codec.description": "h264: best compatibility, average quality. max quality is 1080p. \nav1: best quality and efficiency. supports 8k & HDR. \nvp9: same quality as av1, but file is ~2x bigger. supports 4k & HDR.\n\nav1 and vp9 aren't widely supported, you might have to use additional software to play/edit them. cobalt picks next best codec if preferred one isn't available.", + "video.youtube.container": "youtube file container", + "video.youtube.container.description": "when \"auto\" is selected, cobalt will pick the best container automatically depending on selected codec: mp4 for h264; webm for vp9/av1.", + "video.youtube.hls": "youtube hls formats", "video.youtube.hls.title": "prefer hls for video & audio", "video.youtube.hls.description": "only h264 and vp9 codecs are available in this mode. original audio codec is aac, it's re-encoded for compatibility, audio quality may be slightly worse than the non-HLS counterpart.\n\nthis option is experimental, it may go away or change in the future.", diff --git a/web/src/routes/settings/video/+page.svelte b/web/src/routes/settings/video/+page.svelte index 56a31db8..b38461b6 100644 --- a/web/src/routes/settings/video/+page.svelte +++ b/web/src/routes/settings/video/+page.svelte @@ -3,7 +3,7 @@ import settings from "$lib/state/settings"; import { t } from "$lib/i18n/translations"; - import { videoQualityOptions } from "$lib/types/settings"; + import { videoQualityOptions, youtubeVideoContainerOptions } from "$lib/types/settings"; import { youtubeVideoCodecOptions } from "$lib/types/settings"; import SettingsCategory from "$components/settings/SettingsCategory.svelte"; @@ -12,9 +12,9 @@ import SettingsToggle from "$components/buttons/SettingsToggle.svelte"; const codecTitles = { - h264: "h264 (mp4)", - av1: "av1 (webm)", - vp9: "vp9 (webm)", + h264: "h264 + aac", + av1: "av1 + opus", + vp9: "vp9 + opus", } @@ -55,6 +55,26 @@ + + + {#each youtubeVideoContainerOptions as value} + + {value} + + {/each} + + + {#if env.ENABLE_DEPRECATED_YOUTUBE_HLS}