<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: WgeorgeAssistantIA</title>
    <description>The latest articles on DEV Community by WgeorgeAssistantIA (@wgeorgeassistantia).</description>
    <link>https://dev.to/wgeorgeassistantia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3988867%2Fb500a859-a1d4-4ff7-a1d4-f187a1632580.png</url>
      <title>DEV Community: WgeorgeAssistantIA</title>
      <link>https://dev.to/wgeorgeassistantia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wgeorgeassistantia"/>
    <language>en</language>
    <item>
      <title>Packaging FFmpeg in a Standalone App: What It Costs on Windows, Linux and Android</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Thu, 26 Nov 2026 08:12:53 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/packaging-ffmpeg-in-a-standalone-app-what-it-costs-on-windows-linux-and-android-56fi</link>
      <guid>https://dev.to/wgeorgeassistantia/packaging-ffmpeg-in-a-standalone-app-what-it-costs-on-windows-linux-and-android-56fi</guid>
      <description>&lt;p&gt;On a dev machine, FFmpeg is one line away: &lt;code&gt;sudo apt install ffmpeg&lt;/code&gt;, check it's on your &lt;code&gt;PATH&lt;/code&gt;, call it with &lt;code&gt;subprocess&lt;/code&gt;. The cost shows up when you ship the app to people who have no terminal and just want an installer.&lt;/p&gt;

&lt;p&gt;I build &lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;VoxCut&lt;/a&gt;, a silence remover for audio and video. It ships on Windows (PyInstaller), Linux (AppImage, Snap, Flatpak) and Android. Here is how FFmpeg is packaged in each, what it weighs, and one check to run before shipping.&lt;/p&gt;

&lt;h2&gt;
  
  
  One PATH hook for the desktop builds
&lt;/h2&gt;

&lt;p&gt;The desktop app is Python. Instead of hard-coding a binary path everywhere, there is one place that decides where FFmpeg lives, and every &lt;code&gt;subprocess&lt;/code&gt; call just says &lt;code&gt;ffmpeg&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_get_base_dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;getattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"frozen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_MEIPASS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parent&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_setup_ffmpeg_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ffmpeg_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_get_base_dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="s2"&gt;"ffmpeg"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ffmpeg_dir&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"PATH"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ffmpeg_dir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathsep&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"PATH"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="nf"&gt;_setup_ffmpeg_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In development there is no &lt;code&gt;ffmpeg/&lt;/code&gt; folder next to the code, so the system FFmpeg is used. In a frozen build the folder is inside the bundle and goes first on &lt;code&gt;PATH&lt;/code&gt;. The same code serves Windows and Linux; only the PyInstaller spec file differs. The bundled binary wins over whatever the user has installed, which is what you want: you tested your filters against one version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows: two binaries of about 100 MB each
&lt;/h2&gt;

&lt;p&gt;The Windows spec copies both executables into an &lt;code&gt;ffmpeg/&lt;/code&gt; folder of the bundle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;datas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app_dir&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="s1"&gt;'ffmpeg'&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="s1"&gt;'ffmpeg.exe'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'ffmpeg'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app_dir&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="s1"&gt;'ffmpeg'&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="s1"&gt;'ffprobe.exe'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ffmpeg'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The build is &lt;code&gt;onedir&lt;/code&gt;, not &lt;code&gt;onefile&lt;/code&gt;. The comment in my spec says why: the executable holds only the code and the binaries sit beside it, so the app starts almost instantly with no temporary extraction.&lt;/p&gt;

&lt;p&gt;What this costs: &lt;code&gt;ffmpeg.exe&lt;/code&gt; is 101 MB and &lt;code&gt;ffprobe.exe&lt;/code&gt; 101 MB. They are two statically linked copies of the same libraries, so you pay twice. If you only need one of them, ship one.&lt;/p&gt;

&lt;p&gt;One small Windows detail: the subprocess calls are started with &lt;code&gt;CREATE_NO_WINDOW&lt;/code&gt;, otherwise a console window flashes at each call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Linux: the same bundle, three containers
&lt;/h2&gt;

&lt;p&gt;The Linux build downloads a static FFmpeg in &lt;code&gt;build_linux.sh&lt;/code&gt;, marks it executable, and PyInstaller packs it into the same &lt;code&gt;ffmpeg/&lt;/code&gt; folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget -O &lt;span class="s2"&gt;"$tmp/ffmpeg.tar.xz"&lt;/span&gt; &lt;span class="s2"&gt;"$FFMPEG_STATIC_URL"&lt;/span&gt;   &lt;span class="c"&gt;# a static Linux build&lt;/span&gt;
cp &lt;span class="s2"&gt;"$d/ffmpeg"&lt;/span&gt;  ffmpeg-linux/ffmpeg
cp &lt;span class="s2"&gt;"$d/ffprobe"&lt;/span&gt; ffmpeg-linux/ffprobe
chmod +x ffmpeg-linux/ffmpeg ffmpeg-linux/ffprobe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are about 80 MB each (79.8 MB and 79.7 MB). The result is then packaged three ways, and the sandbox is where the differences are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AppImage:&lt;/strong&gt; the bundle as-is, no sandbox.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Snap:&lt;/strong&gt; &lt;code&gt;confinement: strict&lt;/code&gt; on &lt;code&gt;core24&lt;/code&gt;, with the &lt;code&gt;home&lt;/code&gt; and &lt;code&gt;removable-media&lt;/code&gt; plugs. The snap doesn't compile FFmpeg; it unpacks the PyInstaller tarball into &lt;code&gt;opt/voxcut/&lt;/code&gt; and a one-line launcher runs it. So FFmpeg travels inside the bundle and the PATH hook above works unchanged. The cost is access: files outside the home folder and removable media are out of reach unless the user connects another plug.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flatpak:&lt;/strong&gt; &lt;code&gt;--filesystem=home&lt;/code&gt; so the app can read the chosen file and write the export.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I did not need classic confinement, because the app only works on files the user picks in their home folder or on external media. If your users keep audio on another internal drive, that is exactly the case where strict confinement will bite.&lt;/p&gt;

&lt;h2&gt;
  
  
  Android: no binary at all
&lt;/h2&gt;

&lt;p&gt;Android is not a port of the Python code. It is a Flutter app, and FFmpeg comes as a library through the &lt;code&gt;ffmpeg_kit_flutter_new&lt;/code&gt; package (&lt;code&gt;^4.2.1&lt;/code&gt;), so nothing is executed as a separate process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;FFmpegKit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'-y -f concat -safe 0 -i "${concatFile.path}" -af "$af" "$tempOutputPath"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nc"&gt;ReturnCode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getReturnCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* handle error */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Intermediate files go to the app's temporary directory, and the export is saved into Downloads through MediaStore on Android 10 and later (the saved name can differ if a file with the same name exists, so the app reads back the name that was actually written). Cancelling is &lt;code&gt;FFmpegKit.cancel()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The mobile-specific cost is memory, not packaging: I cap the total input size at 500 MB, a limit written in the code as an out-of-memory safety margin for phones.&lt;/p&gt;

&lt;h2&gt;
  
  
  One check before you ship: the licence
&lt;/h2&gt;

&lt;p&gt;FFmpeg is released under the LGPL or the GPL depending on how a given binary was built. Run &lt;code&gt;ffmpeg -version&lt;/code&gt; and read the &lt;code&gt;configuration:&lt;/code&gt; line: if it contains &lt;code&gt;--enable-gpl&lt;/code&gt;, that build is GPL, and the obligations that come with redistributing it are different. The FFmpeg project explains them on its &lt;a href="https://ffmpeg.org/legal.html" rel="noopener noreferrer"&gt;legal page&lt;/a&gt;. Check this for the exact build you bundle, before your first release.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do again
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One PATH hook, one folder.&lt;/strong&gt; Every call says &lt;code&gt;ffmpeg&lt;/code&gt;; the packaging decides which one. Switching bundling method didn't touch the audio code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Count your copies.&lt;/strong&gt; &lt;code&gt;ffmpeg&lt;/code&gt; and &lt;code&gt;ffprobe&lt;/code&gt; are about 100 MB each on Windows. Ship only what you call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test the packaged build, not the dev run.&lt;/strong&gt; In development the system FFmpeg masks a missing bundle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read the &lt;code&gt;configuration:&lt;/code&gt; line&lt;/strong&gt; of every FFmpeg you redistribute.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>android</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Why Technical Video Analysis Requires More Than a YouTube Transcript</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Tue, 17 Nov 2026 09:45:32 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/why-technical-video-analysis-requires-more-than-a-youtube-transcript-4jbk</link>
      <guid>https://dev.to/wgeorgeassistantia/why-technical-video-analysis-requires-more-than-a-youtube-transcript-4jbk</guid>
      <description>&lt;p&gt;A transcript looks like the whole video in text form. It is not. Anyone who has built a pipeline on top of YouTube captions learns this the hard way. Here are the limits we ran into, and what each one implies for a tool that analyses technical videos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 1: captions get product names wrong
&lt;/h2&gt;

&lt;p&gt;Automatic speech recognition is trained on everyday language. Product names, especially new ones, come out as plausible words. A framework becomes two English words, a CLI becomes a person's name. If you extract tools from raw captions, you inherit these errors.&lt;/p&gt;

&lt;p&gt;What helps in our pipeline: the prompt asks the model to output the canonical spelling ("mongod" becomes "MongoDB") while copying the quote exactly as it appears. A grounding check in code then confirms the name really occurs in the transcript, tolerating garbled or split spellings ("fast API", "postgress"). Finally, mentions that resolve to the same official link are merged, which catches variants like a mangled "Coro" for Choreo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 2: the screen is not in the transcript
&lt;/h2&gt;

&lt;p&gt;In a technical tutorial, the presenter often says "now let's open this" while the screen shows a tool's name. Nothing is said, so nothing is captured. A transcript-only approach misses tools that are shown but not spoken. This is a real limit, and a tool that only reads captions should say so instead of implying completeness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 3: length
&lt;/h2&gt;

&lt;p&gt;Long videos produce long transcripts. In one of our early versions, the text was cut at a fixed number of characters before analysis. A seven-hour 29-minute course was analysed on only its first 12 minutes, and returned four tools, without any warning. The output looked normal. That is the worst kind of bug: silent and plausible.&lt;/p&gt;

&lt;p&gt;The fix was to split the transcript into chunks, analyse them (three in parallel), merge the results, and report coverage: when part of a video is not analysed, the result says so, with the analysed duration over the total. We also found that chunk size changes the result. On a single transcript of about 475,000 characters:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Chunk size&lt;/th&gt;
&lt;th&gt;Calls&lt;/th&gt;
&lt;th&gt;Tools found&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;15,000 characters&lt;/td&gt;
&lt;td&gt;32&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;60,000 characters&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;120,000 characters&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One transcript is a small sample, so read this as a tendency: bigger chunks mean fewer calls and fewer tools. Around 30,000 characters gave us a workable balance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 4: the model drifts
&lt;/h2&gt;

&lt;p&gt;Models can answer in a different language from the video. We saw French summaries appear for English videos. Since each chunk is analysed in isolation, there was no shared reference, so we now pass the same short excerpt of the video to every chunk and put the language instruction after the content, where it is the last thing the model reads. Models can also paraphrase quotes. Even with explicit instructions, quotes did not always match the transcript word for word in our tests, so code checks them: a quote that is not verbatim is not presented as one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 5: context and intent
&lt;/h2&gt;

&lt;p&gt;The transcript does not tell you why something was mentioned. A tool dismissed as outdated and a tool recommended look the same in a list of names. You need the surrounding sentence to tell them apart, which is why quotes should travel with the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means in practice
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Treat a transcript as a noisy source, not ground truth&lt;/li&gt;
&lt;li&gt;Report coverage and limits to the user&lt;/li&gt;
&lt;li&gt;Process long inputs fully and say when you could not&lt;/li&gt;
&lt;li&gt;Validate model output with code&lt;/li&gt;
&lt;li&gt;Keep the evidence next to each result&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where we applied this
&lt;/h2&gt;

&lt;p&gt;These were the lessons behind several fixes in &lt;a href="https://www.vidscope.fr" rel="noopener noreferrer"&gt;VidScope&lt;/a&gt;, our tool for extracting tools and technologies from technical YouTube videos. Some limits remain, such as tools shown but never spoken, and we think it is better to say so than to hide them.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is a YouTube transcript enough to analyse a video?&lt;/strong&gt;&lt;br&gt;
For the spoken content, mostly, but it misspells names, misses what is only shown on screen and says nothing about intent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How should long videos be handled?&lt;/strong&gt;&lt;br&gt;
Process the full transcript in chunks, merge the results and report coverage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why validate model output with code?&lt;/strong&gt;&lt;br&gt;
Models can paraphrase quotes or drift in language, so automatic checks catch errors before users see them.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Don't Embed a Live Matplotlib Canvas in Your Desktop App: Render the Waveform as a Bitmap</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Tue, 17 Nov 2026 09:11:53 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/dont-embed-a-live-matplotlib-canvas-in-your-desktop-app-render-the-waveform-as-a-bitmap-21a</link>
      <guid>https://dev.to/wgeorgeassistantia/dont-embed-a-live-matplotlib-canvas-in-your-desktop-app-render-the-waveform-as-a-bitmap-21a</guid>
      <description>&lt;p&gt;If you search for "audio waveform Python GUI", the usual advice is to embed a Matplotlib canvas (&lt;code&gt;FigureCanvasTkAgg&lt;/code&gt;, &lt;code&gt;FigureCanvasQTAgg&lt;/code&gt;) in your window.&lt;/p&gt;

&lt;p&gt;It works. It also has a catch that only shows up when the user resizes the window.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;VoxCut&lt;/a&gt;, a desktop tool that removes silences from audio, I kept Matplotlib for drawing the waveform. What I changed is &lt;em&gt;how&lt;/em&gt; it is embedded: the waveform is rendered &lt;strong&gt;once, off-screen, into a bitmap&lt;/strong&gt;, and the window only ever shows that bitmap. Here is the pattern, and why it fixed the resize glitches.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with a live canvas
&lt;/h2&gt;

&lt;p&gt;A live Matplotlib canvas installs its own resize handler. Every time the widget changes size, it re-renders the whole figure into the Agg buffer, synchronously, on the UI thread.&lt;/p&gt;

&lt;p&gt;When a user drags a window corner, the OS fires a stream of &lt;code&gt;&amp;lt;Configure&amp;gt;&lt;/code&gt; events. Each one triggers a full Matplotlib render. I measured one render of a small waveform strip (1,200 × 72 px, 1,400 peak values) at about &lt;strong&gt;37 ms on median, 64 ms at worst&lt;/strong&gt; on my dev machine. That is already two to four frames at 60 Hz, per event, blocking the thread that repaints the rest of the window.&lt;/p&gt;

&lt;p&gt;In VoxCut this showed up as trails and ghosting while resizing and scrolling: the window could not repaint because the UI thread was busy re-rendering a 72-pixel-high strip.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: reduce the audio to ~1,400 numbers
&lt;/h2&gt;

&lt;p&gt;Before drawing anything, you don't want raw samples. You want an envelope: one value per horizontal bin.&lt;/p&gt;

&lt;p&gt;VoxCut asks FFmpeg for a mono, low-rate raw stream and reduces it on the fly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ffmpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-v"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"quiet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-i"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="s2"&gt;"-vn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-ac"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-ar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"8000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-f"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s16le"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;proc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DEVNULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it reads the pipe in 128 KB chunks, so memory stays flat whatever the file length:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;proc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;131072&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;frombuffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;i2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;astype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;float32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each bin keeps the &lt;strong&gt;maximum absolute value&lt;/strong&gt; of its samples. The total number of bins is fixed (1,400 points), and the bin size is &lt;code&gt;total_samples // points&lt;/code&gt;. At the end the array is normalized to 0–1.&lt;/p&gt;

&lt;p&gt;Two details matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;8 kHz is plenty&lt;/strong&gt; for a visual envelope. You are not listening to it, you are drawing it.&lt;/li&gt;
&lt;li&gt;The loop carries a &lt;code&gt;leftover&lt;/code&gt; byte when a chunk ends in the middle of a 16-bit sample, and a &lt;code&gt;cur_max&lt;/code&gt; / &lt;code&gt;cur_count&lt;/code&gt; pair across chunk boundaries, so bins are correct even when they straddle two reads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On my machine, the NumPy part for one hour of 8 kHz PCM (440 chunks of 128 KB) costs about &lt;strong&gt;0.1 s&lt;/strong&gt;. The real cost is FFmpeg decoding the file, not the reduction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: render once, off-screen, to a bitmap
&lt;/h2&gt;

&lt;p&gt;Matplotlib stays, but with the &lt;code&gt;Agg&lt;/code&gt; backend and no live canvas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib&lt;/span&gt;
&lt;span class="n"&gt;matplotlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Agg"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;matplotlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Figure&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;matplotlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;backends&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;backend_agg&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;FigureCanvasAgg&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="no"&gt;PIL&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;

&lt;span class="n"&gt;fig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w_px&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h_px&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dpi&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;facecolor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;bg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_axes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;axis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"off"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;peaks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;peaks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;peaks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FigureCanvasAgg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_width_height&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;frombuffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"RGBA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;buffer_rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"raw"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"RGBA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is a plain PIL image, shown in a label. A bitmap in a label is resized and scrolled natively by the toolkit, with none of the smearing you get when a widget re-renders itself on every event.&lt;/p&gt;

&lt;p&gt;A bonus: Matplotlib is heavy to import (about 2 seconds in a frozen executable for VoxCut), so it is loaded lazily, the first time a file is opened, and the window appears faster at startup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: stretch while dragging, re-render when it stops
&lt;/h2&gt;

&lt;p&gt;You still want a sharp waveform at the final size. The trick is to do two different things depending on whether the user is still dragging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_on_configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_avail_width&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Pure vertical scroll also fires &amp;lt;Configure&amp;gt;: width unchanged -&amp;gt; do nothing&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_last_rendered_w&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_last_rendered_w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="c1"&gt;# 1. Instant: stretch the existing bitmap (no Matplotlib call)&lt;/span&gt;
    &lt;span class="n"&gt;stretched&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_raw_pil_img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h_phys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Resampling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;BILINEAR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_lbl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ctk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CTkImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stretched&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;H&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 2. Debounced: re-render sharply once the drag has stopped&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_render_job&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;after_cancel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_render_job&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_render_job&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;after&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_rerender&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things make this work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ignore events where the width didn't change.&lt;/strong&gt; Scrolling the page vertically also emits &lt;code&gt;&amp;lt;Configure&amp;gt;&lt;/code&gt; (the widget's relative position changed). A 4 px threshold on the width filters those out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A PIL resize is cheap.&lt;/strong&gt; I measured a bilinear resize of the strip at about &lt;strong&gt;3 ms median (6 ms worst)&lt;/strong&gt;, against 37 ms for a full Matplotlib render. During the drag the user sees a slightly soft bitmap that follows the mouse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A 250 ms debounce&lt;/strong&gt; (&lt;code&gt;after&lt;/code&gt; / &lt;code&gt;after_cancel&lt;/code&gt;) triggers the single sharp re-render once the window stops moving.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 4: the playhead is not part of the image
&lt;/h2&gt;

&lt;p&gt;The moving cursor and the hover timecode tooltip are &lt;strong&gt;separate widgets placed on top of the bitmap&lt;/strong&gt;, not pixels in it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CTkFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_lbl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fg_color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;text_color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;corner_radius&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_cursor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;frac&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_cursor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;place&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;relx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;frac&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;relheight&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moving a 2-pixel-wide frame with &lt;code&gt;place(relx=...)&lt;/code&gt; never touches the waveform image. The waveform is rendered when the data or the width changes, and not once per playback tick. That is the same idea as "layering" in a game engine, using ordinary toolkit widgets.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would take from this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Don't let a plotting library own your resize loop.&lt;/strong&gt; Matplotlib is fine as a &lt;em&gt;renderer&lt;/em&gt;; it is a poor fit as a &lt;em&gt;live widget&lt;/em&gt; in a window that gets resized and scrolled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduce first, draw second.&lt;/strong&gt; A fixed number of bins (here 1,400) decouples the drawing cost from the file length.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use a cheap approximation while the user is moving things, and the exact result when they stop.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep moving things (cursor, tooltip) out of the expensive layer.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A caveat on the numbers: they come from a deliberately throttled development machine, from my own micro-benchmark (30 renders, 60 resizes), not from a rigorous study. Treat them as orders of magnitude, and measure on your own hardware.&lt;/p&gt;

&lt;p&gt;VoxCut is the app this pattern comes from. If you want to see the result, it is at &lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;voxcutpro.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>tkinter</category>
      <category>performance</category>
      <category>audio</category>
    </item>
    <item>
      <title>Streaming FFmpeg Subprocesses: Handling Multi-GB Audio Without Crashing RAM</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Mon, 09 Nov 2026 15:33:08 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/streaming-ffmpeg-subprocesses-handling-multi-gb-audio-without-crashing-ram-4o1o</link>
      <guid>https://dev.to/wgeorgeassistantia/streaming-ffmpeg-subprocesses-handling-multi-gb-audio-without-crashing-ram-4o1o</guid>
      <description>&lt;p&gt;Most audio tutorials in Python start by loading the whole file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;librosa&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;librosa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;podcast.wav&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# the entire file, decoded, in RAM
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is fine for a 3-minute clip. It is not fine for what people actually send to a silence remover: two-hour podcast recordings, multi-gigabyte WAV exports, screen recordings with an audio track. Decoded to float32, one hour of 48 kHz stereo is about 1.4 GB, and two hours is about 2.8 GB, before Python has made a single copy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;VoxCut&lt;/a&gt;, my desktop silence remover, never holds a whole file in memory. It talks to FFmpeg through pipes and lets FFmpeg do the heavy decoding. There are three different patterns in the code, and each one solves a different problem. This post walks through them, then shows what I measured on a 1.38 GB file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pattern 1: don't bring the audio into Python at all
&lt;/h2&gt;

&lt;p&gt;The first instinct for silence detection is to stream samples into NumPy and compute the loudness of each window. VoxCut doesn't do that. FFmpeg already has a &lt;code&gt;silencedetect&lt;/code&gt; filter, so the app runs it with a null output and only reads the &lt;strong&gt;log lines&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ffmpeg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-i&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-vn&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-af&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;silencedetect=noise=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;noise_db&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;dB:d=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;min_silence_s&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;null&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;proc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVNULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;replace&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;proc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;silence_start:\s*(-?\d+\.?\d*)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;starts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
    &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;silence_end:\s*(-?\d+\.?\d*)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ends&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No sample ever crosses the pipe. Python only receives short text lines: the &lt;code&gt;Duration:&lt;/code&gt; header, &lt;code&gt;time=&lt;/code&gt; progress lines (which drive the progress bar), and the &lt;code&gt;silence_start&lt;/code&gt; / &lt;code&gt;silence_end&lt;/code&gt; timestamps. Decoding and level measurement stay in FFmpeg's C code.&lt;/p&gt;

&lt;p&gt;If FFmpeg already has a filter that computes what you need, parsing its output is the cheapest stream you will ever write.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pattern 2: stream raw PCM when you need the samples
&lt;/h2&gt;

&lt;p&gt;The waveform preview does need samples, but not many. VoxCut asks FFmpeg for mono 16-bit PCM at 8 kHz and reads it from stdout in fixed-size chunks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ffmpeg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-v&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;quiet&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-i&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_file&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-vn&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            &lt;span class="c1"&gt;# ignore video
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-ac&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="c1"&gt;# downmix to mono
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-ar&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8000&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;# 8 kHz is plenty for a picture of the waveform
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;s16le&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;# raw signed 16-bit little-endian
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;              &lt;span class="c1"&gt;# write to stdout
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;proc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVNULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;leftover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;proc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;131072&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# 128 KB at a time
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;leftover&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;                       &lt;span class="c1"&gt;# 2 bytes per sample
&lt;/span&gt;    &lt;span class="n"&gt;leftover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:]&lt;/span&gt;                  &lt;span class="c1"&gt;# keep a dangling odd byte for next time
&lt;/span&gt;    &lt;span class="n"&gt;samples&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;frombuffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;dtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;i2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;astype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;float32&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="c1"&gt;# ...fold samples into ~1,400 peak bins for the preview
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details matter here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The leftover byte.&lt;/strong&gt; &lt;code&gt;read(131072)&lt;/code&gt; is not guaranteed to return an even number of bytes. If you call &lt;code&gt;np.frombuffer(chunk, dtype="&amp;lt;i2")&lt;/code&gt; on an odd-length buffer, NumPy raises &lt;code&gt;ValueError&lt;/code&gt;. If you silently drop the extra byte, every later sample is misaligned. Carrying it over to the next read is the fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Downsampling happens in FFmpeg.&lt;/strong&gt; Going from 48 kHz stereo to 8 kHz mono divides the data by 12 before it reaches Python.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same loop also reports progress (bytes read ÷ expected bytes) and checks a cancel flag between chunks. Neither is possible when a single &lt;code&gt;load()&lt;/code&gt; call blocks for 40 seconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pattern 3: decode → NumPy → encode, without a temp file
&lt;/h2&gt;

&lt;p&gt;Exporting with crossfades at each cut is the case where Python has to modify the audio. VoxCut runs &lt;strong&gt;two&lt;/strong&gt; FFmpeg processes, one decoding to float32 on stdout and one encoding from stdin, with NumPy in between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;dec_cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ffmpeg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-v&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-i&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-map&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0:a:0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;f32le&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-acodec&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pcm_f32le&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;enc_cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ffmpeg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-v&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;f32le&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-ar&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
           &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-ac&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-i&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;codec_args&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;dec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dec_cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVNULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;enc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;enc_cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                       &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVNULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVNULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The loop reads one second of audio at a time. It reads and discards the silent parts, and writes the kept parts to the encoder. It holds back only the last few milliseconds of each segment so they can be blended with the start of the next one. The decoded file never exists on disk, and Python never holds more than about a second of it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The pipe deadlock that will bite you
&lt;/h2&gt;

&lt;p&gt;All three snippets share one habit: &lt;strong&gt;each process has at most one pipe that Python reads.&lt;/strong&gt; Patterns 2 and 3 send stderr to &lt;code&gt;DEVNULL&lt;/code&gt;. Pattern 1 reads stderr and sends stdout to &lt;code&gt;DEVNULL&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is the version that hangs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# DON'T: two pipes, but you only ever read one of them
&lt;/span&gt;&lt;span class="n"&gt;proc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;proc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;65536&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OS pipe buffers are small. If FFmpeg writes enough to stderr (warnings about a damaged file, or the progress line it keeps printing unless you pass &lt;code&gt;-nostats&lt;/code&gt; or &lt;code&gt;-v quiet&lt;/code&gt;), that buffer fills up. FFmpeg then blocks on its next stderr write and stops producing stdout. Meanwhile your loop is waiting on stdout. Neither side moves, nothing crashes, and no error appears. The app just freezes partway through a long file.&lt;/p&gt;

&lt;p&gt;The fixes, from simplest to most flexible:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send the stream you don't need to &lt;code&gt;subprocess.DEVNULL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Make FFmpeg quieter (&lt;code&gt;-v error&lt;/code&gt; or &lt;code&gt;-v quiet&lt;/code&gt;), so stderr stays tiny.&lt;/li&gt;
&lt;li&gt;If you really need both, drain stderr on a separate thread, or use &lt;code&gt;communicate()&lt;/code&gt; when the output is small.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What it costs in practice
&lt;/h2&gt;

&lt;p&gt;I measured this on my dev machine, which is not fast. The test file was a 2-hour, 48 kHz stereo WAV (1.38 GB). I compared VoxCut's waveform loop with the "load everything" approach: decode the whole file to float32 through the same FFmpeg, then hand it to NumPy. That is what any loader returning a full array has to hold. Peak memory is the process's peak working set, read from Windows.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Python peak RAM&lt;/th&gt;
&lt;th&gt;FFmpeg peak RAM&lt;/th&gt;
&lt;th&gt;First data in Python&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Load the whole file as float32&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5,275 MB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;20 MB&lt;/td&gt;
&lt;td&gt;44 s&lt;/td&gt;
&lt;td&gt;46 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stream 8 kHz mono, 128 KB reads&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;33 MB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;19 MB&lt;/td&gt;
&lt;td&gt;0.12 s&lt;/td&gt;
&lt;td&gt;6.5 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two things surprised me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The full load peaked at almost twice the size of the decoded audio&lt;/strong&gt; (5.3 GB for 2.8 GB of float32). Reading an unbounded pipe into one &lt;code&gt;bytes&lt;/code&gt; object means the buffer grows and gets copied, so for a moment you hold two copies. On an 8 GB laptop that is already swap territory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The streaming version barely moved Python's memory.&lt;/strong&gt; The process started at 32 MB with NumPy imported and peaked at 33 MB. The audio itself never accounted for more than a couple of 128 KB chunks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The streaming run is also faster overall. That is mostly because it asks FFmpeg for 12× less data, not because of the pipe itself. Getting the first data in 0.12 s instead of 44 s is what lets the app show a progress bar from the start.&lt;/p&gt;




&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check whether FFmpeg can compute the answer itself.&lt;/strong&gt; If a filter exists (&lt;code&gt;silencedetect&lt;/code&gt;, &lt;code&gt;ebur128&lt;/code&gt;, &lt;code&gt;astats&lt;/code&gt;), parse its output and keep the samples out of Python.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When you need samples, ask for as few as possible.&lt;/strong&gt; Downmix and resample in FFmpeg (&lt;code&gt;-ac&lt;/code&gt;, &lt;code&gt;-ar&lt;/code&gt;), and pick the sample format you will actually use (&lt;code&gt;s16le&lt;/code&gt; or &lt;code&gt;f32le&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read fixed-size chunks and handle partial reads.&lt;/strong&gt; Carry leftover bytes over to the next read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never leave a pipe you don't read.&lt;/strong&gt; Use &lt;code&gt;DEVNULL&lt;/code&gt;, lower the log level, or drain it on another thread.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These three patterns are what let &lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;VoxCut&lt;/a&gt; open multi-hour recordings on an ordinary laptop without the waveform preview, the silence scan or the export ever loading the file into RAM.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ffmpeg</category>
      <category>performance</category>
      <category>audio</category>
    </item>
    <item>
      <title>How to Reduce AI Hallucinations When Extracting Information from Videos</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Thu, 05 Nov 2026 12:17:09 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/how-to-reduce-ai-hallucinations-when-extracting-information-from-videos-23kc</link>
      <guid>https://dev.to/wgeorgeassistantia/how-to-reduce-ai-hallucinations-when-extracting-information-from-videos-23kc</guid>
      <description>&lt;p&gt;When a language model reads a transcript and returns a list of tools, two kinds of mistakes appear. The first is invention: a tool that was never mentioned. The second is subtler: a real tool paired with the wrong link or the wrong meaning. Both erode trust. This post lists the techniques that helped us reduce them, and the numbers we saw, with the caveat that our samples are small.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistake 1: tools that were never said
&lt;/h2&gt;

&lt;p&gt;The cure is to make the model show its evidence and to check it with code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Require a &lt;strong&gt;verbatim quote&lt;/strong&gt; for every extracted item&lt;/li&gt;
&lt;li&gt;Check that the tool's name appears in the transcript, and drop the item if it does not&lt;/li&gt;
&lt;li&gt;Check the quote and the timestamp against the transcript too, and remove whichever cannot be found, so nothing unverified is shown as evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A caution: a naive check of the form "the tool name must appear in the transcript" can reject real tools when captions split or respell them (a product written as FastAPI may appear as "fast API"). Match names with some tolerance, and log rejections so you can see whether you are throwing away good results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistake 2: real tools, wrong meaning
&lt;/h2&gt;

&lt;p&gt;This one surprised us. In one test run on twenty technical videos, a large share of the official links our resolver returned were wrong. A database called Neon led to a cinema studio. An assistant called Serena led to a tennis player's website. Codex led to a food-safety standard. The model had named the tools correctly; the failure was in resolving ambiguous names with a web search.&lt;/p&gt;

&lt;p&gt;What fixed most of it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add context to the query&lt;/strong&gt;: include the category and a short description of the tool, not just its name&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accept canonical repositories&lt;/strong&gt;: many CLI and open-source tools have no website, only a GitHub repo&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block unreliable sources&lt;/strong&gt; as official: aggregators, course platforms, forums, social networks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score and threshold&lt;/strong&gt;: compute a confidence for each match, and reject anything below a threshold&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Return nothing when unsure&lt;/strong&gt;: an empty field is honest, a wrong link is not&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Improve the prompt, then measure
&lt;/h2&gt;

&lt;p&gt;Prompts matter. We rewrote ours with an explicit definition of what counts as a tool, a list of exclusions and an instruction to quote verbatim. On four videos of very different lengths, from 47 minutes to over 7 hours, and labelling the results by hand, precision moved from about 89 to about 96 percent and recall from about 76 to about 93 percent. Those are indicative figures: four videos, one run each, a model with some randomness. Treat them as direction, not proof.&lt;/p&gt;

&lt;p&gt;The point is the method: label a small set by hand once, then re-run it after every prompt change, so you notice regressions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't hide partial results
&lt;/h2&gt;

&lt;p&gt;A different kind of hallucination is silent partial coverage. If the transcript is too long and you truncate it, the output looks complete but only reflects the beginning. We hit this: a seven-hour video was analysed on its first twelve minutes. The fix was to process the whole transcript in chunks and to report coverage explicitly, with a warning when an analysis is partial.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Name found in the transcript, quote required, quote verified&lt;/li&gt;
&lt;li&gt;Context in link resolution&lt;/li&gt;
&lt;li&gt;Confidence threshold, with &lt;code&gt;None&lt;/code&gt; as a valid answer&lt;/li&gt;
&lt;li&gt;A small labelled set to catch regressions&lt;/li&gt;
&lt;li&gt;Honest coverage reporting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where this led
&lt;/h2&gt;

&lt;p&gt;We applied these rules in &lt;a href="https://www.vidscope.fr" rel="noopener noreferrer"&gt;VidScope&lt;/a&gt;, which lists the tools mentioned in a YouTube video with timestamps and official links, and prefers no link to an uncertain one.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can hallucinations be eliminated?&lt;/strong&gt;&lt;br&gt;
No, but requiring and verifying evidence reduces them a lot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why return nothing instead of a best guess?&lt;/strong&gt;&lt;br&gt;
A wrong link looks authoritative; an empty field tells the user to check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I measure accuracy on a small project?&lt;/strong&gt;&lt;br&gt;
Label a few videos by hand and re-run them after every change, while remembering the sample is small.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Audio Crossfading in Python: Eliminating Pops and Clicks at Edit Points</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Mon, 02 Nov 2026 12:15:45 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/audio-crossfading-in-python-eliminating-pops-and-clicks-at-edit-points-2b33</link>
      <guid>https://dev.to/wgeorgeassistantia/audio-crossfading-in-python-eliminating-pops-and-clicks-at-edit-points-2b33</guid>
      <description>&lt;p&gt;When you automatically remove silences from speech or podcast recordings, you cut hundreds of audio slices and stitch them back together.&lt;/p&gt;

&lt;p&gt;If you do this naively by simply concatenating raw audio arrays:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Naive concatenation: guaranteed audio artifacts
&lt;/span&gt;&lt;span class="n"&gt;clean_audio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concatenate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;segment_a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;segment_b&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Your output will be riddled with audible &lt;strong&gt;clicks, pops, and ticks&lt;/strong&gt;. Every single edit point sounds like a tiny vinyl scratch.&lt;/p&gt;

&lt;p&gt;Here is why naive concatenation fails, what a linear crossfade fixes (and what it doesn't), how an &lt;strong&gt;equal-power crossfade&lt;/strong&gt; works in NumPy, and what we actually ship in &lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;VoxCut&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Edit Points Pop: Amplitude Discontinuities
&lt;/h2&gt;

&lt;p&gt;Digital audio is a sequence of samples (e.g. 44,100 per second), each one an amplitude between -1.0 and +1.0.&lt;/p&gt;

&lt;p&gt;When you cut audio, you almost never cut at an exact &lt;strong&gt;zero-crossing&lt;/strong&gt; (a sample where the amplitude is 0.0):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Segment A&lt;/strong&gt; ends at an amplitude of &lt;code&gt;+0.42&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segment B&lt;/strong&gt; begins at an amplitude of &lt;code&gt;-0.31&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Concatenating them creates a jump of &lt;code&gt;0.73&lt;/code&gt; between two consecutive samples (1/44100th of a second apart).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A step like that has energy spread across the whole audible spectrum. The speaker cone is asked to move almost instantly, and you hear it as a &lt;strong&gt;click&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Linear Crossfades: The Midpoint Dip
&lt;/h2&gt;

&lt;p&gt;The first instinct is to overlap the two segments for a few milliseconds and apply a linear crossfade:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Segment A fades out linearly from 1.0 to 0.0&lt;/li&gt;
&lt;li&gt;Segment B fades in linearly from 0.0 to 1.0
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Linear crossfade weights
&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;linspace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fade_samples&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fade_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;
&lt;span class="n"&gt;fade_in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This kills the click: there is no longer a step anywhere. But for two &lt;strong&gt;uncorrelated&lt;/strong&gt; signals (two different moments of speech), what adds up is power, not amplitude:&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Power&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;A&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;B&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;



&lt;p&gt;At the exact midpoint of a linear crossfade (t = 0.5):&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Power&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;0.5&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;0.5&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.50&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mrel"&gt;≈&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;−&lt;/span&gt;&lt;span class="mord"&gt;3&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;&amp;nbsp;dB&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;On long fades between two loud signals, that dip can be heard as a small "breathing" in the volume.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Theory Fix: Constant-Power (Sine/Cosine) Crossfade
&lt;/h2&gt;

&lt;p&gt;To keep the energy constant across uncorrelated material, use trigonometric curves:&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Fade&amp;nbsp;Out&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;t&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="minner"&gt;&lt;span class="mopen delimcenter"&gt;&lt;span class="delimsizing size2"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;π&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;t&lt;/span&gt;&lt;span class="mclose delimcenter"&gt;&lt;span class="delimsizing size2"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mpunct"&gt;,&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Fade&amp;nbsp;In&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;t&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="minner"&gt;&lt;span class="mopen delimcenter"&gt;&lt;span class="delimsizing size2"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;π&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;t&lt;/span&gt;&lt;span class="mclose delimcenter"&gt;&lt;span class="delimsizing size2"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;Because 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, the summed power stays at 1.0 for every sample of the transition.&lt;/p&gt;


&lt;h2&gt;
  
  
  A NumPy Implementation
&lt;/h2&gt;

&lt;p&gt;Here is a self-contained function that splices two buffers with an equal-power crossfade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;equal_power_crossfade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg_a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndarray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seg_b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndarray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fade_ms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;20.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sample_rate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;44100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndarray&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Crossfades the end of seg_a into the beginning of seg_b using constant-power curves.
    Supports 1D (mono) and 2D (stereo: samples, channels) arrays.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;fade_len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;fade_ms&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1000.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;sample_rate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# No room for a fade (or fade disabled): plain splice.
&lt;/span&gt;    &lt;span class="c1"&gt;# Note: seg_a[:-0] would return an EMPTY array, hence the fade_len &amp;lt;= 0 check.
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;fade_len&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg_a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;fade_len&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg_b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;fade_len&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concatenate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;seg_a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seg_b&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="c1"&gt;# Normalized time vector [0.0, 1.0]
&lt;/span&gt;    &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;linspace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fade_len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Constant-power weights
&lt;/span&gt;    &lt;span class="n"&gt;w_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;w_in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;seg_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ndim&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Broadcast over stereo channels
&lt;/span&gt;        &lt;span class="n"&gt;w_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w_out&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;newaxis&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;w_in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w_in&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;newaxis&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="c1"&gt;# Overlapping region
&lt;/span&gt;    &lt;span class="n"&gt;overlap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg_a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;fade_len&lt;/span&gt;&lt;span class="p"&gt;:]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;w_out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seg_b&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="n"&gt;fade_len&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;w_in&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Assemble: A (prefix) + overlap + B (suffix)
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concatenate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
        &lt;span class="n"&gt;seg_a&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;fade_len&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;overlap&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;seg_b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;fade_len&lt;/span&gt;&lt;span class="p"&gt;:]&lt;/span&gt;
    &lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Swap the two weight lines for &lt;code&gt;w_out = 1.0 - t&lt;/code&gt; and &lt;code&gt;w_in = t&lt;/code&gt; and you have the linear version.&lt;/p&gt;


&lt;h2&gt;
  
  
  What VoxCut Actually Ships (and Why It's Linear)
&lt;/h2&gt;

&lt;p&gt;Honest disclosure: VoxCut's desktop export does &lt;strong&gt;not&lt;/strong&gt; use the equal-power curve above. It uses a &lt;strong&gt;40 ms linear crossfade&lt;/strong&gt; (the equivalent of FFmpeg's &lt;code&gt;acrossfade=c1=tri:c2=tri&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Why that's good enough for silence removal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The edges we join are the &lt;strong&gt;quiet tails&lt;/strong&gt; of speech around a removed pause, not two loud musical passages. A -3 dB dip at the midpoint of a 40 ms fade between two near-silent edges is inaudible in practice.&lt;/li&gt;
&lt;li&gt;What matters is removing the step, and a linear ramp does that just as well as a sine curve.&lt;/li&gt;
&lt;li&gt;If any kept segment is shorter than two fade lengths (80 ms), the export falls back to plain cuts rather than fading into a sliver of audio.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you crossfade &lt;strong&gt;music&lt;/strong&gt;, or long fades between two loud signals, equal-power is the safer default.&lt;/p&gt;
&lt;h3&gt;
  
  
  The Performance Lesson
&lt;/h3&gt;

&lt;p&gt;Our first version built an FFmpeg &lt;code&gt;filter_complex&lt;/code&gt; graph: one &lt;code&gt;atrim&lt;/code&gt; per segment plus a chain of N &lt;code&gt;acrossfade&lt;/code&gt; filters. On a dense podcast (~870 cuts in 2 hours), that graph became the bottleneck: FFmpeg re-read the input for every segment.&lt;/p&gt;

&lt;p&gt;The current version does it in a single pass:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;One FFmpeg process decodes the file to raw &lt;code&gt;f32le&lt;/code&gt; PCM on &lt;code&gt;stdout&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Python reads it in 1-second chunks, skips the silent ranges, and applies the fade ramps in NumPy.&lt;/li&gt;
&lt;li&gt;A second FFmpeg process encodes from &lt;code&gt;stdin&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On a 30-minute podcast, this was about &lt;strong&gt;50x faster&lt;/strong&gt; than the filter graph in our benchmark. The old graph is still there as a fallback if the streaming path fails.&lt;/p&gt;


&lt;h2&gt;
  
  
  Critical Gotcha: The Cumulative Length Shrink
&lt;/h2&gt;

&lt;p&gt;Each overlap crossfade consumes &lt;code&gt;fade_len&lt;/code&gt; samples, because the two segments overlap in time.&lt;/p&gt;

&lt;p&gt;If your silence detector finds &lt;strong&gt;600 cuts&lt;/strong&gt; in a 45-minute episode and you apply a 40 ms crossfade at each join:&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;600&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;×&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;40&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;&amp;nbsp;ms&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;24&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;&amp;nbsp;seconds&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;



&lt;p&gt;For an audio-only podcast, nobody cares. But if that audio has to stay in sync with &lt;strong&gt;video&lt;/strong&gt;, you are 24 seconds out of sync by the end. (That's why VoxCut skips the overlap crossfade entirely on video exports.)&lt;/p&gt;

&lt;h3&gt;
  
  
  The Video-Safe Rule
&lt;/h3&gt;

&lt;p&gt;When timeline sync matters, apply micro-fades at the boundaries without overlapping:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fade out the last ~5 ms of segment A to zero.&lt;/li&gt;
&lt;li&gt;Fade in the first ~5 ms of segment B from zero.&lt;/li&gt;
&lt;li&gt;Concatenate without overlapping time indices.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The step disappears (both sides meet at zero), and in speech a 5 ms dip is very hard to notice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Clicks at edit points are not caused by bad microphones. They come from cutting waveforms that are not at zero.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Never splice raw arrays at arbitrary indices.&lt;/li&gt;
&lt;li&gt;A short crossfade removes the click; linear is fine for speech edges, equal-power is better for music and long fades.&lt;/li&gt;
&lt;li&gt;Use non-overlapping micro-fades when you must keep the timeline in sync with video.&lt;/li&gt;
&lt;li&gt;If you have hundreds of cuts, avoid giant FFmpeg filter graphs: stream PCM through Python instead.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's the pipeline behind &lt;a href="https://voxcutpro.com" rel="noopener noreferrer"&gt;VoxCut&lt;/a&gt;'s "smooth transitions" option. If you're building your own silence remover, I'd love to hear how you handle edit points.&lt;/p&gt;

</description>
      <category>audio</category>
      <category>python</category>
      <category>ffmpeg</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>From YouTube Transcript to Structured Technical Knowledge</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Tue, 20 Oct 2026 13:56:02 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/from-youtube-transcript-to-structured-technical-knowledge-12aj</link>
      <guid>https://dev.to/wgeorgeassistantia/from-youtube-transcript-to-structured-technical-knowledge-12aj</guid>
      <description>&lt;p&gt;A transcript is a wall of text. A knowledge base is a set of records you can query. This post is about the part in between: designing the data model that turns one into the other, so the result is searchable, checkable and mergeable across videos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start from the questions you want to answer
&lt;/h2&gt;

&lt;p&gt;Before choosing a schema, list the questions a user will ask later:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which tools were mentioned in this video?&lt;/li&gt;
&lt;li&gt;Where exactly, so I can listen to it?&lt;/li&gt;
&lt;li&gt;Was it recommended, compared or criticised?&lt;/li&gt;
&lt;li&gt;What is the official source?&lt;/li&gt;
&lt;li&gt;Which videos mention the same tool?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each question maps to a field. If a field has no question behind it, leave it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  A minimal record
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Supabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"aliases"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"supabase"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"database"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"backend and authentication"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mention"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"used"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"evidence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"quote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"we use Supabase for auth and the database"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;761&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"official_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://supabase.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three design choices are worth explaining.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Store seconds, not strings.&lt;/strong&gt; Keep the timestamp as a number of seconds. Format it for display later (&lt;code&gt;00:12:41&lt;/code&gt;) and build deep links from it (&lt;code&gt;?t=761&lt;/code&gt;). Strings like "12:41" break as soon as a video passes one hour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep the quote.&lt;/strong&gt; The quote is your audit trail. It lets a human confirm the claim in five seconds and lets your code reject records whose quote is not actually in the transcript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separate &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;aliases&lt;/code&gt;.&lt;/strong&gt; Videos say "Postgres", "PostgreSQL" and "Postgres DB". Normalise to one canonical name and keep the variants for matching.&lt;/p&gt;

&lt;h2&gt;
  
  
  Merging chunks without duplicating
&lt;/h2&gt;

&lt;p&gt;Long transcripts are processed in chunks, so the same tool appears several times. Merge on a normalised key: lower-case the name, strip punctuation and common suffixes, then group. When merging, keep all evidence entries and the earliest start time, and take the most specific category. Rare conflicts, such as two categories for the same name, are worth logging instead of resolving silently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validating before you trust
&lt;/h2&gt;

&lt;p&gt;Run a few cheap checks on every record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The timestamp falls inside the video's duration&lt;/li&gt;
&lt;li&gt;The quote appears in the transcript near that timestamp&lt;/li&gt;
&lt;li&gt;The name is not on a block list of generic words ("API", "cloud", a channel's own name)&lt;/li&gt;
&lt;li&gt;The URL, if present, passes the same validation as the name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Records that fail go to a rejected list with the reason. Looking at the rejected list is the fastest way to improve your prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making it usable
&lt;/h2&gt;

&lt;p&gt;Once records are clean, the value comes from presentation. Sort by first appearance so the list follows the video. Make every timestamp a link. Group by category. Offer an export, because people will paste the result into their own notes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where VidScope fits
&lt;/h2&gt;

&lt;p&gt;Everything above is what we ended up building in &lt;a href="https://www.vidscope.fr" rel="noopener noreferrer"&gt;VidScope&lt;/a&gt;, an experiment in turning technical YouTube videos into structured, timestamped lists of tools. The schema above is simplified, but the principles are the same: seconds not strings, quotes as evidence, and validation before display.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why store timestamps as seconds?&lt;/strong&gt;&lt;br&gt;
They are unambiguous, sortable and easy to turn into deep links and display formats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I deduplicate tools across chunks?&lt;/strong&gt;&lt;br&gt;
Normalise names (case, punctuation, suffixes) and merge records while keeping all evidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why keep the quote?&lt;/strong&gt;&lt;br&gt;
It is the proof: it lets a human check the claim quickly and lets code reject records not present in the transcript.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Committed Memory Above RAM Doesn't Mean Your PC Is Swapping</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Wed, 14 Oct 2026 05:37:47 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/committed-memory-above-ram-doesnt-mean-your-pc-is-swapping-1opm</link>
      <guid>https://dev.to/wgeorgeassistantia/committed-memory-above-ram-doesnt-mean-your-pc-is-swapping-1opm</guid>
      <description>&lt;p&gt;One rule in my Windows diagnostic tool said: &lt;em&gt;"Your PC is compensating for missing RAM by using the disk."&lt;/em&gt; The condition behind it was one line: committed memory is greater than physical RAM.&lt;/p&gt;

&lt;p&gt;On my own machine, that line was true. And my PC was fine.&lt;/p&gt;

&lt;p&gt;This post explains why "commit &amp;gt; RAM" proves nothing, and what I measure instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the first version did
&lt;/h2&gt;

&lt;p&gt;The rule read two numbers and compared them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;committed memory (what Windows has promised to processes)&lt;/li&gt;
&lt;li&gt;total physical RAM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the first was larger than the second, it flagged "swap in use" and suggested more RAM or fewer programs.&lt;/p&gt;

&lt;p&gt;It sounded reasonable. It was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why commit is the wrong signal
&lt;/h2&gt;

&lt;p&gt;Committed memory is memory that has been &lt;strong&gt;reserved&lt;/strong&gt;, not memory that is being &lt;strong&gt;used&lt;/strong&gt;. A process can reserve a lot and touch very little of it. Browsers are the typical example: they reserve large regions up front.&lt;/p&gt;

&lt;p&gt;So commit can exceed RAM on a perfectly healthy machine, with no page ever read back from the disk.&lt;/p&gt;

&lt;p&gt;There is a second reason. Commit is charged against the &lt;strong&gt;commit limit&lt;/strong&gt;, which is RAM plus the pagefile. A machine with a large pagefile can commit far more than its RAM by design, so &lt;code&gt;commit &amp;gt; RAM&lt;/code&gt; was never a pressure signal on its own. (Thanks to Kai for pointing this out in the comments.) In the rule below it is only a precondition: the other two conditions do the real work.&lt;/p&gt;

&lt;p&gt;Here is what my own PC showed on September 24:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Committed memory: &lt;strong&gt;22.5 GB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Physical RAM: &lt;strong&gt;15.9 GB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Available RAM: &lt;strong&gt;24 %&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Pages read from disk to serve memory: &lt;strong&gt;0.4 per second&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Commit was well above RAM. The disk was almost idle. The rule fired anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually shows a PC is compensating on disk
&lt;/h2&gt;

&lt;p&gt;The real signal is the &lt;strong&gt;hard page fault rate&lt;/strong&gt;: pages that Windows has to read from disk because the data it needs is no longer in RAM. The counter is &lt;code&gt;Pages Input/sec&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I read it twice, at the start and at the end of my measurement window, and divide the difference by the elapsed time. It is a raw cumulative counter, so one reading alone tells you nothing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$m1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-CimInstance&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Win32_PerfRawData_PerfOS_Memory&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;Start-Sleep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Seconds&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;8&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$m2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-CimInstance&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Win32_PerfRawData_PerfOS_Memory&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="nv"&gt;$seconds&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$m2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Timestamp_Sys100NS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$m1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Timestamp_Sys100NS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;1e7&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$pagesPerSec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$m2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;PagesInputPersec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$m1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;PagesInputPersec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$seconds&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One detail that cost me time: I use the WMI class, not &lt;code&gt;Get-Counter&lt;/code&gt;. Counter names are translated according to the language of Windows, so a script that works on an English install can fail silently on a French one. The WMI class property names stay the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two thresholds, and why there are two
&lt;/h2&gt;

&lt;p&gt;The new condition needs three things together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$SEUIL_PAGES_DISQUE&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="c"&gt;# pages/s read from disk for memory&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$SEUIL_RAM_DISPO_SWAP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c"&gt;# % of RAM available&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$commitGb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-gt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$ramTotalGb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-and&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nv"&gt;$pctRamAvailable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-lt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$SEUIL_RAM_DISPO_SWAP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-and&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="bp"&gt;$null&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-ne&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$pagesPerSec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$pagesPerSec&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-ge&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$SEUIL_PAGES_DISQUE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="c"&gt;# flag it&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;100 pages per second is roughly 400 KB/s of reads, at 4 KB per page. That is a level where the disk is clearly doing the memory's job.&lt;/p&gt;

&lt;p&gt;Why not use the page counter alone? Because &lt;code&gt;Pages Input/sec&lt;/code&gt; also counts programs being &lt;strong&gt;loaded&lt;/strong&gt; from disk. If the user opens an application during the measurement, the counter jumps even though RAM is fine. Requiring low available RAM as well keeps those reads from being blamed on missing memory.&lt;/p&gt;

&lt;p&gt;If the counter cannot be read, the rule says nothing. A false "your PC is compensating" is worse than silence.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I tested
&lt;/h2&gt;

&lt;p&gt;I ran the real analysis on my machine: the only thing still flagged was a full disk, in 15 seconds. I also have a simulated test bench, where heavy paging triggers the rule. I did not build a separate case for "high commit, idle disk": my own PC on September 24 was that case.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I have not proved
&lt;/h2&gt;

&lt;p&gt;The thresholds come from one machine, mine, and from reasoning about the counters. I do not know yet how 100 pages/s behaves across very different hardware. That rate is about 400 KB/s: close to free on an NVMe SSD, where a 4 KB random read takes tens of microseconds, but potentially dominant on a spinning disk, where each fault can cost a seek. A raw count only means something once it is weighted by device latency. The next version should read the disk's read latency (or read queue length) next to the fault rate, and flag a problem when the added time is visible, not when a count crosses a fixed number. A field test on about ten PCs is still the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool
&lt;/h2&gt;

&lt;p&gt;This is part of &lt;a href="https://nyctale.fr" rel="noopener noreferrer"&gt;Nyctale&lt;/a&gt;, a Windows PC diagnostic tool that tries to name the real cause of a slow PC and says so when no software will fix it. This correction shipped in version 1.0.3. The quick diagnostic is free.&lt;/p&gt;

&lt;p&gt;If you monitor memory on Windows: which counter do you trust to tell a slow PC from a PC that just reserves a lot?&lt;/p&gt;

</description>
      <category>powershell</category>
      <category>windows</category>
      <category>performance</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Four Bugs I Only Found by Driving the Real Window of a PySide6 App</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Mon, 12 Oct 2026 15:28:12 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/four-bugs-i-only-found-by-driving-the-real-window-of-a-pyside6-app-138m</link>
      <guid>https://dev.to/wgeorgeassistantia/four-bugs-i-only-found-by-driving-the-real-window-of-a-pyside6-app-138m</guid>
      <description>&lt;p&gt;My app is a desktop tool that traces images into SVG. The tracing engine is vtracer, a Rust extension, and the UI is PySide6. The engine had good unit tests. Then I used the app for real, and four bugs showed up that none of those tests could see.&lt;/p&gt;

&lt;p&gt;All four come from the same place: the interaction between Qt, threads and a native extension. If you build a PySide6 or PyQt app that runs work in a &lt;code&gt;QThread&lt;/code&gt;, you may hit the same ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 1: the app died with no exception
&lt;/h2&gt;

&lt;p&gt;While a trace was running, the user could paint another stroke. The handler for the mask-changed signal put the selection back with &lt;code&gt;canvas.set_mask(...)&lt;/code&gt;. But &lt;code&gt;set_mask&lt;/code&gt; emits the same signal again, so the handler called itself.&lt;/p&gt;

&lt;p&gt;That is infinite recursion, but not the kind Python complains about. It went through Qt's C++ signal machinery, so Python's recursion limit never triggered. The process simply died with a native stack overflow (&lt;code&gt;0xC00000FD&lt;/code&gt; on Windows). No traceback, no message.&lt;/p&gt;

&lt;p&gt;The rule I took from it: &lt;strong&gt;never react to a Qt signal by modifying the thing that emitted it.&lt;/strong&gt; A guard flag fixes it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_suspend_mask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clear_mask&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;      &lt;span class="c1"&gt;# emits mask_changed
&lt;/span&gt;&lt;span class="k"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_suspend_mask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_on_mask_changed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_suspend_mask&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bug 2: the UI froze forever after a Rust panic
&lt;/h2&gt;

&lt;p&gt;The worker looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Worker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;QThread&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;failed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;done&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_fn&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;failed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a corrupt image, vtracer panicked. pyo3 turns a Rust panic into a Python &lt;code&gt;PanicException&lt;/code&gt;, and that class derives from &lt;code&gt;BaseException&lt;/code&gt;, not &lt;code&gt;Exception&lt;/code&gt;. My &lt;code&gt;except&lt;/code&gt; never caught it. &lt;code&gt;failed&lt;/code&gt; was never emitted, so the code that re-enables the buttons never ran. Every button stayed greyed out, with no message.&lt;/p&gt;

&lt;p&gt;The fix is to catch &lt;code&gt;BaseException&lt;/code&gt; in the worker (re-raising &lt;code&gt;KeyboardInterrupt&lt;/code&gt; and &lt;code&gt;SystemExit&lt;/code&gt;), and to add a safety net: &lt;code&gt;finished&lt;/code&gt; is emitted even when &lt;code&gt;run()&lt;/code&gt; ends on an uncaught exception, so a handler on it can reset the "busy" state.&lt;/p&gt;

&lt;p&gt;If you wrap any native extension, check what its panics or errors derive from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 3: a second worker silently refused to start
&lt;/h2&gt;

&lt;p&gt;After a click, the app ran one worker, and when it finished it should start a second one. I called the next &lt;code&gt;_run()&lt;/code&gt; directly from the &lt;code&gt;done&lt;/code&gt; handler. Sometimes nothing happened.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_run()&lt;/code&gt; starts with a guard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_worker&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_worker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isRunning&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem: &lt;code&gt;done&lt;/code&gt; is emitted from inside &lt;code&gt;run()&lt;/code&gt;, that is, from the worker's own thread, before the thread has finished stopping. At that exact moment &lt;code&gt;isRunning()&lt;/code&gt; can still return &lt;code&gt;True&lt;/code&gt;. The new call was rejected by its own guard, depending on timing. It never showed up when I tested one case alone, only inside the full test suite.&lt;/p&gt;

&lt;p&gt;The fix is to let the event loop turn once before chaining:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_on_selection_done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;QTimer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;singleShot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_apply_selection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My rule now: &lt;strong&gt;chaining one worker from another's &lt;code&gt;done&lt;/code&gt; always goes through &lt;code&gt;QTimer.singleShot(0, ...)&lt;/code&gt;&lt;/strong&gt;, never a direct call.&lt;/p&gt;

&lt;p&gt;A related trap sits in the same area. Each worker removes itself from &lt;code&gt;self._worker&lt;/code&gt; on &lt;code&gt;finished&lt;/code&gt;. A chain started from &lt;code&gt;done&lt;/code&gt; had already installed the next worker, and the previous worker's &lt;code&gt;finished&lt;/code&gt; then wiped it out. Nothing blocked two jobs from running on the same session. The fix is to forget a worker only if it is still the current one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_forget_worker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_worker&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_worker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bug 4: a keyboard shortcut bypassed the greyed-out buttons
&lt;/h2&gt;

&lt;p&gt;I disabled the buttons while a trace was running. But a shortcut like Ctrl+O does not go through a button. Pressing it during a computation opened a new image, which closed the session and deleted its temporary folder under the running thread. The thread then died with "Cannot create output file".&lt;/p&gt;

&lt;p&gt;The fix is a single predicate used by every entry point, shortcuts included:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_idle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_worker&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_worker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isRunning&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;open_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_idle&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I test this now
&lt;/h2&gt;

&lt;p&gt;Engine tests cannot catch these. The failures only exist when the real window, the real event loop and the real thread run together. So I keep a separate file of regression tests that drives the actual &lt;code&gt;MainWindow&lt;/code&gt; in Qt's offscreen mode, with modal dialogs disabled (otherwise a test blocks silently on a message box).&lt;/p&gt;

&lt;p&gt;Two practical details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To test "Ctrl+O during a computation", force a slow job (&lt;code&gt;time.sleep(1.5)&lt;/code&gt; in the worker). On a small test image a real trace ends in tens of milliseconds, and the test would check nothing.&lt;/li&gt;
&lt;li&gt;To test the panic case, raise a custom &lt;code&gt;BaseException&lt;/code&gt; subclass in the worker and assert that the buttons are enabled again afterwards.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I would tell my past self
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Qt signals cross threads and C++ code. Python's safety nets do not follow them.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;done&lt;/code&gt; is not "the thread has stopped".&lt;/li&gt;
&lt;li&gt;Every way to start work needs the same guard, not just the buttons.&lt;/li&gt;
&lt;li&gt;Test the glue, not just the engine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The app
&lt;/h2&gt;

&lt;p&gt;This is part of &lt;a href="https://www.vectorpop.fr/vectofix" rel="noopener noreferrer"&gt;VectoFix&lt;/a&gt;, a local Windows tool that traces an image into SVG, measures what the tracing lost compared with the source, and lets you fix a zone with a brush. Everything runs on the user's machine.&lt;/p&gt;

&lt;p&gt;Have you hit a thread or signal bug that only appeared with the real UI? I am curious what your regression tests look like.&lt;/p&gt;

</description>
      <category>python</category>
      <category>pyside6</category>
      <category>qt</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Windows Event ID 37 Doesn't Mean Your CPU Is Overheating</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Mon, 12 Oct 2026 15:07:57 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/windows-event-id-37-doesnt-mean-your-cpu-is-overheating-4f9i</link>
      <guid>https://dev.to/wgeorgeassistantia/windows-event-id-37-doesnt-mean-your-cpu-is-overheating-4f9i</guid>
      <description>&lt;p&gt;I build a small Windows diagnostic tool. One of its rules looked at the System event log, found &lt;code&gt;Kernel-Processor-Power&lt;/code&gt; Event ID 37, and told the user: &lt;em&gt;"your cooling system is probably the problem."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then I ran it on my own PC, which has no cooling problem. It told me my cooling was the problem.&lt;/p&gt;

&lt;p&gt;This post is about why Event 37 is a terrible proxy for overheating, and the three filters that fixed the false positive.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Event 37 actually says
&lt;/h2&gt;

&lt;p&gt;Event ID 37 from &lt;code&gt;Microsoft-Windows-Kernel-Processor-Power&lt;/code&gt; reads roughly: &lt;em&gt;the speed of processor N is being limited by system firmware.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Heat is one reason firmware does that. It is not the only one. A power limit, a weak charger, a battery state or an OEM power profile produce the same event. The event tells you a limit was applied. It does not tell you why.&lt;/p&gt;

&lt;p&gt;My first version of the rule was simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;count Event 37 over the last 14 days&lt;/li&gt;
&lt;li&gt;ignore the ones right after the latest boot&lt;/li&gt;
&lt;li&gt;if three or more remain, flag "physical cooling problem"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It was also compared with the CPU load measured during an 8-second scan, taken while the user is idle by definition. Two things measured at two different times, used as one argument.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers on my machine
&lt;/h2&gt;

&lt;p&gt;Over 14 days my log had 12 Event 37 entries. The old rule kept 11 of them as "not at boot" and concluded the worst.&lt;/p&gt;

&lt;p&gt;Looking at them one by one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;8 of the 12&lt;/strong&gt; happened within 10 minutes after a boot. Not just the latest boot: any boot in the period.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The other 4&lt;/strong&gt; were not heat spikes at all. Each reported a cap lasting 33 to 48 hours. That is a permanent power ceiling, not a thermal event.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Real overheating episodes: zero.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 1: ignore every boot, not just the last one
&lt;/h2&gt;

&lt;p&gt;Firmware often applies a limit while the system starts. Collect every boot in the window with Event 12 from &lt;code&gt;Kernel-General&lt;/code&gt;, then drop any Event 37 that lands in the 10 minutes after one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$boots&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-WinEvent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-FilterHashtable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;@{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nx"&gt;LogName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'System'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ProviderName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'Microsoft-Windows-Kernel-General'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nx"&gt;StartTime&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Get&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Date&lt;/span&gt;&lt;span class="err"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;AddDays&lt;/span&gt;&lt;span class="err"&gt;(-&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ForEach-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;$_&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TimeCreated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="kr"&gt;foreach&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$ev37&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nv"&gt;$atBoot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$boots&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Where-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nv"&gt;$d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TimeCreated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;$_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TotalMinutes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-ge&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-le&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$atBoot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;continue&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="c"&gt;# ...next filters&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Fix 2: only count events on mains power
&lt;/h2&gt;

&lt;p&gt;On battery, limiting the CPU is intended behaviour. &lt;code&gt;Kernel-Power&lt;/code&gt; Event 105 records power source changes, and its &lt;code&gt;AcOnline&lt;/code&gt; field says whether the machine was plugged in. For each Event 37, take the latest Event 105 before it. If the machine was on battery, it is not evidence of anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 3: use the duration, not just the count
&lt;/h2&gt;

&lt;p&gt;Event 37 carries a &lt;code&gt;CapDurationInSeconds&lt;/code&gt; field. A thermal throttle comes and goes in minutes. A cap that lasts a day or more is a configuration, not a symptom. I treat anything of an hour or longer as a permanent cap and drop it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$xml&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToXml&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$dur&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$xml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;EventData&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Where-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-eq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'CapDurationInSeconds'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="s1"&gt;'#text'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$dur&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-ge&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kr"&gt;continue&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only what survives all three filters counts as an episode. On my machine: 0. The verdict also changed from a statement ("your cooling is the problem") to a hedged one ("very probably") with a simple test the user can do themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  A PowerShell trap I hit on the way
&lt;/h2&gt;

&lt;p&gt;In the same session I broke the translation table. My loop used a variable named &lt;code&gt;$t&lt;/code&gt; for the event time. The table of translated strings was called &lt;code&gt;$T&lt;/code&gt;. PowerShell variable names are case-insensitive, so &lt;code&gt;$t&lt;/code&gt; silently overwrote &lt;code&gt;$T&lt;/code&gt; and every string came back empty. If you use single-letter variables in a script that already has one in capitals, rename one of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I have not proved
&lt;/h2&gt;

&lt;p&gt;I recalibrated this on one machine, mine. The three filters remove the false positive I could see, but I do not yet know the false-positive rate across other laptops and desktops. A 10-PC field test is next. If you have Event 37 data from machines with a real cooling fault, I would like to see how the filters behave.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool
&lt;/h2&gt;

&lt;p&gt;This is part of &lt;a href="https://nyctale.fr" rel="noopener noreferrer"&gt;Nyctale&lt;/a&gt;, a Windows PC diagnostic tool that tries to name the actual cause of a slow or hot PC, and says "no software will fix this" when that is the honest answer. The fixed rule shipped in version 1.0.3. The quick diagnostic is free.&lt;/p&gt;

&lt;p&gt;Have you used Event 37 for anything? Did you find other signals that separate real thermal throttling from firmware power limits?&lt;/p&gt;

</description>
      <category>powershell</category>
      <category>windows</category>
      <category>debugging</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How to Identify Technologies Mentioned in a YouTube Video</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Mon, 12 Oct 2026 14:41:54 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/how-to-identify-technologies-mentioned-in-a-youtube-video-e91</link>
      <guid>https://dev.to/wgeorgeassistantia/how-to-identify-technologies-mentioned-in-a-youtube-video-e91</guid>
      <description>&lt;p&gt;"Which technologies does this video talk about?" sounds like a named-entity task, and it is, with a twist: the entities are product names that are short, ambiguous, constantly new and often misheard. This post covers the three problems you meet, and a practical approach to each.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 1: what counts as a technology?
&lt;/h2&gt;

&lt;p&gt;If you do not decide, the model will. Without a definition you get everything from "JavaScript" to "the cloud" to the presenter's company. Write the definition into the prompt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Include: named products, frameworks, libraries, languages, services, CLIs and protocols&lt;/li&gt;
&lt;li&gt;Exclude: generic words ("API", "database", "framework"), company names that are not products, channel names, people&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then maintain a block list of the noise you actually observe. In our runs, recurring false positives included generic words such as "API" and "Google", and the names of channels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 2: the same tool, many spellings
&lt;/h2&gt;

&lt;p&gt;Speakers say "Postgres", "PostgreSQL", "Postgres DB". Captions write "Next JS", "next.js" or "Nexjs". Two things help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Normalise&lt;/strong&gt;: lower-case, remove spaces and punctuation, strip common suffixes (&lt;code&gt;js&lt;/code&gt;, &lt;code&gt;db&lt;/code&gt;) to create a matching key&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep an alias list&lt;/strong&gt; for the display name and for deduplication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Watch for duplicates that differ by one letter. We saw a tool appear twice because one occurrence was misspelt; a fuzzy match on names within the same video catches it.&lt;/p&gt;

&lt;p&gt;Translation can also distort names. If your pipeline summarises in another language, instruct the model to keep product names exactly as spoken. A product name turned into a translated phrase is no longer searchable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 3: mentioned does not mean recommended
&lt;/h2&gt;

&lt;p&gt;A technology can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Used&lt;/strong&gt; in the demo&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recommended&lt;/strong&gt; as an alternative&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compared&lt;/strong&gt; against another&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Criticised&lt;/strong&gt; or dismissed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Classify the mention type, or at least keep the quote so a reader can judge. This is the difference between a useful tool list and a misleading one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ambiguous names need context
&lt;/h2&gt;

&lt;p&gt;"Neon", "Serena" and "Phantom" are all valid product names, and all share their name with something unrelated. Give the model the surrounding sentence, and when you look up the official site, pass the category as well. A good result for an ambiguous name needs context at both extraction and resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test it on real videos
&lt;/h2&gt;

&lt;p&gt;Pick ten videos in your field, run the pipeline and read the list yourself. You will quickly see what kind of noise appears and where the prompt needs a rule. Update the block list and the prompt, run again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our implementation
&lt;/h2&gt;

&lt;p&gt;We built these rules into &lt;a href="https://www.vidscope.fr" rel="noopener noreferrer"&gt;VidScope&lt;/a&gt;, which returns the tools mentioned in a YouTube video with a timestamp and an official link, and avoids returning a link when the match is unclear.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is this a named-entity recognition problem?&lt;/strong&gt;&lt;br&gt;
Yes, with the twist that names are short, ambiguous and often misheard in captions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I stop generic words being returned?&lt;/strong&gt;&lt;br&gt;
Define what counts as a tool in the prompt and keep a block list of observed noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I handle different spellings of the same tool?&lt;/strong&gt;&lt;br&gt;
Normalise names to a matching key and keep an alias list.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>nlp</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Extract Tools and Technologies from YouTube Videos Automatically</title>
      <dc:creator>WgeorgeAssistantIA</dc:creator>
      <pubDate>Fri, 09 Oct 2026 15:48:12 +0000</pubDate>
      <link>https://dev.to/wgeorgeassistantia/how-to-extract-tools-and-technologies-from-youtube-videos-automatically-32ie</link>
      <guid>https://dev.to/wgeorgeassistantia/how-to-extract-tools-and-technologies-from-youtube-videos-automatically-32ie</guid>
      <description>&lt;p&gt;If you watch technical YouTube videos for work, you know the problem: a 40-minute walkthrough mentions a dozen tools, a few commands and a couple of versions, and an hour later you cannot remember which ones. This post shows a practical pipeline to extract the tools and technologies mentioned in a video automatically, step by step, and the pitfalls that make the naive version unreliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline in four steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Get the transcript&lt;/li&gt;
&lt;li&gt;Split it into chunks the model can handle&lt;/li&gt;
&lt;li&gt;Extract candidate tools with their timestamps&lt;/li&gt;
&lt;li&gt;Verify each candidate and attach an official link&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each step has a failure mode. We will go through them in order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: get the transcript
&lt;/h2&gt;

&lt;p&gt;Most videos have captions, either written by the author or generated automatically. Libraries such as &lt;a href="https://github.com/yt-dlp/yt-dlp" rel="noopener noreferrer"&gt;yt-dlp&lt;/a&gt; can fetch them along with timing data. Keep the timing: every segment of text has a start time, and that is what lets you link each tool back to the exact moment of the video later.&lt;/p&gt;

&lt;p&gt;Pitfall: automatic captions mangle product names. Words like "Supabase", "Vercel" or "Kubernetes" come out phonetically. Do not clean them yet; the model will need context to recover them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: split the transcript into chunks
&lt;/h2&gt;

&lt;p&gt;Long videos do not fit in one prompt, and even when they do, extraction quality drops as the input grows. A simple approach is to cut the transcript into chunks of fixed size, run them in parallel and merge the results.&lt;/p&gt;

&lt;p&gt;We found chunk size matters more than expected. In our tests on a transcript of roughly 475,000 characters, small chunks found more tools than large ones: very large chunks returned fewer distinct tools, because the model summarises instead of listing. Smaller chunks cost more calls but give better recall. A middle size of about 30,000 characters gave a good balance between the number of calls and the tools found.&lt;/p&gt;

&lt;p&gt;The mistake to avoid is silent truncation. An early version of our pipeline cut the text at a fixed length and analysed only the first minutes of a seven-hour video without telling anyone. If you cap the input, say so in the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: extract candidates with timestamps
&lt;/h2&gt;

&lt;p&gt;Ask the model for structured output, not prose. For each candidate tool, request the name, a short description, a category and a verbatim quote from the transcript with its timestamp:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tools"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Supabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"database"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"quote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"we are going to use Supabase for the backend"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"00:12:41"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules improve the results a lot. First, define what counts as a tool in the prompt, and list exclusions (generic words, channel names, company names that are not products). Second, require a verbatim quote. A candidate whose quote does not appear in the transcript is rejected.&lt;/p&gt;

&lt;p&gt;After merging the chunks, deduplicate by normalised name and drop candidates without a valid timestamp.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: verify and link
&lt;/h2&gt;

&lt;p&gt;This is the step most tutorials skip, and the one that matters most. A name alone is ambiguous: "Neon", "Serena" or "Codex" each match several unrelated things on the web. If you resolve the official website with a naive search, you will get cinema studios and food standards instead of software.&lt;/p&gt;

&lt;p&gt;What worked for us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build the search query from the tool's category and description, not only its name&lt;/li&gt;
&lt;li&gt;Accept canonical open-source repositories when a tool has no website of its own&lt;/li&gt;
&lt;li&gt;Block aggregator sites, course platforms, forums and social networks as official sources&lt;/li&gt;
&lt;li&gt;Score the match, and return nothing when the confidence is low&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last point is the hardest culture shift: an empty link is better than a wrong one. Users forgive a missing link; they do not forgive a confident wrong one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it together
&lt;/h2&gt;

&lt;p&gt;A good extraction pipeline is mostly about discipline: keep the timestamps, never truncate silently, require quotes, and prefer no link to a bad link. Models are the easy part. The rest is verification.&lt;/p&gt;

&lt;p&gt;If you want to see this applied rather than build it yourself, we built &lt;a href="https://www.vidscope.fr" rel="noopener noreferrer"&gt;VidScope&lt;/a&gt; to explore this problem: paste a YouTube link and it returns the tools mentioned with timestamps and official links.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can I extract tools from any YouTube video?&lt;/strong&gt;&lt;br&gt;
From any video that has a transcript, though automatic captions can misspell product names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why keep timestamps?&lt;/strong&gt;&lt;br&gt;
They let you check each tool at the moment it was mentioned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why not just ask an AI to summarise the video?&lt;/strong&gt;&lt;br&gt;
A summary tells you the idea; it rarely gives you the exact tools, versions and the evidence for each.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
