<?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: Heiner</title>
    <description>The latest articles on DEV Community by Heiner (@floozie).</description>
    <link>https://dev.to/floozie</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%2F3843274%2F98dad8dd-b3fd-4709-9931-cade1aa2ccbe.jpg</url>
      <title>DEV Community: Heiner</title>
      <link>https://dev.to/floozie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/floozie"/>
    <language>en</language>
    <item>
      <title>My Friend Had a Cameras-On Problem. I Wrote Him a Solution.</title>
      <dc:creator>Heiner</dc:creator>
      <pubDate>Mon, 01 Jun 2026 16:03:20 +0000</pubDate>
      <link>https://dev.to/floozie/my-friend-had-a-cameras-on-problem-i-wrote-him-a-solution-5b42</link>
      <guid>https://dev.to/floozie/my-friend-had-a-cameras-on-problem-i-wrote-him-a-solution-5b42</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://heiner-palmen.github.io/project/software-development/automation/ai/2026/05/13/scrumsurvivor.html" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;. GitHub: &lt;a href="https://github.com/heiner-palmen/ScrumSurvivor" rel="noopener noreferrer"&gt;ScrumSurvivor&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  My Friend Had a Cameras-On Problem. I Wrote Him a Solution.
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;ScrumSurvivor — a real-time Wav2Lip lip-sync avatar for mandatory camera meetings.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A few months ago a friend called me, frustrated. His company had just introduced a cameras-on policy for all internal meetings. The justification was engagement. The actual effect, as he described it, was 45 minutes a day of staring at a grid of tired faces in bad lighting while somebody narrated a PowerPoint everyone had already received by email.&lt;br&gt;
He wasn't looking to skip meetings or disappear. He attends every one, speaks when spoken to, and does his job. What he objected to was the compulsory performance of presence — the idea that a camera pointed at your face is evidence of engagement.&lt;br&gt;
He asked if there was anything clever to be done about it.&lt;br&gt;
I spent a few weekends finding out. The result is ScrumSurvivor — an open source Windows application that replaces your webcam feed with a photorealistic AI avatar of yourself, rendered in real time. When you speak, Wav2Lip lip-syncs the avatar to your actual voice. When you're silent, it breathes, blinks, and fidgets — generated procedurally so it never looks like a loop. Everything runs locally on a consumer NVIDIA GPU. No cloud, no subscription, no data leaving the machine.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Requirements:&lt;/strong&gt; Linux or Windows 10 or 11 · NVIDIA GPU with CUDA support (4 GB VRAM minimum; RTX 3050 Laptop GPU tested) · Python 3.10+ · OBS Studio · VB-Audio Virtual Cable
&lt;/h2&gt;

&lt;p&gt;How it actually works&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fdyaoona774kj1pmx5v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fdyaoona774kj1pmx5v.gif" alt="ScrumSurvivor demo" width="480" height="360"&gt;&lt;/a&gt;&lt;br&gt;
The core idea is simple: intercept what the webcam and microphone send to Teams, process them, and replace them with synthesised versions before Teams ever sees them.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Microphone ──▶ Speech Detector ──────────────────────────────────────▶ VB-Cable ──▶ Teams (audio)
                                │  silent                │  speaking
                                ▼                        ▼
                         Idle Compositor           Wav2Lip Engine
                   (clips + breathing             (lip-syncs face crop
                    + head sway + blink            to mic audio,
                    + sensor noise)                265 ms delayed)
                                │                        │
                                └──────────┬─────────────┘
                                           ▼
                                  Frame Compositor
                             (overlay avatar on background
                              + smoothstep crossfade)
                                           │
                                           ▼
                               OBS Virtual Camera ──▶ Teams (video)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For video: OBS Virtual Camera acts as a perfectly normal webcam from Teams' perspective. What it actually delivers is a 1280×720 composited frame at 25 fps — a static background photo of the user's desk, plus an animated avatar layer on top.&lt;br&gt;
For audio: VB-Audio Virtual Cable creates a virtual audio loopback. Teams records from "CABLE Output"; the application writes the processed microphone audio to "CABLE Input". This gives a 265 ms window to process audio before Teams hears it — exactly enough time to run Wav2Lip inference on a mid-range laptop GPU.&lt;br&gt;
For the face animation: Wav2Lip takes an 80-bin mel spectrogram window and a 96×96 face crop and produces an animated face with lips matching the audio. On an RTX 3050 Laptop GPU (4 GB VRAM) this runs in about 20 ms per frame — fast enough for 25 fps with headroom.&lt;/p&gt;
&lt;h2&gt;
  
  
  MediaPipe detects the face in a base photo once at startup. All subsequent inference uses that fixed crop — no per-frame face detection required. The face crop is composited back into the full frame with the background image as the backdrop.
&lt;/h2&gt;

&lt;p&gt;The idle state&lt;br&gt;
When the user isn't speaking, the pipeline plays pre-recorded short video clips of them sitting quietly at their desk, cycling through them with randomised pauses. Clips alone would be unconvincing — a looping video is easy to spot.&lt;br&gt;
On top of each clip, four independent procedural layers run simultaneously:&lt;br&gt;
Breathing — a subtle vertical oscillation of the body region at ~0.25 Hz. Barely perceptible. Consistently present.&lt;br&gt;
Head sway — a sum of two independent sinusoids per axis, giving a non-repeating micro-motion. No two seconds look the same.&lt;br&gt;
Blink — a fast eyelid-close/reopen animation triggered every 4–8 seconds at a randomised interval.&lt;br&gt;
Sensor noise — per-pixel Gaussian noise added to every frame to simulate the organic texture of a live camera sensor. Flat digital video has an uncanny stillness to it. This removes that.&lt;br&gt;
All transitions between clips use a smoothstepped crossfade — no visible cuts.&lt;/p&gt;
&lt;h2&gt;
  
  
  My friend has been running this for several months. Nobody has said anything.
&lt;/h2&gt;

&lt;p&gt;The hard part: audio sync&lt;br&gt;
Getting audio and video to stay in sync was the most interesting engineering problem.&lt;br&gt;
Wav2Lip takes ~20 ms of GPU time per frame. The audio is already playing by the time the video frame appears. Without compensation, the lips are always slightly behind the voice — an uncanny valley version of an already uncanny valley.&lt;/p&gt;
&lt;h2&gt;
  
  
  The solution: delay the audio output by exactly the same amount as the video processing latency. The &lt;code&gt;AudioPresentationScheduler&lt;/code&gt; maintains a ring buffer of incoming microphone audio and schedules each chunk to be written to VB-Cable exactly &lt;code&gt;audio_delay_ms&lt;/code&gt; milliseconds in the future. The video pipeline runs concurrently and produces frames corresponding to the same audio window — so both arrive at Teams simultaneously.
&lt;/h2&gt;

&lt;p&gt;The cold GPU startup problem&lt;br&gt;
There's a subtlety. The first Wav2Lip inference on a cold CUDA GPU can take 1–2 seconds because NVIDIA's driver compiles JIT kernels for your specific hardware on the first forward pass. If audio scheduling starts before those kernels are compiled, the audio backlog explodes to 18+ seconds — and stays there permanently.&lt;br&gt;
The fix is a warmup loop at startup that runs up to 20 inferences using the actual face crop and monitors latency. Once inference time drops below 50 ms (typically 5–7 iterations), the pipeline opens for business.&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;# Warmup loop — runs until inference stabilises below 50 ms
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MAX_WARMUP_ITERS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;t0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;wav2lip_engine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;infer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;face_crop&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mel_chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;elapsed_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;t0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;elapsed_ms&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;WARMUP_TARGET_MS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="c1"&gt;# 50 ms
&lt;/span&gt;        &lt;span class="n"&gt;stable_count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;stable_count&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;STABLE_REQUIRED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;stable_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Any remaining backlog from slow CUDA init is automatically discarded by a 2-second cap in the scheduler — it resets the pointer rather than letting stale audio pile up indefinitely.
&lt;/h2&gt;

&lt;p&gt;What I deliberately did not build&lt;br&gt;
No cloud inference. Everything runs locally. No face or voice data leaves the machine.&lt;br&gt;
No real-time face re-enactment. Tools like Deep Live Cam do full face replacement and require a live webcam feed as input. ScrumSurvivor uses a static photo — simpler, more stable, no additional hardware dependency.&lt;/p&gt;

&lt;h2&gt;
  
  
  No identity swap. The avatar is always the user themselves, rendered from a photo they took. This is the most important design decision: the tool does not impersonate anyone. It is your face, your voice, your machine, your camera output.
&lt;/h2&gt;

&lt;p&gt;Get it&lt;br&gt;
ScrumSurvivor is open source (MIT). Setup takes about an hour — mostly recording your idle clips and installing OBS and VB-Cable.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>OBS Can't See Your Scenes. I Fixed That.</title>
      <dc:creator>Heiner</dc:creator>
      <pubDate>Thu, 26 Mar 2026 10:38:55 +0000</pubDate>
      <link>https://dev.to/floozie/obs-cant-see-your-scenes-i-fixed-that-3ipf</link>
      <guid>https://dev.to/floozie/obs-cant-see-your-scenes-i-fixed-that-3ipf</guid>
      <description>&lt;p&gt;&lt;em&gt;OBS FrameBridge — a plugin that gives your Lua scripts eyes inside OBS.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;You've spent hours setting up your OBS scenes. The gameplay scene. The loading&lt;br&gt;
screen. The pause menu overlay. Everything is pixel-perfect — and switching&lt;br&gt;
between them manually has become second nature. But deep down, you know it&lt;br&gt;
shouldn't be manual at all.&lt;/p&gt;

&lt;p&gt;OBS is smart enough to do this automatically. Except it can't — because &lt;strong&gt;OBS&lt;br&gt;
has no way to see what's happening inside a scene that isn't currently live.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's a blind spot that's been there since the beginning. And it's why streamers&lt;br&gt;
end up either hitting hotkeys at the wrong moment, or cobbling together&lt;br&gt;
workarounds that involve hidden projector windows, external screen-capture hacks,&lt;br&gt;
and scripts that break whenever a window gets resized.&lt;/p&gt;

&lt;p&gt;There had to be a better way. So I spent a weekend building one.&lt;/p&gt;


&lt;h2&gt;
  
  
  See the difference
&lt;/h2&gt;

&lt;p&gt;Same stream. Same game. Same OBS setup. The only difference is whether&lt;br&gt;
FrameBridge is running.&lt;/p&gt;

&lt;p&gt;❌ Without FrameBridge — manual switching, late, easy to miss:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctqzm95cwuaygn2m65jy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctqzm95cwuaygn2m65jy.gif" alt="Without FrameBridge" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✅ With FrameBridge — automatic, instant, zero effort:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhyul2q29lb0a9rlwlxyn.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhyul2q29lb0a9rlwlxyn.gif" alt="With FrameBridge" width="560" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No hotkeys. No manual triggers. No external tools. The script reads the game's&lt;br&gt;
pixel output in real time and switches scenes automatically — exactly when it should.&lt;/p&gt;


&lt;h2&gt;
  
  
  How it actually works
&lt;/h2&gt;

&lt;p&gt;Every frame, OBS renders your sources to the GPU. Normally that output goes&lt;br&gt;
straight to your stream encoder — nothing else can touch it. FrameBridge hooks&lt;br&gt;
into that render pipeline and copies the pixel data to a CPU-side buffer that&lt;br&gt;
your Lua scripts can query — from &lt;strong&gt;any scene, even if it's not on-air&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OBS Scene ──GPU──▶ FrameBridge ──CPU──▶ Lua Script ──▶ Switch Scene ✓
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What you can do with it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Auto scene switching based on game state&lt;/strong&gt; — FrameBridge reads average&lt;br&gt;
luminance or color from a probe region every 250ms. Your script switches&lt;br&gt;
scenes without you touching a thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Detect UI elements via template matching&lt;/strong&gt; — store a reference image once,&lt;br&gt;
get a similarity score (0.0–1.0) in real time. Detect death screens, score&lt;br&gt;
reveals, menus — whatever you need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Render off-air scenes to PNG on demand&lt;/strong&gt; — useful for automated thumbnails&lt;br&gt;
or assets your viewers never see directly.&lt;/p&gt;




&lt;h2&gt;
  
  
  A real working example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;obs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timer_add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;lum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;avg_luminance&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;lum&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;     &lt;span class="n"&gt;lum&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="n"&gt;switch_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"MenuScene"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elseif&lt;/span&gt; &lt;span class="n"&gt;lum&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="n"&gt;switch_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"PlayingScene"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;                    &lt;span class="n"&gt;switch_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"PauseScene"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No external dependencies. Uses OBS's standard &lt;code&gt;proc_handler&lt;/code&gt; — works with&lt;br&gt;
any existing Lua script setup, no native module loading required.&lt;/p&gt;




&lt;h2&gt;
  
  
  No hacks. Seriously.
&lt;/h2&gt;

&lt;p&gt;Every previous solution involved trickery: hidden projector windows tied to&lt;br&gt;
your desktop resolution, external screen-capture APIs, abusing Studio Mode&lt;br&gt;
transitions. They worked — barely — and broke with any monitor change.&lt;/p&gt;

&lt;p&gt;FrameBridge hooks directly into OBS's internal render loop. &lt;strong&gt;No external&lt;br&gt;
windows. No desktop capture. No undocumented internals.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://github.com/heiner-palmen/obs-framebridge/releases/latest" rel="noopener noreferrer"&gt;→ Download latest&lt;/a&gt; · &lt;a href="https://github.com/heiner-palmen/obs-framebridge" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;OBS 32.0+ · Windows &amp;amp; Linux · MIT License&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Have questions about the implementation or ideas for use cases? Drop them in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>obs</category>
      <category>lua</category>
      <category>automation</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
