diff --git a/messages/en.json b/messages/en.json index de11f31..4956e45 100644 --- a/messages/en.json +++ b/messages/en.json @@ -93,7 +93,12 @@ "title": "Conversion", "filename_format": "File name format", "filename_description": "This will determine the name of the file on download, not including the file extension. You can put these following templates in the format, which will be replaced with the relevant information: %name% for the original file name, %extension% for the original file extension, and %date% for a date string of when the file was converted.", - "placeholder": "VERT_%name%" + "placeholder": "VERT_%name%", + "quality": "Conversion quality", + "quality_description": "This changes the default output quality of the converted files (in its category). Higher values may result in longer conversion times and file size.", + "quality_video": "This changes the default output quality of the converted video files. Higher values may result in longer conversion times and file size.", + "quality_audio": "Audio (kbps)", + "quality_images": "Image (%)" }, "vertd": { "title": "Video conversion", diff --git a/src/lib/components/functional/FancyInput.svelte b/src/lib/components/functional/FancyInput.svelte index f60275b..4bb8711 100644 --- a/src/lib/components/functional/FancyInput.svelte +++ b/src/lib/components/functional/FancyInput.svelte @@ -8,6 +8,7 @@ prefix?: string; type?: string; min?: number; + max?: number; }; let { @@ -19,6 +20,7 @@ prefix, type = "text", min = 0, + max = 100, }: Props = $props(); @@ -26,6 +28,7 @@ { return { video: "libx264", audio: "aac" }; } }; + +export const CONVERSION_BITRATES = [ + "auto", + 320, + 256, + 192, + 128, + 96, + 64, + 32, +] as const; +export type ConversionBitrate = (typeof CONVERSION_BITRATES)[number]; \ No newline at end of file diff --git a/src/lib/sections/settings/Conversion.svelte b/src/lib/sections/settings/Conversion.svelte index 8b15fd5..cc15705 100644 --- a/src/lib/sections/settings/Conversion.svelte +++ b/src/lib/sections/settings/Conversion.svelte @@ -3,7 +3,13 @@ import Panel from "$lib/components/visual/Panel.svelte"; import { RefreshCwIcon } from "lucide-svelte"; import type { ISettings } from "./index.svelte"; + import { + CONVERSION_BITRATES, + type ConversionBitrate, + } from "$lib/converters/ffmpeg.svelte"; import { m } from "$lib/paraglide/messages"; + import Dropdown from "$lib/components/functional/Dropdown.svelte"; + import FancyInput from "$lib/components/functional/FancyInput.svelte"; const { settings }: { settings: ISettings } = $props(); @@ -21,7 +27,9 @@
{m["settings.conversion.filename_format"]()}
++ {m["settings.conversion.filename_format"]()} +
{@html m["settings.conversion.filename_description"]()}
@@ -33,6 +41,46 @@ type="text" />+ {m["settings.conversion.quality"]()} +
++ {m["settings.conversion.quality_description"]()} +
++ {m["settings.conversion.quality_images"]()} +
++ {m["settings.conversion.quality_audio"]()} +
+