Skip to content

best way to save what you love

web: add support for "remux" type of local processing

wukkod4a2fe507fd2
diff --git a/docs/api.md b/docs/api.md
index 35744a2d..4949b3e0 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -112,7 +112,7 @@ the response will always be a JSON object containing the `status` key, which is
| key | type | value |
|:-------------|:-----------|:--------------------------------------------------------------|
| `status` | `string` | `local-processing` |
-| `type` | `string` | `merge`, `mute`, `audio`, or `gif` |
+| `type` | `string` | `merge`, `mute`, `audio`, `gif`, or `remux` |
| `service` | `string` | origin service (`youtube`, `twitter`, `instagram`, etc) |
| `tunnel` | `string[]` | array of tunnel URLs |
| `output` | `object` | details about the output file ([see below](#output-object)) |
diff --git a/web/src/lib/task-manager/queue.ts b/web/src/lib/task-manager/queue.ts
index 85852082..bd79269f 100644
--- a/web/src/lib/task-manager/queue.ts
+++ b/web/src/lib/task-manager/queue.ts
@@ -58,13 +58,14 @@ const mediaIcons: { [key: string]: CobaltPipelineResultFileType } = {
merge: "video",
mute: "video",
audio: "audio",
- gif: "image"
+ gif: "image",
+ remux: "video"
}
const makeRemuxArgs = (info: CobaltLocalProcessingResponse) => {
const ffargs = ["-c:v", "copy"];
- if (info.type === "merge") {
+ if (["merge", "remux"].includes(info.type)) {
ffargs.push("-c:a", "copy");
} else if (info.type === "mute") {
ffargs.push("-an");
@@ -159,7 +160,7 @@ export const createSavePipeline = (
let ffargs: string[];
let workerType: 'encode' | 'remux';
- if (["merge", "mute"].includes(info.type)) {
+ if (["merge", "mute", "remux"].includes(info.type)) {
workerType = "remux";
ffargs = makeRemuxArgs(info);
} else if (info.type === "audio") {
diff --git a/web/src/lib/types/api.ts b/web/src/lib/types/api.ts
index e96833d6..6e030856 100644
--- a/web/src/lib/types/api.ts
+++ b/web/src/lib/types/api.ts
@@ -56,7 +56,7 @@ export type CobaltFileMetadata = Record<
typeof CobaltFileMetadataKeys[number], string | undefined
>;
-export type CobaltLocalProcessingType = 'merge' | 'mute' | 'audio' | 'gif';
+export type CobaltLocalProcessingType = 'merge' | 'mute' | 'audio' | 'gif' | 'remux';
export type CobaltLocalProcessingResponse = {
status: CobaltResponseType.LocalProcessing,