do a simple copy instead of relying on ffmpeg + add 1 for the video stream when doing the compression

This commit is contained in:
Mylloon 2024-08-21 19:40:16 +02:00
parent 2fe6f6aece
commit cdf2e678c3
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,5 +1,5 @@
import { app, BrowserWindow, dialog, ipcMain, Notification } from "electron"; import { app, BrowserWindow, dialog, ipcMain, Notification } from "electron";
import { statSync } from "fs"; import { statSync, copyFileSync } from "fs";
import { import {
deleteFile, deleteFile,
deleteTwoPassFiles, deleteTwoPassFiles,
@ -122,12 +122,7 @@ app.whenReady().then(() => {
outFile = getNewFilename(file, "(nomerge) "); outFile = getNewFilename(file, "(nomerge) ");
// Do a copy // Do a copy
await execute(`"${ffmpegPath}" -y \ copyFileSync(file, outFile);
-i "${file}" \
-map 0 \
-codec copy \
${extraArgs} \
"${outFile}"`).catch((e) => registerError(win, e));
break; break;
} }
@ -156,8 +151,8 @@ app.whenReady().then(() => {
// Trash the output, depends on the platform // Trash the output, depends on the platform
const nul = process.platform === "win32" ? "NUL" : "/dev/null"; const nul = process.platform === "win32" ? "NUL" : "/dev/null";
// Mapping of tracks for FFMPEG // Mapping of tracks for FFMPEG, adding 1 for the video stream
const mappingTracks = Array(nbTracks) const mappingTracks = Array(nbTracks + 1)
.fill("-map 0:") .fill("-map 0:")
.map((str, index) => { .map((str, index) => {
return str + index; return str + index;