fore
This commit is contained in:
parent
761fd560a1
commit
a5177a3742
1 changed files with 11 additions and 1 deletions
|
@ -104,11 +104,21 @@ export const extractVideoMetadata = async (
|
|||
const outputData =
|
||||
uploadItem instanceof File
|
||||
? await ffmpegExecWeb(command, uploadItem, "txt", 0)
|
||||
: await electron.ffmpegExec(command, uploadItem, "txt", 0);
|
||||
: await electron.ffmpegExec(command, forE(uploadItem), "txt", 0);
|
||||
|
||||
return parseFFmpegExtractedMetadata(outputData);
|
||||
};
|
||||
|
||||
/**
|
||||
* For each of cases of {@link UploadItem} that apply when we're running in the
|
||||
* context of our desktop app, return a value that can be passed to
|
||||
* {@link Electron}'s {@link ffmpegExec} over IPC.
|
||||
*/
|
||||
const forE = (desktopUploadItem: Exclude<UploadItem, File>) =>
|
||||
typeof desktopUploadItem == "string" || Array.isArray(desktopUploadItem)
|
||||
? desktopUploadItem
|
||||
: desktopUploadItem.path;
|
||||
|
||||
// Options:
|
||||
//
|
||||
// - `-c [short for codex] copy`
|
||||
|
|
Loading…
Add table
Reference in a new issue