{t('Overwrite existing files')}
diff --git a/src/components/MergedOutFileName.jsx b/src/components/MergedOutFileName.jsx
new file mode 100644
index 00000000..d2d4ef3b
--- /dev/null
+++ b/src/components/MergedOutFileName.jsx
@@ -0,0 +1,12 @@
+import React, { memo } from 'react';
+
+import TextInput from './TextInput';
+
+
+const MergedOutFileName = memo(({ mergedOutFileName, setMergedOutFileName }) => (
+
+ setMergedOutFileName(e.target.value)} style={{ textAlign: 'right' }} />
+
+));
+
+export default MergedOutFileName;
diff --git a/src/components/OutSegTemplateEditor.jsx b/src/components/OutSegTemplateEditor.jsx
index 2d78c3d6..013fc97e 100644
--- a/src/components/OutSegTemplateEditor.jsx
+++ b/src/components/OutSegTemplateEditor.jsx
@@ -13,6 +13,7 @@ import { defaultOutSegTemplate, segNumVariable, segSuffixVariable } from '../uti
import useUserSettings from '../hooks/useUserSettings';
import Switch from './Switch';
import Select from './Select';
+import TextInput from './TextInput';
const ReactSwal = withReactContent(Swal);
@@ -22,8 +23,6 @@ const formatVariable = (variable) => `\${${variable}}`;
const extVar = formatVariable('EXT');
-const inputStyle = { flexGrow: 1, fontFamily: 'inherit', fontSize: '.8em', backgroundColor: 'var(--gray3)', color: 'var(--gray12)', border: '1px solid var(--gray7)', appearance: 'none' };
-
const OutSegTemplateEditor = memo(({ outSegTemplate, setOutSegTemplate, generateOutSegFileNames, currentSegIndexSafe, getOutSegError }) => {
const { safeOutputFileName, toggleSafeOutputFileName, outputFileNameMinZeroPadding, setOutputFileNameMinZeroPadding } = useUserSettings();
@@ -117,7 +116,7 @@ const OutSegTemplateEditor = memo(({ outSegTemplate, setOutSegTemplate, generate
exit={{ opacity: 0, height: 0, marginTop: 0 }}
>
-
+
{outSegFileNames != null && }
diff --git a/src/components/TextInput.jsx b/src/components/TextInput.jsx
new file mode 100644
index 00000000..0b59b04b
--- /dev/null
+++ b/src/components/TextInput.jsx
@@ -0,0 +1,10 @@
+import React, { forwardRef } from 'react';
+
+const inputStyle = { borderRadius: '.4em', flexGrow: 1, fontFamily: 'inherit', fontSize: '.8em', backgroundColor: 'var(--gray3)', color: 'var(--gray12)', border: '1px solid var(--gray7)', appearance: 'none' };
+
+const TextInput = forwardRef(({ style, ...props }, forwardedRef) => (
+ // eslint-disable-next-line react/jsx-props-no-spreading
+
+));
+
+export default TextInput;
diff --git a/src/hooks/useFfmpegOperations.js b/src/hooks/useFfmpegOperations.js
index 66e07d6f..a1514e8c 100644
--- a/src/hooks/useFfmpegOperations.js
+++ b/src/hooks/useFfmpegOperations.js
@@ -437,9 +437,7 @@ function useFfmpegOperations({ filePath, treatInputFileModifiedTimeAsStart, trea
}
}, [concatFiles, cutSingle, filePath, needSmartCut, shouldSkipExistingFile]);
- const autoConcatCutSegments = useCallback(async ({ customOutDir, isCustomFormatSelected, outFormat, segmentPaths, ffmpegExperimental, onProgress, preserveMovData, movFastStart, autoDeleteMergedSegments, chapterNames, preserveMetadataOnMerge, appendFfmpegCommandLog }) => {
- const ext = getOutFileExtension({ isCustomFormatSelected, outFormat, filePath });
- const outPath = getSuffixedOutPath({ customOutDir, filePath, nameSuffix: `cut-merged-${new Date().getTime()}${ext}` });
+ const autoConcatCutSegments = useCallback(async ({ customOutDir, outFormat, segmentPaths, ffmpegExperimental, onProgress, preserveMovData, movFastStart, autoDeleteMergedSegments, chapterNames, preserveMetadataOnMerge, appendFfmpegCommandLog, mergedOutFilePath }) => {
const outDir = getOutDir(customOutDir, filePath);
const chapters = await createChaptersFromSegments({ segmentPaths, chapterNames });
@@ -447,10 +445,8 @@ function useFfmpegOperations({ filePath, treatInputFileModifiedTimeAsStart, trea
const metadataFromPath = segmentPaths[0];
// need to re-read streams because may have changed
const { streams } = await readFileMeta(metadataFromPath);
- await concatFiles({ paths: segmentPaths, outDir, outPath, metadataFromPath, outFormat, includeAllStreams: true, streams, ffmpegExperimental, onProgress, preserveMovData, movFastStart, chapters, preserveMetadataOnMerge, appendFfmpegCommandLog });
+ await concatFiles({ paths: segmentPaths, outDir, outPath: mergedOutFilePath, metadataFromPath, outFormat, includeAllStreams: true, streams, ffmpegExperimental, onProgress, preserveMovData, movFastStart, chapters, preserveMetadataOnMerge, appendFfmpegCommandLog });
if (autoDeleteMergedSegments) await tryDeleteFiles(segmentPaths);
-
- return outPath;
}, [concatFiles, filePath]);
const html5ify = useCallback(async ({ customOutDir, filePath: filePathArg, speed, hasAudio, hasVideo, onProgress }) => {
|