The swiss army knife of lossless video/audio editing
reformat
Mikael Finstadfa7b36f69fc9
diff --git a/src/main/ffmpeg.ts b/src/main/ffmpeg.tsindex 2970dd12..1fb536e2 100644--- a/src/main/ffmpeg.ts+++ b/src/main/ffmpeg.ts@@ -53,7 +53,12 @@ export function abortFfmpegs() {});}-function handleProgress(process: { stderr: Readable | null }, durationIn: number | undefined, onProgress: (a: number) => void, customMatcher: (a: string) => void = () => undefined) {+function handleProgress(+ process: { stderr: Readable | null },+ durationIn: number | undefined,+ onProgress: (a: number) => void,+ customMatcher: (a: string) => void = () => undefined,+) {if (!onProgress) return;if (process.stderr == null) return;onProgress(0);@@ -425,7 +430,15 @@ function getCodecOpts(captureFormat: CaptureFormat) {}export async function captureFrames({ from, to, videoPath, outPathTemplate, quality, filter, framePts, onProgress, captureFormat }: {- from: number, to: number, videoPath: string, outPathTemplate: string, quality: number, filter?: string | undefined, framePts?: boolean | undefined, onProgress: (p: number) => void, captureFormat: CaptureFormat,+ from: number,+ to: number,+ videoPath: string,+ outPathTemplate: string,+ quality: number,+ filter?: string | undefined,+ framePts?: boolean | undefined,+ onProgress: (p: number) => void,+ captureFormat: CaptureFormat,}) {const args = ['-ss', String(from),diff --git a/src/renderer/src/hooks/useFrameCapture.ts b/src/renderer/src/hooks/useFrameCapture.tsindex f213ae1d..0e4b552c 100644--- a/src/renderer/src/hooks/useFrameCapture.ts+++ b/src/renderer/src/hooks/useFrameCapture.ts@@ -25,9 +25,22 @@ function getFrameFromVideo(video: HTMLVideoElement, format: CaptureFormat, qualireturn dataUriToBuffer(dataUri);}-export default ({ formatTimecode, treatOutputFileModifiedTimeAsStart }: { formatTimecode: FormatTimecode, treatOutputFileModifiedTimeAsStart?: boolean | undefined | null }) => {+export default ({ formatTimecode, treatOutputFileModifiedTimeAsStart }: {+ formatTimecode: FormatTimecode,+ treatOutputFileModifiedTimeAsStart?: boolean | undefined | null,+}) => {const captureFramesRange = useCallback(async ({ customOutDir, filePath, fps, fromTime, toTime, estimatedMaxNumFiles, captureFormat, quality, filter, onProgress, outputTimestamps }: {- customOutDir, filePath: string, fps: number, fromTime: number, toTime: number, estimatedMaxNumFiles: number, captureFormat: CaptureFormat, quality: number, filter?: string | undefined, onProgress: (a: number) => void, outputTimestamps: boolean+ customOutDir: string | undefined,+ filePath: string,+ fps: number,+ fromTime: number,+ toTime: number,+ estimatedMaxNumFiles: number,+ captureFormat: CaptureFormat,+ quality: number,+ filter?: string | undefined,+ onProgress: (a: number) => void,+ outputTimestamps: boolean,}) => {const getSuffix = (prefix: string) => `${prefix}.${captureFormat}`;