<?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: Jals</title>
    <description>The latest articles on DEV Community by Jals (@jals_builds).</description>
    <link>https://dev.to/jals_builds</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%2F4105756%2F511d382b-b54b-4570-9347-677c7f067b39.png</url>
      <title>DEV Community: Jals</title>
      <link>https://dev.to/jals_builds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jals_builds"/>
    <language>en</language>
    <item>
      <title>How I extract burned-in subtitles from TikTok videos with Python (and why AWS/Google are overkill)</title>
      <dc:creator>Jals</dc:creator>
      <pubDate>Wed, 02 Sep 2026 08:29:51 +0000</pubDate>
      <link>https://dev.to/jals_builds/how-i-extract-burned-in-subtitles-from-tiktok-videos-with-python-and-why-awsgoogle-are-overkill-1pdd</link>
      <guid>https://dev.to/jals_builds/how-i-extract-burned-in-subtitles-from-tiktok-videos-with-python-and-why-awsgoogle-are-overkill-1pdd</guid>
      <description>&lt;p&gt;If you've ever tried scraping content or transcripts from TikTok, Instagram Reels, or YouTube Shorts, you've probably noticed a common issue: &lt;strong&gt;most social media videos don't have separate &lt;code&gt;.srt&lt;/code&gt; caption tracks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creators hardcode animated captions, promo codes, and visual hooks directly into the video pixels.&lt;/p&gt;

&lt;p&gt;When I started building automated video pipelines, I looked at Google Cloud Video Intelligence and AWS Rekognition. But charging $0.10 to $0.15 per video minute gets expensive fast (processing a few hundred hours can cost thousands of dollars).&lt;/p&gt;

&lt;p&gt;Here is the lightweight architecture I built in Python to extract hardcoded subtitles into clean &lt;code&gt;.srt&lt;/code&gt; files on a standard GPU (or CPU) without breaking the bank.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The 3 Bottlenecks with Traditional Video OCR
&lt;/h2&gt;

&lt;p&gt;If you just run &lt;code&gt;ffmpeg&lt;/code&gt; + &lt;code&gt;Tesseract&lt;/code&gt; on every single video frame, three things happen:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CPU Choke:&lt;/strong&gt; Running OCR on 30 frames per second takes 10+ minutes for a 60-second clip.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate Spam:&lt;/strong&gt; Text staying on screen for 3 seconds produces 90 duplicate lines without proper timestamps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flickering Typos:&lt;/strong&gt; Character recognition varies slightly from frame to frame, breaking continuity.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. The Solution: Frame-Diffing + Temporal Fusion
&lt;/h2&gt;

&lt;p&gt;To solve this, the pipeline uses two simple optimizations:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step A: Frame Difference Skipping (SSIM)
&lt;/h3&gt;

&lt;p&gt;Instead of feeding every frame to the OCR model, we sample at 1-2 fps and compare consecutive frames with structural similarity. If the pixels didn't change significantly, we skip neural OCR inference. This cuts GPU compute time by ~80%.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step B: Temporal Text Deduplication
&lt;/h3&gt;

&lt;p&gt;Adjacent detections that share high Levenshtein text similarity (&amp;gt;85%) are merged into a single continuous timecode (&lt;code&gt;00:00:01,000 --&amp;gt; 00:00:04,500&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Python Implementation
&lt;/h2&gt;

&lt;p&gt;Here is how you can use the open-source package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;tiktok-subtitle-ripper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  In your Python script:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;tiktok_subtitle_ripper&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;rip_video&lt;/span&gt;

&lt;span class="c1"&gt;# Pass any TikTok, Reels, or direct MP4 link
&lt;/span&gt;&lt;span class="nf"&gt;rip_video&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://www.tiktok.com/@creator/video/1234567890&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output_srt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;subtitles.srt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Or directly from the terminal:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tiktok-rip &lt;span class="s2"&gt;"https://www.tiktok.com/@creator/video/1234567890"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; my_subtitles.srt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Free Web Demo &amp;amp; API
&lt;/h2&gt;

&lt;p&gt;I also put together a free web demo on Hugging Face Spaces where you can paste any link and test it without installing anything:&lt;br&gt;
👉 &lt;a href="https://huggingface.co/spaces/Jals-builds/tiktok-reels-subtitle-ripper" rel="noopener noreferrer"&gt;TikTok &amp;amp; Reels Subtitle Ripper on Hugging Face Spaces&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For high-volume scraping pipelines, I also published the API backend on RapidAPI (starting at $2.99/mo).&lt;/p&gt;

&lt;p&gt;Would love any feedback or edge cases where font outlines get tricky!&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
