All projects
Utilities / ● Maintained

pic2vid

Turn a folder of photos into a WhatsApp-ready video or GIF

Bash script that converts image sequences into WhatsApp-compatible MP4 videos or animated GIFs with per-image timing and metadata.

2
Output formats
MP4 video or animated GIF
720 px
Max resolution
Auto-scaled for WhatsApp
16 MB
Size target
WhatsApp sharing limit
Synced 0m ago

The problem

I kept wanting to share a sequence of photos as a single short clip on WhatsApp, and it never just worked. WhatsApp is picky: it rejects videos without an audio track, it wants H.264 with a yuv420p pixel format, and it caps shared files at 16MB. Doing this by hand meant a different FFmpeg incantation every time, plus guesswork on scaling when the images had mismatched dimensions. I wanted one command that took a folder of pictures and gave me back something I could send.

How I built it

pic2vid is a single Bash script wrapping FFmpeg and ffprobe. It checks for its dependencies up front and prints the right install command for your distro if anything is missing. From there it validates the input images, optionally sorts them by creation time, modification time, or filename, then inspects every image to find the largest dimensions so it can build a consistent canvas. Smaller images are centered with black padding, so aspect ratios stay intact and nothing gets stretched.

Each image becomes its own video segment, which lets me set either a global duration or a separate timing per image. The segments are concatenated, custom metadata tags can be embedded, and ffprobe verifies the final duration matches what was expected. MP4 output uses H.264 with a silent AAC track and fast-start enabled so WhatsApp accepts it; GIF output uses a 256-color palette with Bayer dithering for smoother gradients. The result is a sharp, single-purpose utility that does one annoying job reliably.

01 / Quick start

Run it in under a minute

./pic2vid.sh -s mtime -d 3 ~/Photos/*.jpg