<?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: ReelBoop</title>
    <description>The latest articles on DEV Community by ReelBoop (@reelboop).</description>
    <link>https://dev.to/reelboop</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%2F4260145%2Fb26dcc88-25a3-4d4f-9a02-9faed3784232.png</url>
      <title>DEV Community: ReelBoop</title>
      <link>https://dev.to/reelboop</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/reelboop"/>
    <language>en</language>
    <item>
      <title>How to build a 12-second vertical video ad with FFmpeg</title>
      <dc:creator>ReelBoop</dc:creator>
      <pubDate>Mon, 23 Nov 2026 09:10:22 +0000</pubDate>
      <link>https://dev.to/reelboop/how-to-build-a-12-second-vertical-video-ad-with-ffmpeg-842</link>
      <guid>https://dev.to/reelboop/how-to-build-a-12-second-vertical-video-ad-with-ffmpeg-842</guid>
      <description>&lt;p&gt;Open the &lt;a href="https://reelboop.com/media/blog/how-to-make-a-video-ad-with-stock-footage/example.mp4" rel="noopener noreferrer"&gt;finished ReelBoop demo&lt;/a&gt; and grab the &lt;a href="https://reelboop.com/media/blog/how-to-make-a-video-ad-with-stock-footage/edit-kit.zip" rel="noopener noreferrer"&gt;FFmpeg edit kit&lt;/a&gt;. The edit goes from a waterfall to a dripping faucet to a booking card. Here’s how to reproduce those cuts and check the portrait crop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Render the three shots
&lt;/h2&gt;

&lt;p&gt;Unzip the kit. Beside &lt;code&gt;render.sh&lt;/code&gt;, save the 720 × 1280 &lt;a href="https://www.pexels.com/video/vertical-video-of-a-waterfalls-8859850/" rel="noopener noreferrer"&gt;waterfall by Pavel Danilyuk&lt;/a&gt; as &lt;code&gt;waterfall.mp4&lt;/code&gt; and the 3840 × 2160 &lt;a href="https://www.pexels.com/video/a-footage-of-water-dripping-from-a-faucet-5823848/" rel="noopener noreferrer"&gt;faucet by Charlotte May&lt;/a&gt; as &lt;code&gt;faucet.mp4&lt;/code&gt;. Both are from Pexels. The kit includes the three graphics for a fictional plumbing service. &lt;a href="https://www.pexels.com/legal-pages/license/" rel="noopener noreferrer"&gt;Pexels license&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run this in the extracted folder with Bash and FFmpeg built with &lt;code&gt;libx264&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash render.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script writes &lt;code&gt;stock-footage-ad.mp4&lt;/code&gt;. Move an existing output before rerunning because the script uses &lt;code&gt;-n&lt;/code&gt; to preserve it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Output time&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Frames at 30 fps, zero-based&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0–3 s&lt;/td&gt;
&lt;td&gt;Waterfall, 0.5–3.5 s&lt;/td&gt;
&lt;td&gt;0–89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3–8 s&lt;/td&gt;
&lt;td&gt;Faucet, 1–6 s&lt;/td&gt;
&lt;td&gt;90–239&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8–12 s&lt;/td&gt;
&lt;td&gt;Booking card, held for 4 s&lt;/td&gt;
&lt;td&gt;240–359&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The script converts both clips to 30 fps, resets their timestamps to zero, and overlays the PNG graphics before concatenating the three segments. The export has one video stream and plays silently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put the spout inside the portrait crop
&lt;/h2&gt;

&lt;p&gt;At a source height of 2160 pixels, a 9:16 window is 1215 pixels wide. The kit uses 1216 as an even-width approximation for subsampled video, then scales to an exact 720 × 1280 frame with square pixels. &lt;a href="https://ffmpeg.org/ffmpeg-filters.html#crop" rel="noopener noreferrer"&gt;FFmpeg crop filter&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;crop=1216:2160:1760:0,scale=720:1280,setsar=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last two crop values are the window’s left and top offsets. A centered window would start at &lt;code&gt;(3840 - 1216) / 2 = 1312&lt;/code&gt;. This shot starts at &lt;code&gt;x=1760&lt;/code&gt;, shifting the window 448 pixels right so the spout and the space below it stay in frame. For a different shot, adjust &lt;code&gt;x&lt;/code&gt; while scrubbing through the movement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the MP4 and both cut points
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffprobe -v error \
  -show_entries &lt;span class="nv"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;codec_type,codec_name,width,height,sample_aspect_ratio,r_frame_rate,nb_frames:format=duration \
  -of json stock-footage-ad.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The finished demo reports 12.000 seconds and a single H.264 video stream at 720 × 1280, with square pixels and 360 frames at 30 fps. &lt;a href="https://ffmpeg.org/ffprobe.html" rel="noopener noreferrer"&gt;ffprobe documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inspect the frames immediately before and after each cut. This command puts them in a single strip, in playback order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg -v error -i stock-footage-ad.mp4 \
  -vf &lt;span class="s2"&gt;"select='eq(n,89)+eq(n,90)+eq(n,239)+eq(n,240)',scale=240:426,tile=4x1"&lt;/span&gt; \
  -frames:v 1 -update 1 cuts.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;cuts.png&lt;/code&gt;, expect waterfall → faucet → faucet → booking card. Play the middle shot to make sure the drop stays inside the crop. Then watch the card at phone size and check that “Book a faucet repair” is readable before the video loops.&lt;/p&gt;

&lt;p&gt;For the full shot comparison and the editing walkthrough, see &lt;a href="https://reelboop.com/blog/how-to-make-a-video-ad-with-stock-footage?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=offsite_preview&amp;amp;utm_content=ffmpeg_stock_ad" rel="noopener noreferrer"&gt;ReelBoop’s stock-footage guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AI assisted with drafting and editing. The render and frame-check commands were run against the source footage and edit kit.&lt;/em&gt;&lt;/p&gt;

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