<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Fypzo Blog]]></title><description><![CDATA[Fypzo Blog]]></description><link>https://fypzo.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ad85d90e398a1ebaaaa9f36/53186ede-b7b7-41e3-bc76-754f7f515ed6.png</url><title>Fypzo Blog</title><link>https://fypzo.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 24 Oct 2026 18:25:44 GMT</lastBuildDate><atom:link href="https://fypzo.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I break down a viral TikTok into a reusable template for about 2 cents]]></title><description><![CDATA[How Fypzo turns a viral TikTok into a reusable template: shot detection, OCR and BPM first, then an LLM, plus Remotion templates for remixes.]]></description><link>https://fypzo.hashnode.dev/how-i-break-down-a-viral-tiktok-into-a-reusable-template-for-about-2-cents</link><guid isPermaLink="true">https://fypzo.hashnode.dev/how-i-break-down-a-viral-tiktok-into-a-reusable-template-for-about-2-cents</guid><category><![CDATA[AI]]></category><category><![CDATA[Remotion]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[video]]></category><category><![CDATA[buildinpublic]]></category><dc:creator><![CDATA[呂笙]]></dc:creator><pubDate>Wed, 21 Oct 2026 06:46:47 GMT</pubDate><content:encoded><![CDATA[<p>I'm building <a href="https://fypzo.com">Fypzo</a>, a tool that takes a viral short video (TikTok or YouTube Shorts) and turns it into a template: the hook, the shot list, the pacing, the on-screen text, and where the call to action lands. Sellers then reuse that structure for their own product.</p>
<p>This post is about the pipeline behind it: what worked, what didn't, and what each step actually costs.</p>
<h2>The naive version doesn't work</h2>
<p>My first idea was the obvious one: send the video to a multimodal model and ask "describe every shot".</p>
<p>The problem is sampling. Most video-capable models look at roughly one frame per second. A typical product video on TikTok cuts every 0.5 to 1.5 seconds, so the model misses shots, merges them, and invents timestamps. For a "breakdown" product, wrong timestamps are a dealbreaker.</p>
<p>So the rule became: <strong>measure with classic tools first, then let the model describe what was measured.</strong></p>
<h2>The breakdown pipeline</h2>
<pre><code>download → shot detection → speech-to-text → OCR → beat/BPM → keyframes → LLM → JSON template
</code></pre>
<ol>
<li><strong>Shot detection</strong> (PySceneDetect). Gives frame-accurate cut points, which also give a pacing metric: cuts per 10 seconds.</li>
<li><strong>Speech-to-text</strong> with word-level timestamps, so the voiceover lines up with the shots.</li>
<li><strong>OCR</strong> (tesseract) on keyframes. A lot of hooks are written on screen, not spoken, so skipping this loses the most important part of the video.</li>
<li><strong>BPM by autocorrelation.</strong> I originally let the model guess the BPM. It was confidently wrong almost every time. Now the BPM is measured, and if it can't be measured it's simply left out.</li>
<li><strong>Keyframes, capped at 12.</strong> The first 3 seconds and shots with on-screen text get priority. Going from "all shots" to 12 keyframes cut the cost of a 35-shot video from $0.052 to $0.030 with no visible drop in description quality.</li>
<li><strong>The LLM</strong> (Gemini Flash) gets the cut list, transcript, OCR text and keyframes, and returns JSON that has to match a fixed schema: hook type, beat structure, one entry per measured shot, pacing, style and the variables a new product would fill in.</li>
</ol>
<p>Because shots come from the detector, the model can't merge or invent them. It only labels them.</p>
<h2>What it costs (measured)</h2>
<table>
<thead>
<tr>
<th>Video length</th>
<th>Cost per breakdown</th>
<th>End-to-end time</th>
</tr>
</thead>
<tbody><tr>
<td>14–23 s</td>
<td>$0.005–0.014</td>
<td>15–51 s</td>
</tr>
<tr>
<td>62–69 s</td>
<td>$0.016–0.030</td>
<td>53–71 s</td>
</tr>
<tr>
<td>179 s</td>
<td>$0.073</td>
<td>69 s</td>
</tr>
</tbody></table>
<p>A 19-second TikTok pasted by a user finished in 26.8 seconds for $0.0198. That's cheap enough that breakdowns on the site are free and need no sign-up. Videos over 3 minutes are rejected at the probe step, before any paid call happens.</p>
<h2>Remixing: templates, not generated code</h2>
<p>The second half is turning a template into a new video for someone else's product.</p>
<p>It was tempting to let an LLM write Remotion code at runtime. I didn't, for two reasons: it's slow and it fails in ways that are hard to retry safely. Instead:</p>
<ul>
<li>A set of <strong>offline Remotion templates</strong> (product demo listicle, before/after split, UGC hook captions, Reddit story split, green screen commentary...) is written and tested by hand.</li>
<li>At runtime the LLM only produces <strong>parameters</strong>: the script, the text for each shot, timings, and which template to use.</li>
<li>Remotion renders. A deterministic check afterwards looks for wrong dimensions, black or white frames, and text in the platform's unsafe zones.</li>
</ul>
<p>Measured: one script plus 3 rendered videos with different hooks cost about $0.038 and took about 2 minutes. Each render is around $0.013; almost all the cost is the script.</p>
<h2>Things that broke</h2>
<ul>
<li><strong>TTS controlled the video length.</strong> The voiceover set the duration, so a 19-second, 17-shot video came back with a third of the cuts. Fix: split each beat into fast sub-cuts. Pacing went from about 3 back to 6.3–6.8 cuts per 10 seconds.</li>
<li><strong>Everything got a voiceover.</strong> ASMR clips and music-only edits came out as AI narration. Now if the original has no speech, the remix has none either.</li>
<li><strong>"Why did it go viral" is not answerable from one video.</strong> Structure can be extracted reliably (hooks and script around 90%, shots around 80–85% in my checks). The reason a specific video blew up depends on the account, timing and the algorithm. That needs statistics across many videos, not one model call, so I stopped pretending otherwise in the UI.</li>
<li><strong>Copying content vs. copying structure.</strong> The script prompt is told to keep the structure and write new content, and two automatic checks reject made-up numbers and claims like "#1" or "guaranteed". If a check fails, it retries.</li>
</ul>
<h2>Try it</h2>
<p>If you want to see what the JSON template looks like for a real video, paste a TikTok link at <a href="https://fypzo.com">fypzo.com</a>. Breakdowns are free and don't need an account.</p>
<p>I'd love feedback from anyone who has worked on video understanding: is there a better way to get shot boundaries on heavily edited clips (whip pans, zoom cuts) than a content detector?</p>
]]></content:encoded></item></channel></rss>