Library / Image, Video & Audio
Image, Video & Audio
Detect silence and speech segments in audio files with FFmpeg
Accepts an uploaded audio file through a form and uses FFmpeg silencedetect to return JSON of silence intervals, speech segments and totals such as percent silent.
What it does
## Detect silence and speech segments in an audio file with FFmpeg (free, no API) Upload an audio file and get back a clean JSON report of every pause: exactly where each silence starts and ends, how long it is, and the derived speech segments in between (plus totals like percent silent). No API key, no account, no paid service - FFmpeg's silencedetect filter measures it for free on your own machine. This is the same measurement technique behind the karaoke-caption templates in this pipeline (accurate word timing depends on knowing exactly where the speaker pauses), pulled out as a standalone analysis tool. Useful on its own for auto-chaptering long recordings, feeding real pause timestamps into any caption/subtitle workflow instead of guessing, or - with the optional output mode below - actually removing the dead air. Customization built in: an Output dropdown lets you choose "Report only" (just the JSON), "Report + trimmed audio" (the detected speech segments stitched back-to-back with FFmpeg's concat filter into a silence-free file), or "Report + SRT markers" (the same segments written out as an SRT file so a video editor can jump straight to the non-silent parts). ### How it works 1. A form takes an audio file, a silence threshold in dB, a minimum silence duration in seconds, and an output mode: report only, a silence-trimmed audio file, or an SRT marker file. 2. The file is saved to a per-run temp folder and analyzed with FFmpeg's silencedetect filter - no output file is rendered at this stage, this only measures. 3. FFmpeg's own Duration line plus every silence_start/silence_end pair are parsed out of its stderr output. 4. Speech segments are derived as everything that is not silence, and a summary (silence count, total silent/speech time, percent silent) is added. 5. If "Report + trimmed audio" was chosen, every speech segment is cut and concatenated with FFmpeg's concat filter into one silence-free file. If "Report + SRT markers" was chosen, the same segments are written out as an SRT subtitle file instead. Either way the file is read back and returned alongside the report - otherwise the report alone is the output. ### Setup Self-hosted n8n only - this uses Execute Command, which n8n Cloud disables. Install FFmpeg on the PATH of the process running n8n, and start n8n with NODES_EXCLUDE="[]" and N8N_RESTRICT_FILE_ACCESS_TO="/tmp" - both are required
The steps
- Audio file and threshold form
- Prepare Run
- Create the temp folder
- Restore the uploaded file
- Save the uploaded file to disk
- Detect silence (FFmpeg)
- Parse the silence report
- Route by output mode
- Build the trim filter (FFmpeg)
- Trim the silence (FFmpeg)
- Verify the trim succeeded
- Read the trimmed audio back
- Attach the report to the trimmed file
- Build SRT markers
17 steps in total.
Similar automations
Image, Video & AudioCombine mismatched video clips into one MP4 with FFmpeg from a form upload11 stepsImage, Video & AudioBurn word-highlighted karaoke captions into videos with FFmpeg and FFprobe12 stepsFiles & Cloud StorageConvert Instagram carousels into TikTok and Reels videos with ffmpeg and SocialRobot26 stepsImage, Video & AudioGenerate and Play Speech with a Python Script4 steps