Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to detect the silence inside an audio file using ffmpeg's silencedetect filter and outputting the timestamps inside a txt file.

The function runs but no file is created.

What I have tried:

I've tried the following code :

return new Promise((resolve, reject) => {
    ffmpeg()
    .addInput('input.mp4')
    .audioFilters('silencedetect=n=-50dB')
    .output('output.txt')
    .outputOptions('-y', '-f', 'null')
    .on('error', (error) => {
        reject(new Error(error));
    })
    .on('progress', (progress) => {
        console.log(progress);
    })
    .on('end', () => {
        resolve();
    })
    .run();
})
Posted
Updated 5-Jun-23 2:35am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900