Answers/Calculators/Lyric GIF b-roll engine

Method + download

Auto-Add a Meme GIF to Every Lyric Line: How the Lyric GIF B-Roll Engine Works, and the Scripts

The short answer

The way to add a GIF to every line of a lyric video automatically is: time the lines once, rewrite each lyric into a short meme-search phrase, search a GIF API for that phrase, download the MP4 rendition, loop it to the line's length, and write the cuts into an editor project or straight to an MP4. iMessage #images cannot be used for this - it has no API - and Tenor's API shut down on 30 June 2026, so GIPHY (100 free calls an hour) or KLIPY are the search engines that still work. The scripts that do all of this are on this page.

Feed it a timed lyric sheet and it searches a meme GIF for every line, cuts each one to the exact length of the line, and writes a finished MP4 plus a Premiere Pro project with two alternates per line ready to swap. Python scripts, free GIPHY key, ffmpeg. Built for my own song on 5 September 2026; download below.

Key facts
Input
One line per lyric with a start and end time — the timing.txt the Lyric Sync Timer exports.
Picker
Each lyric is rewritten into a short meme-search phrase, searched on GIPHY, and the top 3 unused results are kept per line.
Output
A finished MP4 (GIF full-frame, lyrics over it), plus a Premiere Pro XML with every GIF cut to its line on V2 and the alternates in a bin.
Runs on
Any Mac with Python 3 and ffmpeg. Standard library only. A free GIPHY key. Nothing is uploaded anywhere but the GIF searches.
Status
Version 0.1, built 5 September 2026 and used on my own song the same night. The scripts are downloadable below. A browser version is planned.

What it does

You already know the move: a lyric lands, a meme GIF punches it. Doing that by hand means searching a GIF for every line, downloading it, dropping it on the timeline, trimming it to the line. Forty lines is an evening. This does the whole thing from the timing sheet in about two minutes, and leaves you a project where every GIF is already cut to its line and two backups per line are one drag away.

1 · TimingHold-to-time each line with the Lyric Sync Timer. 40 lines, one play of the song.
2 · Meme queryEach lyric becomes a 2–4 word search phrase in meme-speak. This step decides whether it is funny.
3 · FetchGIPHY search per phrase, MP4 renditions downloaded, no GIF reused twice in a song, 3 candidates per line.
4 · Cutffmpeg scales each clip to 1080p, loops it to the exact line length. Premiere XML + MP4 written.

The step that matters: lyric → meme query

Searching a GIF site for the lyric itself returns nothing useful. "Tiny words na ga hurt when I praise Jah" is not a GIF. What you actually type into a GIF search is the reaction the line calls for. That rewrite is the whole trick, and it is the part worth doing with care — by hand, or with an LLM, which is what I use. These are real rows from my song:

LyricQuery the engine searched
Hou these myna birds brahannoying birds squawking
Na ga mess with Mr Mayjahdon't mess with me
Tiny words na ga hurt when I praise Jahunbothered
He na ga let yayou shall not pass
You can not bug usswatting fly
To flex the Mr Mayjahflexing muscles
Mr Aloha, surely you know howaloha hawaii shaka

Three rules that came out of the first run. Repeated hook lines get the same query but the engine rotates to a different GIF each time, so the chorus does not repeat itself. Every query carries two fallbacks, because some phrases return junk. And nothing that hits the timeline is final — the engine writes a review page with all three candidates playing side by side, you click the better one, and the project rebuilds from your picks without downloading anything again.

Which GIF search to build on (checked 5 September 2026)

This changed recently, and most guides online are now wrong. Apple's #images in Messages has no developer access at all — Apple's support page documents a search box and nothing else. Tenor, which powered a lot of GIF integrations, stopped accepting new API clients on 13 January 2026 and shut the API down on 30 June 2026. GIPHY still has an API: every key starts as a beta key limited to 100 calls an hour, production access is by application, and the terms require "Powered by GIPHY" attribution and forbid building your own GIF index from the results. KLIPY is the newer free alternative, also 100 calls an hour on a test key. Version 0.1 of the engine uses GIPHY; a 40-line song took 26 calls, so the free tier covers a couple of songs an hour.

The honest part about copyright

Meme GIFs are clips of other people's footage. Using them as b-roll in a monetised music video is the same grey zone as using #images in a Story — extremely common, rarely enforced, never actually cleared. I treat it like this: fine for edits and social cuts, and I keep the attribution the API returns (uploader and source page) in the project so I can find and swap anything if asked. If you want visuals you own outright, the same lyric-to-prompt step feeds an image or video generator instead of a GIF search. That is where I am taking this next.

Get the scripts

Download lyric-gif-broll-engine-v0.1.zipUnder 50 KB · Python 3 + ffmpeg · free to use and change
  1. Unzip. Put your song's timing.txt from the Lyric Sync Timer in songs/<your-song>/lines.txt. Point song.json at your audio file and, if you have one, your lyric-video render.
  2. Write queries.json — one meme phrase plus two fallbacks per line. The example for my song is included so you can see the shape. Paste the lyrics into an LLM with the table above as the pattern if you want it done in a minute.
  3. Create a free GIPHY API key at developers.giphy.com. Double-click the RUN file; it asks for the key once and stores it locally.
  4. It writes <Song>_GIF_BROLL.xml (Premiere: File → Import), <Song>_GIF_BROLL_fullbleed.mp4, and review.html. Swap picks in the review page, save picks.json into the song folder, run again.
python3 run.py songs/my-song              # search + download + Premiere XML + review page
python3 run.py songs/my-song --rebuild    # rebuild from picks.json, no network
python3 render_mp4.py songs/my-song       # MP4: GIF full-frame, lyrics keyed over it
python3 render_mp4.py songs/my-song panel # MP4: GIF in a framed box above the lyrics

Questions people ask

Can it use my iMessage #images GIFs?

No, and nothing can. #images is a closed Apple feature with no API. The same GIFs are on GIPHY and KLIPY, which do have APIs; that is what the engine searches.

Does it work with CapCut or After Effects?

Not yet. The XML is Final Cut Pro 7 format, which Premiere Pro and DaVinci Resolve import. After Effects would take a script built from the same picks file. CapCut has no official import path, and the open-source draft writers currently need Windows CapCut to export, so I have not built that.

Why an MP4 as well as a project file?

Because I had not installed Premiere yet on the machine I was working on. The MP4 render takes about 40 seconds and is good enough to post; the project file is for when you want to re-cut.

Does it need the lyric video to already exist?

No. Without a base video the MP4 is GIFs and your audio; with one, the lyric text is keyed over the GIFs. The timing sheet is the only thing it actually needs.

References

  1. Apple Support — Send and save GIFs on your iPhone or iPad (#images) — retrieved 5 September 2026
  2. Google Tenor Help — Tenor API service discontinuation — retrieved 5 September 2026
  3. GIPHY Developers — API documentation (beta key rate limit) — retrieved 5 September 2026
  4. GIPHY — API Terms of Service — retrieved 5 September 2026
  5. KLIPY — Developers — retrieved 5 September 2026
  6. pyCapCut — CapCut draft generator (Windows export note) — retrieved 5 September 2026

Get the paperwork done in one afternoon

The Zero to Beat Society walks through registration, splits and release paperwork step by step — with the templates and checklists already filled in.

See the tiers