From 1fe29b8b1a226040d524c21007b8a9d4a560a208 Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Thu, 26 Jun 2025 19:12:39 -0400 Subject: [PATCH] Updates --- about/index.html | 4 +- admin/index.html | 32 +++ books/index.html | 4 +- feed.xml | 90 +++++++- index.html | 39 ++-- music/index.html | 8 +- now/index.html | 4 +- pagefind/fragment/en_516ecfa.pf_fragment | Bin 0 -> 651 bytes pagefind/fragment/en_e36a37a.pf_fragment | Bin 0 -> 994 bytes pagefind/index/en_d06c237.pf_index | Bin 0 -> 2028 bytes pagefind/index/en_da22c02.pf_index | Bin 0 -> 37945 bytes pagefind/pagefind-entry.json | 2 +- pagefind/pagefind.en_34f7847be7.pf_meta | Bin 0 -> 323 bytes .../authority-consents-blind-spot/index.html | 4 +- posts/embracing-mysticism/index.html | 4 +- posts/ffmpeg-audio-cleanup/index.html | 205 ++++++++++++++++++ posts/finally-a-coherent-worldview/index.html | 4 +- posts/index.html | 39 +++- posts/july-21-2025/index.html | 4 +- posts/my-very-own-github-pages/index.html | 4 +- posts/needs-based-communication/index.html | 4 +- posts/site-design-updated/index.html | 4 +- .../index.html | 4 +- posts/thinking-machines/index.html | 4 +- posts/tools-of-the-trade/index.html | 4 +- recipes/amish-egg-noodles/index.html | 4 +- recipes/corn-casserole/index.html | 4 +- recipes/creamy-chicken-orzo/index.html | 4 +- recipes/index.html | 20 +- recipes/luther-salad/index.html | 4 +- recipes/pasta-rosatella/index.html | 4 +- recipes/perfect-homemade-brownies/index.html | 4 +- recipes/sloppy-joes/index.html | 4 +- recipes/spanish-style-rice/index.html | 4 +- search/index.html | 4 +- site.css | 2 +- sitemap.xml | 11 +- tags/ai/index.html | 6 +- tags/communication/index.html | 6 +- tags/ethos/index.html | 10 +- tags/faith/index.html | 10 +- tags/ffmpeg/index.html | 121 +++++++++++ tags/how-to/index.html | 10 +- tags/index.html | 22 +- tags/learning/index.html | 6 +- tags/pages/index.html | 28 +-- tags/selfhosting/index.html | 6 +- tags/software/index.html | 6 +- tags/technical/index.html | 25 ++- tags/zeitgeist/index.html | 8 +- unoffice-hours/index.html | 4 +- uses/index.html | 4 +- webrings/index.html | 4 +- 53 files changed, 651 insertions(+), 161 deletions(-) create mode 100644 admin/index.html create mode 100644 pagefind/fragment/en_516ecfa.pf_fragment create mode 100644 pagefind/fragment/en_e36a37a.pf_fragment create mode 100644 pagefind/index/en_d06c237.pf_index create mode 100644 pagefind/index/en_da22c02.pf_index create mode 100644 pagefind/pagefind.en_34f7847be7.pf_meta create mode 100644 posts/ffmpeg-audio-cleanup/index.html create mode 100644 tags/ffmpeg/index.html diff --git a/about/index.html b/about/index.html index 9a913b8..6cea0ca 100644 --- a/about/index.html +++ b/about/index.html @@ -6,7 +6,7 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> - +

Failed loading TinaCMS assets

Your TinaCMS configuration may be misconfigured, and we could not load the assets for this page.

Please visit this doc for help.

'; + } + + + +
+ + \ No newline at end of file diff --git a/books/index.html b/books/index.html index f9aa6a4..639530d 100644 --- a/books/index.html +++ b/books/index.html @@ -6,7 +6,7 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> - + + + + + + FFmpeg audio cleanup - joshua.seigler.net + + + + + + + + + + + + + +
+ +

FFmpeg audio cleanup

+
+ Joshua SeiglerJune 26, 2025 + + technical + ffmpeg + +
+
+ +
+ +
+

+ I recently needed to process 20+ phone audio recordings. The audio is + mp3 recordings in stereo, made in an environment with echoes and noise + from fans/heaters. +

+

+ Although I could do it easily with + Tenacity + I didn’t want to use a manual process, since it would take days. So I + tried using FFmpeg filters and Bash scripting. +

+

+ I found an FFmpeg filter called + compand + which lets you map an input decibel range to an output decibel range. I + also used the + anlmdn + filter to reduce noise, and the + highpass + filter to help with clarity. +

+

I ran into a couple gotchas.

+
    +
  1. + mpv does something special for audio playback that + prevents audio from clipping. vlc plays the file as it + is. +
  2. +
  3. + Because the compressor has an attack and decay (which is necessary for + things to sound good) it can cause clipping if the volume rises + sharply. Applying a delay parameter with half the + duration of the attack length fixed this. +
  4. +
+

Here is the script:

+
#!/bin/bash
+if [ "$#" == "0" ]; then
+  echo "Error: no arguments provided."
+  echo "Usage: $0 file1 file2 file3 ..."
+  echo "   or: $0 *.ext"
+  exit 1
+fi
+
+trap "exit" INT
+
+while [ "$#" != "0" ]; do
+  base="${1%%.*}"
+  ext="${1##*.}"
+  outfile="./normalized--$base.$ext"
+  if [ ! -f "$outfile" ]; then
+    echo "Processing $1"
+    ffmpeg -i "$1" -v warning -ac 1 -af "compand=attacks=0.3:decays=0.3:delay=0.15:points=-80/-300|-45/-25|-27/-15|0/-12|20/-12,anlmdn=s=10,highpass=f=500" -threads 4 "$outfile"
+  else
+    echo "Skipping $1, already processed."
+  fi
+  shift
+done
+
+

+ If this is useful to you please leave a comment or send an email, I + would love to hear about it. +

+
+ +
+ +
+ + +
+ + diff --git a/posts/finally-a-coherent-worldview/index.html b/posts/finally-a-coherent-worldview/index.html index a6859d8..03dd160 100644 --- a/posts/finally-a-coherent-worldview/index.html +++ b/posts/finally-a-coherent-worldview/index.html @@ -6,7 +6,7 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> - + + + + + + Posts tagged #ffmpeg - joshua.seigler.net + + + + + + + + + + + + +
+ +

Posts tagged #ffmpeg

+
+ +
+
+
+
+ + +
+ + +
+ + diff --git a/tags/how-to/index.html b/tags/how-to/index.html index 75fca0e..f12af19 100644 --- a/tags/how-to/index.html +++ b/tags/how-to/index.html @@ -6,7 +6,7 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> - +