The swiss army knife of lossless video/audio editing
paralellize
Mikael Finstad4b524d4e5c02
diff --git a/src/App.jsx b/src/App.jsxindex 4e81c9d9..07d18c1c 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -1314,7 +1314,8 @@ const App = memo(() => {}try {- const { ff, fd, streams } = await readFileMeta(fp);+ const { fileFormat: ff, formatData: fd, streams } = await readFileMeta(fp);+ // console.log('file meta read', ff);if (!ff) throw new Error('Unable to determine file format');diff --git a/src/ffmpeg.js b/src/ffmpeg.jsindex 4fee34ea..9d6817f1 100644--- a/src/ffmpeg.js+++ b/src/ffmpeg.js@@ -266,12 +266,14 @@ export async function getAllStreams(filePath) {export async function readFileMeta(filePath) {try {- const fd = await getFormatData(filePath);- const ff = await getDefaultOutFormat(filePath, fd);- const allStreamsResponse = await getAllStreams(filePath);+ const [formatData, allStreamsResponse] = await Promise.all([+ getFormatData(filePath),+ getAllStreams(filePath),+ ]);+ const fileFormat = await getDefaultOutFormat(filePath, formatData);const { streams } = allStreamsResponse;- // console.log(streams, fd, ff);- return { fd, ff, streams };+ // console.log(streams, formatData, fileFormat);+ return { formatData, fileFormat, streams };} catch (err) {// Windows will throw error with code ENOENT if format detection fails.if (err.exitCode === 1 || (isWindows && err.code === 'ENOENT')) {