DEV Community

Andrew Armstrong
Andrew Armstrong

Posted on

ReelGeek: photos to a vertical video with Pillow, numpy and no watermark

Hi DEV!

Every photos to reel app I tried on the desktop either stamped a watermark on the export, capped the length, or wanted a monthly fee for 1080p. For pointing at a folder of holiday photos and getting a vertical video out, that felt steep.

ReelGeek does the plain version:

  • Pick the photos, pick a style, pick some music
  • Renders 1080x1920, the vertical format the platforms actually want
  • Pans and crossfades, so it does not look like a 2004 slideshow
  • No watermark, no length cap, no account

Why I built it

This is not a hard problem. It is a Ken Burns pan, a crossfade, and an encode. The whole reason it is a subscription elsewhere is distribution, not compute. Rendering locally means a two minute video costs the same as a ten second one, which is to say nothing.

Tech stack

  • Python
  • Pillow for the image work
  • numpy for the frame maths, the pan and zoom transforms and the crossfade blending
  • ffmpeg for the encode

numpy is doing the heavy lifting. Generating frames one at a time through Pillow alone was far too slow, but expressing the pan as an array operation and blending transitions as weighted sums makes it tolerable on a normal laptop.

The soundtrack sync is deliberately simple. Transitions land on a fixed interval rather than beat detection, because beat detection that is slightly wrong looks much worse than a steady rhythm that ignores the music.

Honest caveat

The installer is not code signed yet, so SmartScreen may warn on first run. Rendering is CPU bound, so a long video on an old machine takes a while.

Links

Styles are the part I expect to grow. Tell me what is missing.

Top comments (0)