+
{text}...
{(cutProgress != null) && (
-
+
{`${(cutProgress * 100).toFixed(1)} %`}
)}
+
+
+
+
));
-export default Loading;
+export default Working;
diff --git a/src/dialogs/extractFrames.jsx b/src/dialogs/extractFrames.jsx
index 91d963cf..68aaa79a 100644
--- a/src/dialogs/extractFrames.jsx
+++ b/src/dialogs/extractFrames.jsx
@@ -30,7 +30,7 @@ export async function askExtractFramesAsImages({ segmentNumFrames, fps }) {
text: i18n.t('Capture the best image every nth second'),
icon: 'question',
input: 'text',
- inputLabel: i18n.t('Enter a decimal number of seconds'),
+ inputLabel: i18n.t('Enter the number of seconds between each image (decimal)'),
inputValue: 5,
showCancelButton: true,
});
@@ -49,7 +49,7 @@ export async function askExtractFramesAsImages({ segmentNumFrames, fps }) {
text: i18n.t('Capture exactly one image every nth frame'),
icon: 'question',
input: 'number',
- inputLabel: i18n.t('Enter an integer number of frames'),
+ inputLabel: i18n.t('Enter the number of frames between each image (integer)'),
inputValue: 30,
showCancelButton: true,
});
@@ -62,7 +62,7 @@ export async function askExtractFramesAsImages({ segmentNumFrames, fps }) {
text: i18n.t('Capture exactly one image every nth second'),
icon: 'question',
input: 'text',
- inputLabel: i18n.t('Enter a decimal number of seconds'),
+ inputLabel: i18n.t('Enter the number of seconds between each image (decimal)'),
inputValue: 5,
showCancelButton: true,
});
diff --git a/src/ffmpeg.js b/src/ffmpeg.js
index b1e1f4be..858fed68 100644
--- a/src/ffmpeg.js
+++ b/src/ffmpeg.js
@@ -18,6 +18,9 @@ const { pathExists } = window.require('fs-extra');
let customFfPath;
+const runningFfmpegs = new Set();
+// setInterval(() => console.log(runningFfmpegs.size), 1000);
+
export class RefuseOverwriteError extends Error {}
@@ -60,7 +63,23 @@ export async function runFfprobe(args, { timeout = isDev ? 10000 : 30000 } = {})
export function runFfmpeg(args, execaOptions, { logCli = true } = {}) {
const ffmpegPath = getFfmpegPath();
if (logCli) console.log(getFfCommandLine('ffmpeg', args));
- return execa(ffmpegPath, args, execaOptions);
+ const process = execa(ffmpegPath, args, execaOptions);
+
+ (async () => {
+ runningFfmpegs.add(process);
+ try {
+ await process;
+ } finally {
+ runningFfmpegs.delete(process);
+ }
+ })();
+ return process;
+}
+
+export function abortFfmpegs() {
+ runningFfmpegs.forEach((process) => {
+ process.kill('SIGTERM', { forceKillAfterTimeout: 10000 });
+ });
}
export function handleProgress(process, durationIn, onProgress, customMatcher = () => {}) {