Skip to content

Commit

Permalink
Implement simple file and track metadata editor #496
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Dec 10, 2020
1 parent d971738 commit 5ac299a
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 63 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The main feature is lossless trimming and cutting of video and audio files, whic
- View segment details, export/import cut segments as CSV
- Import segments from: MP4/MKV chapters, Text file, YouTube, CSV, CUE, XML (DaVinci, Final Cut Pro)
- Video thumbnails and audio waveform
- Edit file metadata and per-stream metadata

## Example lossless use cases

Expand Down
12 changes: 11 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ const App = memo(() => {
const [startTimeOffset, setStartTimeOffset] = useState(0);
const [filePath, setFilePath] = useState('');
const [externalStreamFiles, setExternalStreamFiles] = useState([]);
const [customTagsByFile, setCustomTagsByFile] = useState({});
const [customTagsByStreamId, setCustomTagsByStreamId] = useState({});
const [detectedFps, setDetectedFps] = useState();
const [mainStreams, setMainStreams] = useState([]);
const [mainVideoStream, setMainVideoStream] = useState();
Expand Down Expand Up @@ -808,6 +810,8 @@ const App = memo(() => {
setStartTimeOffset(0);
setFilePath(''); // Setting video src="" prevents memory leak in chromium
setExternalStreamFiles([]);
setCustomTagsByFile({});
setCustomTagsByStreamId({});
setDetectedFps();
setMainStreams([]);
setMainVideoStream();
Expand Down Expand Up @@ -1010,6 +1014,8 @@ const App = memo(() => {
ffmpegExperimental,
preserveMovData,
avoidNegativeTs,
customTagsByFile,
customTagsByStreamId,
});

if (outFiles.length > 1 && autoMerge) {
Expand Down Expand Up @@ -1059,7 +1065,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, invertCutSegments, autoDeleteMergedSegments, segmentsToChapters]);
}, [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, invertCutSegments, autoDeleteMergedSegments, segmentsToChapters, customTagsByFile, customTagsByStreamId]);

const onExportPress = useCallback(async () => {
if (working || !filePath) return;
Expand Down Expand Up @@ -1954,6 +1960,10 @@ const App = memo(() => {
setShortestFlag={setShortestFlag}
nonCopiedExtraStreams={nonCopiedExtraStreams}
AutoExportToggler={AutoExportToggler}
customTagsByFile={customTagsByFile}
setCustomTagsByFile={setCustomTagsByFile}
customTagsByStreamId={customTagsByStreamId}
setCustomTagsByStreamId={setCustomTagsByStreamId}
/>
</SideSheet>

Expand Down
Loading

0 comments on commit 5ac299a

Please sign in to comment.