Skip to content

Commit

Permalink
higher FFmpeg progressbar update frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikPeters committed Sep 18, 2024
1 parent 59581f6 commit ce04e7a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/submodules/FFmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,20 @@ export async function mergeFiles(files, reencode, onProgress) {
};
ffmpeg.on("log", onLog);
if (reencode) {
await ffmpeg.exec(['-f', 'concat', '-safe', '0', '-i', 'concat_list.txt', 'output.mp3']);
await ffmpeg.exec([
'-f', 'concat',
'-stats_period', '0.2',
'-safe', '0',
'-i', 'concat_list.txt',
'output.mp3']);
} else {
await ffmpeg.exec(['-f', 'concat', '-safe', '0', '-i', 'concat_list.txt', '-c', 'copy', 'output.mp3']);
await ffmpeg.exec([
'-f', 'concat',
'-stats_period', '0.2',
'-safe', '0',
'-i', 'concat_list.txt',
'-c', 'copy',
'output.mp3']);
}
ffmpeg.off("log", onLog);
const data = await ffmpeg.readFile('output.mp3');
Expand Down

0 comments on commit ce04e7a

Please sign in to comment.