<?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: Rochelle Vale</title>
    <description>The latest articles on DEV Community by Rochelle Vale (@rochellevale).</description>
    <link>https://dev.to/rochellevale</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%2F4265080%2F7d414156-143a-4433-aa1b-546c56438234.png</url>
      <title>DEV Community: Rochelle Vale</title>
      <link>https://dev.to/rochellevale</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rochellevale"/>
    <language>en</language>
    <item>
      <title>Three ffmpeg traps that cost me a wasted render</title>
      <dc:creator>Rochelle Vale</dc:creator>
      <pubDate>Wed, 25 Nov 2026 15:37:40 +0000</pubDate>
      <link>https://dev.to/rochellevale/three-ffmpeg-traps-that-cost-me-a-wasted-render-57c7</link>
      <guid>https://dev.to/rochellevale/three-ffmpeg-traps-that-cost-me-a-wasted-render-57c7</guid>
      <description>&lt;p&gt;I build short vertical videos from a still image, a narration track, and a few text cards. No editor, no generation credits, just &lt;code&gt;ffmpeg&lt;/code&gt; and Pillow. That constraint is the whole point: when you can't eyeball your way to a good cut, you have to measure.&lt;/p&gt;

&lt;p&gt;These are three traps that each produced a render that exited &lt;code&gt;0&lt;/code&gt; and was still wrong, plus the one habit that catches all of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;code&gt;overlay&lt;/code&gt; with &lt;code&gt;eof_action=repeat&lt;/code&gt; never ends the filtergraph
&lt;/h2&gt;

&lt;p&gt;If you layer a card over a moving background and let the shorter input repeat, the graph keeps pumping frames forever:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;-filter_complex &lt;span class="s2"&gt;"[0:v][1:v]overlay=eof_action=repeat[out]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The encode runs, produces gigabytes, and never finishes on its own. You need to cap it explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;-t 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;eof_action=repeat&lt;/code&gt; is doing what it says: repeating the last frame of the shorter stream. That means no EOF, which means no natural end, which means you &lt;em&gt;must&lt;/em&gt; tell it when to stop. If your render "hangs," check the filtergraph before you blame the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A single-frame PNG needs an explicit loop
&lt;/h2&gt;

&lt;p&gt;Passing a one-frame image as a normal input gives you one frame. If a fade lives on that stream, the alpha can hit zero before the frame is ever displayed, and you get a blank layer with a perfectly healthy log.&lt;/p&gt;

&lt;p&gt;For a plain input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;-loop 1 -i card.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a filter input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;loop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;loop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-1:size=1:start=0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Either way, the single frame has to be told to behave like a stream. Without it, your text card is &lt;code&gt;null&lt;/code&gt; and you find out only by looking at pixels.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;code&gt;zoompan&lt;/code&gt; &lt;code&gt;d&lt;/code&gt; is in input frames, not output seconds
&lt;/h2&gt;

&lt;p&gt;The push-in I use is subtle: scale up a hair over the length of the clip. But &lt;code&gt;d&lt;/code&gt; counts per input frame. If you set it in the wrong units the motion either stutters or stalls halfway, and the encode looks fine.&lt;/p&gt;

&lt;p&gt;The rule I use: &lt;code&gt;d&lt;/code&gt; must cover the clip in frames. A 20 second clip at 30 fps is &lt;code&gt;d=600&lt;/code&gt;. Do the arithmetic instead of guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The habit that catches all three: measure the output, not the exit code
&lt;/h2&gt;

&lt;p&gt;A render can exit &lt;code&gt;0&lt;/code&gt; and be wrong. I once shipped a video with no visible text at all. Nothing errored. I caught it by probing pixel luminance of a few frames, not by watching it.&lt;/p&gt;

&lt;p&gt;Two cheap checks worth adding to any pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Probe a frame you care about and assert it isn't flat black where text should be.&lt;/li&gt;
&lt;li&gt;Assert the container duration matches what you intended. &lt;code&gt;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 out.mp4&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The lesson after the traps: the words were never the problem
&lt;/h2&gt;

&lt;p&gt;My first cut was five cards at roughly six seconds each over a portrait that never moved. 18 people opened it and 0 watched to the end.&lt;/p&gt;

&lt;p&gt;I could have rewritten the script. Instead I measured the shape of it: the narration had long silences, every card held too long, and nothing in the frame ever moved. So I silence-detected the narration, trimmed the speech with 0.12 second gaps, and added a slow &lt;code&gt;zoompan&lt;/code&gt; push-in. Same words. Different retention shape.&lt;/p&gt;

&lt;p&gt;Retention is a property of pacing and motion, not of phrasing. That sounds obvious until you've spent a day making the words better.&lt;/p&gt;




&lt;p&gt;The whole method is just: keep the pipeline cheap enough to iterate, and measure the output instead of trusting it. If you have a filtergraph that looks fine and an encode that hangs, check &lt;code&gt;eof_action&lt;/code&gt; first.&lt;/p&gt;

</description>
      <category>video</category>
      <category>bash</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
