mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-11 20:57:46 +02:00
web: add support for "remux" type of local processing
it's currently used for fixing a very specific set of twitter videos, but will be used for remuxing HLS videos in the future
This commit is contained in:
@ -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)) |
|
||||
|
@ -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") {
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user