What does imagens-apoio do?
After the editor's cut, beside the storyboard. Output: a folder of supporting clips named by order and moment,
CREDITOS.md, manifest.json and a NEW copy of the Premiere XML with one marker per moment. The editor places
the clips; there is no review page in this version. Everything heavy runs on this PC; Claude reads only the
transcript, the script and the tool's numbers, and at most one compact contact sheet.
Inputs (stop and ask for what is missing)
- The editor's final XML exported from Premiere (or the reference mp4 of the final cut,
--video). - The script / briefing: episode.json
briefings, else PDF / TXT / MD in the episode'sMATERIAL/folder. - The client's
STYLE.md(what images fit the brand, what is forbidden) andclient.jsonapoioblock. - Format: from the XML's sequence size, else episode.json / client.json
frame(vertical 9:16 or horizontal 16:9).
Sources (client.json apoio.sources, in order; each one is skipped cleanly when not configured)
local— the client's own footage: client.jsonapoio.local_dirs(relative to the client folder; defaultAPOIO,acervo,broll) or--local-dir. Matched by file and folder names;--clipadds CLIP on the GPU (open_clip ViT-B-32, ~600 MB downloaded once; image embeddings cached in the client's_digest/apoio_clip.npz). Use--cliponly when the folder has camera names (IMG_1234) instead of descriptive names.magnific— stock videos/photos via API (MAGNIFIC_API_KEY). Each download calls the API's download endpoint, which is what counts and reports it to Magnific; the tool keeps a per-PC daily ledger (apoio_downloads.json, limitkeys.magnific_daily, default 100) and stops there. Premium items need a plan that allows them.pexels—PEXELS_API_KEY. 4.pixabay—PIXABAY_API_KEY.ia— last resort: the tool lists the moments ingerar_ia.json; generate them with themedia-useskill.python tools/apoio.py fontes <episode>says which are configured (no network).
Steps (from motion-studio/, one fresh session)
- Transcribe the final cut:
python tools/apoio.py palavras <episode> --xml "<final.xml>" [--seq <name>] [--name <video>]->APOIO/<video>/_work/{words.json, transcript.md, roteiro.txt, source.json}. The audio is rebuilt from the XML's speech track (reusing the decupagem'swork/audio/*.wavwhen they exist); with nested sequences pass--video <reference.mp4>. - Pick the moments reading only
_work/transcript.mdand_work/roteiro.txt(not the media). WriteAPOIO/<video>/momentos.json:{"moments": [{"anchor": "conta de energia", "near": 12.3, "dur": 3, "desc": "pessoa olhando a conta de luz", "q": "person looking at electricity bill", "q_pt": "conta de luz", "local": ["conta", "energia"], "kind": "video"}]}anchor= the words as said (the tool finds the exact second),near= approximate second,dur2–5 s.q= stock search in English (Pexels / Magnific search best in English),q_pt= Portuguese (Pixabay, client folder),local= words likely in the client's file names;kindvideo (default) or photo.- What deserves an image: a thing, place, product, person type or action that is named; an idea that has an obvious concrete picture; a number with a visual (money, people). Follow the script's own image directions ("Imagem:", "Visual:") first — they are the client's intent.
- What does not: the hook's first seconds when the speaker must be seen, the CTA, lines that become motion
cards in the storyboard (product lists, on-screen text), abstract filler. Propose only where it helps —
there is no fixed rhythm. Defaults: at least
min_gap_s(4) between moments and at mostmax_per_min(6); the client'sapoioblock and STYLE.md override them. - Never use stock that shows another brand, logos, or claims the client cannot make (STYLE.md section 6).
- Region: images must look like the client's country and audience. Mark
"regional": trueon every moment whose picture changes by country — places, cities, government, city halls, money, documents, streets, homes, shops, everyday scenes — and the tool appends client.jsonapoio.regiao(en / pt) to its queries (regional_padrao: truedoes it for every moment). Name a landmark when there is one ("Brasilia national congress"). Generic terms bring foreign capitols and dollars: reject them on the sheet even if the query was regional. - When the user asks for a list said fast (products, services), one image per item as a quick montage is fine:
the
PERTO/DENSOwarnings are expected there.
python tools/apoio.py checar <episode> --name <video>— every moment must resolve; fix eachMISS(anchor not said that way) and readPERTO/DENSO.- Search:
python tools/apoio.py buscar <episode> --name <video> [--per 4] [--clip](--dryprints the queries without calling anything). Writes_work/candidates.jsonand_work/folha_1.jpg(one row per moment, candidates numbered,CROPin red = wrong orientation). Read the printed lines first — each candidate's title is printed under its moment; check it before picking (a thumbnail of banknotes or a capitol does not show the country) — and look at the sheet once, only if a choice is doubtful. Candidate 1 is the default; change it inmomentos.jsonwith"pick": a number,"<source>:<id>","ia","arquivo:<path>"(a file you already have) or"nada". A newqneeds a newbuscar: pass--ids 7,8to search only those moments and keep every other candidate (and pick) as it is. Adding moments later: keepidin time order; rename already downloaded files to their newNN_prefix sobaixarreuses them instead of downloading again. - Download:
python tools/apoio.py baixar <episode> --name <video>->APOIO/<video>/NN_MMmSSs_<desc>.ext,CREDITOS.md(source, author, license, link, id),manifest.json; already downloaded files are kept. Moments markedia(or with no candidate wheniais a source) go togerar_ia.json: generate them with themedia-useskill in the right frame size, save them in the same folder with that file name, set"pick": "arquivo:<path>"(and"credit") and runbaixaragain. - Markers:
python tools/apoio.py marcas <episode> --name <video>->APOIO/<video>/<xml>_apoio.xml, the sequence renamed<name>_APOIO, one marker per moment (start = the spoken word, length =dur, comment = description | file | source | crop note | the words). Never overwrites: it adds_v2,_v3. Tell the editor to import that XML and drag the clips fromAPOIO/<video>/onto the markers. - Report: moments, sources used / skipped (no key), downloads left today on Magnific, crops to do. Log the
user's approvals and rejections of the images in STYLE.md section 7 and turn them into
apoiorules there.
Tests and safety
--out <folder>on every command writes nothing in the episode (CLIP cache also stays there).- Keys live only in environment variables, the user's
~/.motion-studio/chaves.json(apoio.py chavescreates it) or the per-PCstudio.config.json(keys), never in git or in a client file. Never ask the user to paste a key in the chat: they paste it in that file. Do not search the web or scrape sites for footage: only these APIs and the client's folders. - Several reels of one client: run
palavrasonce per XML (--name V1,V2...) in the same session.