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:
@@ -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