Библиотека / Изображения, видео и аудио
Изображения, видео и аудио
Определение участков тишины и речи в аудиофайлах с помощью FFmpeg
Принимает загруженный через форму аудиофайл и с помощью FFmpeg silencedetect возвращает JSON с интервалами тишины, сегментами речи и итогами, например процентом тишины.
Что делает
## 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
Шаги
- 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.
Похожие автоматизации
Изображения, видео и аудиоОбъединение видеоклипов с разным разрешением в один MP4 через FFmpeg из формыШагов: 11Изображения, видео и аудиоНаложение караоке-субтитров с подсветкой слов на видео через FFmpeg и FFprobeШагов: 12Файлы и облачное хранилищеConvert Instagram carousels into TikTok and Reels videos with ffmpeg and SocialRobotШагов: 26Файлы и облачное хранилищеЧтение и обработка локального файла командами оболочкиШагов: 8