Skip to content

The swiss army knife of lossless video/audio editing

default to override extension if mov

Mikael Finstadf3738fab9185
diff --git a/src/util.js b/src/util.js
index 9e6ce0f7..96d32522 100644
--- a/src/util.js
+++ b/src/util.js
@@ -168,7 +168,16 @@ export function getExtensionForFormat(format) {
}
export function getOutFileExtension({ isCustomFormatSelected, outFormat, filePath }) {
- return isCustomFormatSelected ? `.${getExtensionForFormat(outFormat)}` : extname(filePath);
+ if (!isCustomFormatSelected) {
+ const ext = extname(filePath);
+ // QuickTime is quirky about the file extension of mov files (has to be .mov)
+ // https://github.com/mifi/lossless-cut/issues/1075#issuecomment-1072084286
+ const hasMovIncorrectExtension = outFormat === 'mov' && ext.toLowerCase() !== '.mov';
+
+ // OK, just keep the current extension. Because most players will not care about the extension
+ if (!hasMovIncorrectExtension) return extname(filePath);
+ }
+ return `.${getExtensionForFormat(outFormat)}`;
}
// This is used as a fallback and so it has to always generate unique file names