The swiss army knife of lossless video/audio editing
add setting to disable hevc #88
Mikael Finstad16cd41f287c1
diff --git a/public/configStore.js b/public/configStore.jsindex 6b750376..40b8d4fc 100644--- a/public/configStore.js+++ b/public/configStore.js@@ -116,6 +116,7 @@ const defaults = {captureFrameMethod: 'videotag', // we don't default to ffmpeg because ffmpeg might choose a frame slightly offcaptureFrameQuality: 0.95,captureFrameFileNameFormat: 'timestamp',+ enableNativeHevc: true,};// For portable app: https://github.com/mifi/lossless-cut/issues/645diff --git a/src/App.jsx b/src/App.jsxindex e32c359c..afd09f47 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -219,7 +219,7 @@ const App = memo(() => {const allUserSettings = useUserSettingsRoot();const {- captureFormat, setCaptureFormat, customOutDir, setCustomOutDir, keyframeCut, setKeyframeCut, preserveMovData, setPreserveMovData, movFastStart, setMovFastStart, avoidNegativeTs, autoMerge, timecodeFormat, invertCutSegments, setInvertCutSegments, autoExportExtraStreams, askBeforeClose, enableAskForImportChapters, enableAskForFileOpenAction, playbackVolume, setPlaybackVolume, autoSaveProjectFile, wheelSensitivity, invertTimelineScroll, language, ffmpegExperimental, hideNotifications, autoLoadTimecode, autoDeleteMergedSegments, exportConfirmEnabled, setExportConfirmEnabled, segmentsToChapters, setSegmentsToChapters, preserveMetadataOnMerge, setPreserveMetadataOnMerge, setSimpleMode, outSegTemplate, setOutSegTemplate, keyboardSeekAccFactor, keyboardNormalSeekSpeed, enableTransferTimestamps, outFormatLocked, setOutFormatLocked, safeOutputFileName, setSafeOutputFileName, enableAutoHtml5ify, segmentsToChaptersOnly, keyBindings, setKeyBindings, resetKeyBindings, enableSmartCut, customFfPath, storeProjectInWorkingDir, enableOverwriteOutput, mouseWheelZoomModifierKey, captureFrameMethod, captureFrameQuality, captureFrameFileNameFormat,+ captureFormat, setCaptureFormat, customOutDir, setCustomOutDir, keyframeCut, setKeyframeCut, preserveMovData, setPreserveMovData, movFastStart, setMovFastStart, avoidNegativeTs, autoMerge, timecodeFormat, invertCutSegments, setInvertCutSegments, autoExportExtraStreams, askBeforeClose, enableAskForImportChapters, enableAskForFileOpenAction, playbackVolume, setPlaybackVolume, autoSaveProjectFile, wheelSensitivity, invertTimelineScroll, language, ffmpegExperimental, hideNotifications, autoLoadTimecode, autoDeleteMergedSegments, exportConfirmEnabled, setExportConfirmEnabled, segmentsToChapters, setSegmentsToChapters, preserveMetadataOnMerge, setPreserveMetadataOnMerge, setSimpleMode, outSegTemplate, setOutSegTemplate, keyboardSeekAccFactor, keyboardNormalSeekSpeed, enableTransferTimestamps, outFormatLocked, setOutFormatLocked, safeOutputFileName, setSafeOutputFileName, enableAutoHtml5ify, segmentsToChaptersOnly, keyBindings, setKeyBindings, resetKeyBindings, enableSmartCut, customFfPath, storeProjectInWorkingDir, enableOverwriteOutput, mouseWheelZoomModifierKey, captureFrameMethod, captureFrameQuality, captureFrameFileNameFormat, enableNativeHevc,} = allUserSettings;useEffect(() => {@@ -1626,7 +1626,7 @@ const App = memo(() => {const validDuration = isDurationValid(parseFloat(fileMeta.format.duration));const hasLoadedExistingHtml5FriendlyFile = await checkAndSetExistingHtml5FriendlyFile();- const hevcPlaybackSupported = await hevcPlaybackSupportedPromise;+ const hevcPlaybackSupported = enableNativeHevc && await hevcPlaybackSupportedPromise;// 'fastest' works with almost all video filesif (!hasLoadedExistingHtml5FriendlyFile && !willPlayerProperlyHandleVideo({ streams: fileMeta.streams, hevcPlaybackSupported }) && validDuration) {@@ -1655,7 +1655,7 @@ const App = memo(() => {resetState();throw err;}- }, [resetState, setWorking, showPreviewFileLoadedMessage, autoLoadTimecode, html5ifyAndLoadWithPreferences, getEdlFilePath, getEdlFilePathOld, loadEdlFile, enableAskForImportChapters, loadCutSegments, setCopyStreamIdsForPath, setFileFormat, outFormatLocked, setDetectedFileFormat]);+ }, [resetState, setWorking, showPreviewFileLoadedMessage, loadEdlFile, getEdlFilePath, getEdlFilePathOld, enableAskForImportChapters, loadCutSegments, autoLoadTimecode, enableNativeHevc, setCopyStreamIdsForPath, setFileFormat, outFormatLocked, setDetectedFileFormat, html5ifyAndLoadWithPreferences]);const toggleLastCommands = useCallback(() => setLastCommandsVisible(val => !val), []);const toggleSettings = useCallback(() => setSettingsVisible(val => !val), []);diff --git a/src/Settings.jsx b/src/Settings.jsxindex f203955d..c7152d5b 100644--- a/src/Settings.jsx+++ b/src/Settings.jsx@@ -31,7 +31,7 @@ const Settings = memo(({}) => {const { t } = useTranslation();- const { customOutDir, changeOutDir, keyframeCut, toggleKeyframeCut, timecodeFormat, setTimecodeFormat, invertCutSegments, setInvertCutSegments, askBeforeClose, setAskBeforeClose, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, autoSaveProjectFile, setAutoSaveProjectFile, invertTimelineScroll, setInvertTimelineScroll, language, setLanguage, ffmpegExperimental, setFfmpegExperimental, hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode, enableTransferTimestamps, setEnableTransferTimestamps, enableAutoHtml5ify, setEnableAutoHtml5ify, customFfPath, setCustomFfPath, storeProjectInWorkingDir, setStoreProjectInWorkingDir, enableOverwriteOutput, setEnableOverwriteOutput, mouseWheelZoomModifierKey, setMouseWheelZoomModifierKey, captureFrameMethod, setCaptureFrameMethod, captureFrameQuality, setCaptureFrameQuality, captureFrameFileNameFormat, setCaptureFrameFileNameFormat } = useUserSettings();+ const { customOutDir, changeOutDir, keyframeCut, toggleKeyframeCut, timecodeFormat, setTimecodeFormat, invertCutSegments, setInvertCutSegments, askBeforeClose, setAskBeforeClose, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, autoSaveProjectFile, setAutoSaveProjectFile, invertTimelineScroll, setInvertTimelineScroll, language, setLanguage, ffmpegExperimental, setFfmpegExperimental, hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode, enableTransferTimestamps, setEnableTransferTimestamps, enableAutoHtml5ify, setEnableAutoHtml5ify, customFfPath, setCustomFfPath, storeProjectInWorkingDir, setStoreProjectInWorkingDir, enableOverwriteOutput, setEnableOverwriteOutput, mouseWheelZoomModifierKey, setMouseWheelZoomModifierKey, captureFrameMethod, setCaptureFrameMethod, captureFrameQuality, setCaptureFrameQuality, captureFrameFileNameFormat, setCaptureFrameFileNameFormat, enableNativeHevc, setEnableNativeHevc } = useUserSettings();const onLangChange = useCallback((e) => {const { value } = e.target;@@ -314,6 +314,17 @@ const Settings = memo(({</Row>)}+ <Row>+ <KeyCell>{t('Enable HEVC / H265 hardware decoding (you may need to turn this off if you have problems with HEVC files)')}</KeyCell>+ <Table.TextCell>+ <Checkbox+ label={t('Enable HEVC hardware decoding')}+ checked={enableNativeHevc}+ onChange={e => setEnableNativeHevc(e.target.checked)}+ />+ </Table.TextCell>+ </Row>+<Row><KeyCell>{t('Enable experimental ffmpeg features flag?')}</KeyCell><Table.TextCell>diff --git a/src/hooks/useUserSettingsRoot.js b/src/hooks/useUserSettingsRoot.jsindex 13641250..182b48da 100644--- a/src/hooks/useUserSettingsRoot.js+++ b/src/hooks/useUserSettingsRoot.js@@ -125,6 +125,8 @@ export default () => {useEffect(() => safeSetConfig({ captureFrameQuality }), [captureFrameQuality]);const [captureFrameFileNameFormat, setCaptureFrameFileNameFormat] = useState(safeGetConfigInitial('captureFrameFileNameFormat'));useEffect(() => safeSetConfig({ captureFrameFileNameFormat }), [captureFrameFileNameFormat]);+ const [enableNativeHevc, setEnableNativeHevc] = useState(safeGetConfigInitial('enableNativeHevc'));+ useEffect(() => safeSetConfig({ enableNativeHevc }), [enableNativeHevc]);const resetKeyBindings = useCallback(() => {configStore.reset('keyBindings');@@ -227,5 +229,7 @@ export default () => {setCaptureFrameQuality,captureFrameFileNameFormat,setCaptureFrameFileNameFormat,+ enableNativeHevc,+ setEnableNativeHevc,};};