diff --git a/public/configStore.js b/public/configStore.js
index 3ac70a3a..d540dd57 100644
--- a/public/configStore.js
+++ b/public/configStore.js
@@ -6,6 +6,7 @@ const defaults = {
customOutDir: undefined,
keyframeCut: true,
autoMerge: false,
+ autoDeleteMergedSegments: true,
timecodeShowFrames: false,
invertCutSegments: false,
autoExportExtraStreams: true,
diff --git a/src/App.jsx b/src/App.jsx
index 027b152d..9a20560d 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -196,6 +196,8 @@ const App = memo(() => {
useEffect(() => safeSetConfig('hideNotifications', hideNotifications), [hideNotifications]);
const [autoLoadTimecode, setAutoLoadTimecode] = useState(configStore.get('autoLoadTimecode'));
useEffect(() => safeSetConfig('autoLoadTimecode', autoLoadTimecode), [autoLoadTimecode]);
+ const [autoDeleteMergedSegments, setAutoDeleteMergedSegments] = useState(configStore.get('autoDeleteMergedSegments'));
+ useEffect(() => safeSetConfig('autoDeleteMergedSegments', autoDeleteMergedSegments), [autoDeleteMergedSegments]);
useEffect(() => {
i18n.changeLanguage(language || fallbackLng).catch(console.error);
@@ -1031,6 +1033,7 @@ const App = memo(() => {
ffmpegExperimental,
preserveMovData,
onProgress: setCutProgress,
+ autoDeleteMergedSegments,
});
}
@@ -1061,7 +1064,7 @@ const App = memo(() => {
setWorking();
setCutProgress();
}
- }, [autoMerge, copyFileStreams, customOutDir, duration, effectiveRotation, exportExtraStreams, ffmpegExperimental, fileFormat, fileFormatData, filePath, handleCutFailed, isCustomFormatSelected, isRotationSet, keyframeCut, mainStreams, nonCopiedExtraStreams, outSegments, outputDir, shortestFlag, working, preserveMovData, avoidNegativeTs, numStreamsToCopy, hideAllNotifications, currentSegIndexSafe]);
+ }, [autoMerge, copyFileStreams, customOutDir, duration, effectiveRotation, exportExtraStreams, ffmpegExperimental, fileFormat, fileFormatData, filePath, handleCutFailed, isCustomFormatSelected, isRotationSet, keyframeCut, mainStreams, nonCopiedExtraStreams, outSegments, outputDir, shortestFlag, working, preserveMovData, avoidNegativeTs, numStreamsToCopy, hideAllNotifications, currentSegIndexSafe, autoDeleteMergedSegments]);
const capture = useCallback(async () => {
if (!filePath || !isDurationValid(duration)) return;
@@ -1892,12 +1895,14 @@ const App = memo(() => {
setHideNotifications={setHideNotifications}
autoLoadTimecode={autoLoadTimecode}
setAutoLoadTimecode={setAutoLoadTimecode}
+ autoDeleteMergedSegments={autoDeleteMergedSegments}
+ setAutoDeleteMergedSegments={setAutoDeleteMergedSegments}
AutoExportToggler={AutoExportToggler}
renderCaptureFormatButton={renderCaptureFormatButton}
onWheelTunerRequested={onWheelTunerRequested}
/>
- ), [AutoExportToggler, askBeforeClose, autoMerge, autoSaveProjectFile, customOutDir, invertCutSegments, keyframeCut, renderCaptureFormatButton, timecodeShowFrames, changeOutDir, onWheelTunerRequested, language, invertTimelineScroll, ffmpegExperimental, setFfmpegExperimental, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode]);
+ ), [AutoExportToggler, askBeforeClose, autoMerge, autoSaveProjectFile, customOutDir, invertCutSegments, keyframeCut, renderCaptureFormatButton, timecodeShowFrames, changeOutDir, onWheelTunerRequested, language, invertTimelineScroll, ffmpegExperimental, setFfmpegExperimental, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode, autoDeleteMergedSegments, setAutoDeleteMergedSegments]);
useEffect(() => {
if (!isStoreBuild) loadMifiLink().then(setMifiLink);
diff --git a/src/Settings.jsx b/src/Settings.jsx
index d6d5ae82..0a86439b 100644
--- a/src/Settings.jsx
+++ b/src/Settings.jsx
@@ -9,7 +9,7 @@ const Settings = memo(({
AutoExportToggler, renderCaptureFormatButton, onWheelTunerRequested, language, setLanguage,
invertTimelineScroll, setInvertTimelineScroll, ffmpegExperimental, setFfmpegExperimental,
enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction,
- hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode
+ hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode, autoDeleteMergedSegments, setAutoDeleteMergedSegments,
}) => {
const { t } = useTranslation();
@@ -72,6 +72,17 @@ const Settings = memo(({
+
+ {t('Auto delete segment files after merge?')}
+
+ setAutoDeleteMergedSegments(e.target.checked)}
+ />
+
+
+
{t('Keyframe cut mode')}
diff --git a/src/ffmpeg.js b/src/ffmpeg.js
index 17dd0abc..1c0ab7f5 100644
--- a/src/ffmpeg.js
+++ b/src/ffmpeg.js
@@ -533,13 +533,13 @@ export async function mergeFiles({ paths, outPath, allStreams, outFormat, ffmpeg
await transferTimestamps(paths[0], outPath);
}
-export async function autoMergeSegments({ customOutDir, sourceFile, isCustomFormatSelected, outFormat, segmentPaths, ffmpegExperimental, onProgress, preserveMovData }) {
+export async function autoMergeSegments({ customOutDir, sourceFile, isCustomFormatSelected, outFormat, segmentPaths, ffmpegExperimental, onProgress, preserveMovData, autoDeleteMergedSegments }) {
const ext = getOutFileExtension({ isCustomFormatSelected, outFormat, filePath: sourceFile });
const fileName = `cut-merged-${new Date().getTime()}${ext}`;
const outPath = getOutPath(customOutDir, sourceFile, fileName);
await mergeFiles({ paths: segmentPaths, outPath, outFormat, allStreams: true, ffmpegExperimental, onProgress, preserveMovData });
- await pMap(segmentPaths, path => fs.unlink(path), { concurrency: 5 });
+ if (autoDeleteMergedSegments) await pMap(segmentPaths, path => fs.unlink(path), { concurrency: 5 });
}
/**