web/queue: add support for video muting
Some checks failed
Run tests / api sanity check (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled

also added a temporary stub for audio and gif processing
This commit is contained in:
wukko 2025-03-29 17:55:40 +06:00
parent 180bda5d49
commit 235f6c0a3e
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -1,4 +1,7 @@
import { get } from "svelte/store";
import { t } from "$lib/i18n/translations";
import { addItem } from "$lib/state/queen-bee/queue"; import { addItem } from "$lib/state/queen-bee/queue";
import { createDialog } from "$lib/state/dialogs";
import { openQueuePopover } from "$lib/state/queue-visibility"; import { openQueuePopover } from "$lib/state/queue-visibility";
import { ffmpegMetadataArgs } from "$lib/util"; import { ffmpegMetadataArgs } from "$lib/util";
@ -74,22 +77,48 @@ export const createSavePipeline = (info: CobaltLocalProcessingResponse, request:
}); });
} }
if (["merge", "mute"].includes(info.type)) {
const ffargs = ["-c:v", "copy"];
if (info.type === "merge") {
ffargs.push("-c:a", "copy");
} else if (info.type === "mute") {
ffargs.push("-an");
}
ffargs.push(
...(info.output.metadata ? ffmpegMetadataArgs(info.output.metadata) : [])
);
pipeline.push({ pipeline.push({
worker: "remux", worker: "remux",
workerId: crypto.randomUUID(), workerId: crypto.randomUUID(),
parentId, parentId,
workerArgs: { workerArgs: {
ffargs: [ ffargs,
"-c:v", "copy",
"-c:a", "copy",
...(info.output.metadata ? ffmpegMetadataArgs(info.output.metadata) : [])
],
output: { output: {
type: info.output.type, type: info.output.type,
format: info.output.filename.split(".").pop(), format: info.output.filename.split(".").pop(),
}, },
}, },
}); });
}
if (["audio", "gif"].includes(info.type)) {
return createDialog({
id: "save-error",
type: "small",
meowbalt: "error",
buttons: [
{
text: get(t)("button.gotit"),
main: true,
action: () => { },
},
],
bodyText: "audio and gif processing isn't implemented yet!",
});
}
addItem({ addItem({
id: parentId, id: parentId,