Files
OrbitTv/design/channels/build-batch5-blocks.py
T
pauljdandClaude Opus 5.5 e10afd41d5
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 2m30s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m30s
Batch 5 presentation template previews (Drive-In takeovers, themed nights, First Screening and New Arrivals); Living Network architecture on the roadmap
Previews only; no scheduling or app changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-03 21:52:27 +00:00

414 lines
22 KiB
Python

#!/usr/bin/env python3
"""Batch 5 presentation templates, previews for Paul's review (3 November 2026 brief).
Reusable templates the Living Network can select once an event is approved and booked; none is a dated event.
- Five Drive-In takeovers on the Drive-In's own picture house, re-dressed (blender/build_block_ident.py: fright,
christmas, drivfi, eighties, arnie), each opening on its own themed marquee board.
- Themed nights (director, actor, franchise, decade): no video of their own. The app draws a clapperboard card with
the booked theme's name over the host event's ident, at its hold. Previewed here over Cult Classics.
- Premiere: one clip (premiere) shared by First Screening and New Arrivals; the app draws the badge and the booked
film's title over it.
Channel scenes and approved artwork are read only. Writes drive-in-takeovers/, orbit-themed-nights/, orbit-premiere-blocks/.
build-batch5-blocks.py <blender-blocks folder> [fright|christmas|drivfi|eighties|arnie|themed|premiere] ...
"""
from pathlib import Path
import importlib.util, json, math, os, random, shutil, subprocess, sys
from PIL import Image, ImageChops, ImageDraw, ImageFilter, ImageFont
HERE = Path(__file__).resolve().parent
def load(name, file):
spec = importlib.util.spec_from_file_location(name, HERE / file)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
riot, dark, b3, b4 = load('riot', 'build-riot-blocks.py'), load('dark', 'build-dark-blocks.py'), load('b3', 'build-batch3-blocks.py'), load('b4', 'build-batch4-blocks.py')
kf, ease_out, ease_in, ease_io, glow, fade = riot.kf, riot.ease_out, riot.ease_in, riot.ease_io, riot.glow, riot.fade
text_layer, place, scaled, font, fade_in = dark.text_layer, dark.place, dark.scaled, dark.font, dark.fade_in
DESIGNS, W, H, FPS, LENGTH, MOVE = dark.DESIGNS, dark.W, dark.H, dark.FPS, dark.LENGTH, dark.MOVE
WHITE, NAVY = (255, 255, 255), (7, 22, 50)
DRIVE_IN_LOGO = HERE / 'drive-in' / 'drive_in_marquee.png'
# Each takeover's board: title lines, the face colour, lettering colours, bulb colour, and a font.
TAKEOVERS = {
'fright': dict(title='Orbit Fright Nights', lines=['ORBIT', 'FRIGHT NIGHTS'], face=(22, 8, 30), ink=(255, 122, 26), sub=(255, 200, 140), bulbs=(255, 140, 40), face_font='anton-regular.ttf'),
'christmas': dict(title='Christmas at Orbit', lines=['CHRISTMAS', 'AT ORBIT'], face=(10, 52, 30), ink=(255, 214, 120), sub=(255, 246, 220), bulbs=(255, 226, 150), face_font='anton-regular.ttf'),
'drivfi': dict(title='Driv-Fi', lines=['ORBIT DRIVE-IN', 'DRIV-FI'], face=(8, 18, 34), ink=(95, 232, 255), sub=(200, 236, 255), bulbs=(140, 236, 255), face_font='anton-regular.ttf'),
'eighties': dict(title='The 80s Takeover', lines=['THE', '80S TAKEOVER'], face=(26, 8, 34), ink=(255, 58, 184), sub=(56, 224, 255), bulbs=(255, 120, 210), face_font='anton-regular.ttf'),
'arnie': dict(title='Arnie Triple Bill', lines=['ARNIE', 'TRIPLE BILL'], face=(26, 28, 32), ink=(220, 226, 236), sub=(255, 138, 42), bulbs=(255, 170, 80), face_font='anton-regular.ttf'),
}
BLOCKS = {k: dict(title=v['title'], folder=f'drive-in-takeovers/{k}', channel='drive-in') for k, v in TAKEOVERS.items()}
BLOCKS['themed'] = dict(title='Themed night (director, actor, franchise, decade)', folder='orbit-themed-nights/themed-night', channel='orbit-after-dark')
BLOCKS['premiere'] = dict(title='First Screening and New Arrivals', folder='orbit-premiere-blocks/premiere', channel='orbit-premiere')
def board(key, w, h, lit):
"""The takeover's marquee board: a face in the theme's colour, a ring of bulbs and two lines of lettering.
lit runs 0 to 1: the lettering warms up letter by letter and the bulbs come on in a run; at 1 all is steady."""
t = TAKEOVERS[key]
b = Image.new('RGBA', (w, h))
d = ImageDraw.Draw(b)
d.rounded_rectangle((0, 0, w - 1, h - 1), 18, fill=t['face'] + (255,), outline=(200, 170, 110, 255), width=4)
d.rounded_rectangle((10, 10, w - 11, h - 11), 12, outline=(110, 90, 60, 255), width=2)
step = 26
spots = [(x, 24) for x in range(32, w - 24, step)] + [(w - 24, y) for y in range(24 + step, h - 24, step)] + \
[(x, h - 24) for x in range(w - 32, 24, -step)] + [(24, y) for y in range(h - 24 - step, 24, -step)]
for i, (x, y) in enumerate(spots):
on = kf(lit, [(i / len(spots) * .7, 0), (i / len(spots) * .7 + .1, 1)], lambda u: u)
c = tuple(round(60 + (v - 60) * on) for v in t['bulbs'])
d.ellipse((x - 6, y - 6, x + 6, y + 6), fill=c + (255,))
top = text_layer(t['lines'][0], font('barlow-semibold.ttf', round(h * .13)), t['sub'] + (255,), round(h * .05))
big = text_layer(t['lines'][1], font(t['face_font'], round(h * .36)), t['ink'] + (255,), round(h * .02))
big = scaled(big, min(1, (w - 120) / big.width))
y0 = round(h * .2)
b.alpha_composite(top, (round((w - top.width) / 2), y0))
# Letter by letter: a wipe across the big line, with a soft warm-up glow behind each letter as it lights.
reveal = Image.new('L', big.size, 0)
ImageDraw.Draw(reveal).rectangle((0, 0, round(big.width * kf(lit, [(.15, 0), (.85, 1)], lambda u: u)), big.height), fill=255)
shown = big.copy(); shown.putalpha(ImageChops.multiply(big.getchannel('A'), reveal))
at = (round((w - big.width) / 2), y0 + top.height + round(h * .07))
halo = Image.new('RGBA', b.size); halo.alpha_composite(shown, at)
b.alpha_composite(glow(halo, 8, 1.3))
b.alpha_composite(shown, at)
return b
def snow(canvas, t, seed=7):
"""Gentle snow in front, slowing and settling out of frame before the hold."""
rng = random.Random(seed)
d = ImageDraw.Draw(canvas)
fall = kf(t, [(0, 0), (3.3, 1)], ease_out)
a = kf(t, [(2.8, 1), (3.4, 0)], ease_io)
if a <= 0:
return
for _ in range(160):
x0, y0, r, speed = rng.uniform(0, W), rng.uniform(-H, H), rng.choice((1.5, 2, 2.5, 3)), rng.uniform(.6, 1.2)
y = y0 + fall * H * speed
x = x0 + 14 * math.sin(y / 60 + x0)
if 0 <= y <= H:
d.ellipse((x - r, y - r, x + r, y + r), fill=(255, 255, 255, round(200 * a)))
def bat(canvas, t, start=.6, end=2.6):
if not start < t < end:
return
v = (t - start) / (end - start)
x, y = -60 + v * (W + 120), 260 - 120 * math.sin(v * math.pi)
place(canvas, scaled(b3.make_bat(math.sin(t * 22)), 2.2), x - 52, y - 44)
class Block:
def __init__(self, key, frames, title=None):
self.key, self.cfg, self.frames, self.title = key, BLOCKS[key], Path(frames) / ('cult' if key == 'themed' else key), title
self.points = json.loads((self.frames / 'points.json').read_text())
self.cache = {}
def scene(self, t):
n = min(MOVE, max(1, int(t * FPS) + 1))
if self.cache.get('n') != n:
self.cache['n'], self.cache['img'] = n, Image.open(self.frames / f'frame_{n:04d}.png').convert('RGBA')
return self.cache['img'].copy(), self.points[str(n)]
def frame(self, t):
canvas, pts = self.scene(t)
if self.key in TAKEOVERS:
self.takeover(canvas, pts, t)
elif self.key == 'themed':
self.themed(canvas, pts, t)
else:
self.premiere(canvas, pts, t)
out = Image.new('RGBA', (W, H), (0, 0, 0, 255))
out.alpha_composite(canvas)
return fade_in(out, t)
def takeover(self, canvas, pts, t):
s = pts['screen']
cx, cy = (s['left'] + s['right']) / 2, (s['top'] + s['bottom']) / 2
# The board sits on the cinema screen, covering the usual Drive-In picture; it lights up as the drapes open.
w = round(min(760, (s['right'] - s['left']) * .62)); h = round(w * .36)
lit = kf(t, [(1.0, 0), (2.6, 1)], ease_io)
key = ('board', round(lit * 60), w)
img = self.cache.get(key) or self.cache.setdefault(key, board(self.key, w, h, lit))
place(canvas, img, cx - w / 2, cy - h / 2 - 20)
if self.key == 'fright':
bat(canvas, t)
if self.key == 'christmas':
snow(canvas, t)
sprig = self.cache.get('holly') or self.cache.setdefault('holly', make_holly())
place(canvas, sprig, cx + w / 2 - 70, cy - h / 2 - 50, kf(t, [(2.4, 0), (2.8, 1)], ease_io))
def themed(self, canvas, pts, t):
"""Over the host event's ident (here Cult Classics' frames), the app's themed-night card snaps in at 2.6 s."""
cult = self.cache.get('cult')
if cult is None:
cult = dark.Block('cult', self.frames.parent)
self.cache['cult'] = cult
host = cult.frame(t)
canvas.paste(host, (0, 0))
if t < 2.55:
return
card = self.cache.get('card') or self.cache.setdefault('card', clapper_card(self.title or 'ROB ZOMBIE NIGHT'))
snap = kf(t, [(2.55, -14), (2.68, 0)], ease_in)
a = kf(t, [(2.55, 0), (2.65, 1)])
place(canvas, card, W - card.width - 60, H - card.height - 52 + kf(t, [(2.55, 16), (2.75, 0)], ease_out), a)
def premiere(self, canvas, pts, t):
# The Premiere logo lights up in the palace's own bulb-framed sign, following the sign as the camera glides in.
sign = pts['sign']
logo = self.cache.get('logo')
if logo is None:
logo = Image.open(DESIGNS / 'orbit-premiere' / 'exports' / 'orbit_premiere_primary.png').convert('RGBA')
logo = logo.crop(logo.getbbox()); self.cache['logo'] = logo
sw, sh = sign['right'] - sign['left'], sign['bottom'] - sign['top']
fit = scaled(logo, min(sw * .86 / logo.width, sh * .78 / logo.height))
a = kf(t, [(1.3, 0), (1.9, 1)], ease_io)
if a > 0:
halo = Image.new('RGBA', canvas.size); halo.alpha_composite(fit, (round(sign['left'] + (sw - fit.width) / 2), round(sign['top'] + (sh - fit.height) / 2)))
canvas.alpha_composite(fade(glow(halo, 10, 1.2), a * .7))
place(canvas, fit, sign['left'] + (sw - fit.width) / 2, sign['top'] + (sh - fit.height) / 2, a)
# Gentle sparkle along the canopy instead of camera flashes: small, slow, gone before the hold.
rng = random.Random(3)
d = ImageDraw.Draw(canvas)
door = pts['doors']
for i in range(26):
at = rng.uniform(.4, 2.8)
life = kf(t, [(at, 0), (at + .25, 1), (at + .6, 0)], ease_io)
if life > 0:
x, y, r = rng.uniform(door['left'] - 220, door['right'] + 220), rng.uniform(door['top'] - 140, door['top'] + 10), 2 + 3 * life
d.line((x - r * 2, y, x + r * 2, y), fill=(255, 240, 200, round(220 * life)), width=1)
d.line((x, y - r * 2, x, y + r * 2), fill=(255, 240, 200, round(220 * life)), width=1)
# Drawn by the app from the booking: the badge and the film's own title.
if self.title:
kind, film = self.title
a = kf(t, [(2.3, 0), (2.7, 1)], ease_io)
card = self.cache.get(('card', kind)) or self.cache.setdefault(('card', kind), premiere_card(kind, film))
place(canvas, card, 52, H - card.height - 46 + kf(t, [(2.3, 14), (2.7, 0)], ease_out), a)
def make_holly():
h = Image.new('RGBA', (140, 90))
d = ImageDraw.Draw(h)
for cx, cy, ang in ((48, 46, -25), (92, 46, 25)):
leaf = Image.new('RGBA', (90, 50)); ld = ImageDraw.Draw(leaf)
pts = [(5, 25)] + [(10 + i * 10, 25 + (-1) ** i * 18) for i in range(8)] + [(85, 25)] + [(80 - i * 10, 25 - (-1) ** i * 18 * .5) for i in range(8)]
ld.polygon(pts, fill=(30, 120, 50, 255))
h.alpha_composite(leaf.rotate(ang, Image.BICUBIC, expand=False), (cx - 45, cy - 25))
for x, y in ((64, 34), (76, 30), (70, 42)):
d.ellipse((x - 9, y - 9, x + 9, y + 9), fill=(214, 30, 40, 255)); d.ellipse((x - 4, y - 6, x, y - 2), fill=(255, 160, 160, 220))
return h
def clapper_card(name):
"""The themed-night card: a small clapperboard, a director's-chair outline and the booked theme's name."""
words = text_layer(name, font('anton-regular.ttf', 40), WHITE + (255,), 4)
w, h = max(words.width + 160, 420), 110
c = Image.new('RGBA', (w, h))
d = ImageDraw.Draw(c)
d.rounded_rectangle((0, 0, w - 1, h - 1), 10, fill=(10, 8, 16, 225))
# Clapper: a slate with a striped arm on top.
d.rectangle((20, 40, 100, 92), fill=(28, 28, 34, 255), outline=(220, 220, 228, 255), width=2)
for i in range(5):
d.polygon([(20 + i * 16, 24), (32 + i * 16, 24), (24 + i * 16, 38), (12 + i * 16, 38)], fill=(240, 240, 244, 255) if i % 2 == 0 else (28, 28, 34, 255))
d.line((20, 24, 100, 24), fill=(220, 220, 228, 255), width=2)
d.line((30, 56, 92, 56), fill=(120, 120, 130, 255), width=2); d.line((30, 72, 80, 72), fill=(120, 120, 130, 255), width=2)
small = text_layer('TONIGHT', font('barlow-semibold.ttf', 18), (232, 76, 203, 255), 4)
c.alpha_composite(small, (124, 18)); c.alpha_composite(words, (124, 18 + small.height + 8))
return c
def premiere_card(kind, film):
"""First Screening gets a red-and-gold PREMIERE ribbon; New Arrivals a simpler NEW ON ORBIT tag."""
first = kind == 'first'
label = text_layer('FIRST SCREENING ON ORBIT' if first else 'NEW ON ORBIT', font('barlow-semibold.ttf', 18), (255, 214, 120, 255) if first else (180, 220, 255, 255), 4)
title = text_layer(film, font('barlow-semibold.ttf', 34), WHITE + (255,), 1)
w, h = max(label.width, title.width) + (150 if first else 44), label.height + title.height + 30
c = Image.new('RGBA', (w, h))
d = ImageDraw.Draw(c)
d.rectangle((0, 0, w, h), fill=NAVY + (210,))
d.rectangle((0, 0, 5, h), fill=(214, 30, 40, 255) if first else (90, 170, 255, 255))
x0 = 22
if first:
d.polygon([(18, 12), (98, 12), (98, h - 12), (58, h - 24), (18, h - 12)], fill=(190, 20, 32, 255), outline=(240, 196, 90, 255))
star = text_layer('PREMIERE', font('anton-regular.ttf', 15), (255, 226, 150, 255), 1)
c.alpha_composite(star, (58 - star.width // 2, 20))
d.ellipse((46, 44, 70, 68), outline=(240, 196, 90, 255), width=3)
x0 = 120
c.alpha_composite(label, (x0, 10)); c.alpha_composite(title, (x0, 16 + label.height))
return c
# ---- Sound ----------------------------------------------------------------------------------------------------
RATE = riot.RATE
def creak(n_sec=.9, seed=51):
"""A slow wooden creak: a low, rough pitch that wanders, made from clicks at a varying rate."""
rng, n, out, ph = random.Random(seed), int(n_sec * RATE), [], 0.0
for i in range(n):
t = i / RATE
rate = 38 + 22 * math.sin(t * 4) + rng.uniform(-3, 3)
ph += rate / RATE
click = math.exp(-((ph % 1) * 40)) * rng.uniform(.6, 1)
out.append(click * riot.env(i, n, .1, .3))
return riot.onepole(out, .3)
def organ_note(f=73.4, n_sec=2.4):
n = int(n_sec * RATE)
return [sum(math.sin(2 * math.pi * f * k * i / RATE) / k for k in (1, 2, 3, 4, 6)) * riot.env(i, n, .4, .8) for i in range(n)]
def sleigh(n_sec=1.4, seed=52):
rng, n = random.Random(seed), int(n_sec * RATE)
out = [0.0] * n
for _ in range(40):
at = rng.randrange(n - 4000)
f = rng.choice((5200, 6100, 7300))
for i in range(3000):
out[at + i] += math.sin(2 * math.pi * f * i / RATE) * math.exp(-i / 500) * .4
return [s * riot.env(i, n, .05, .5) for i, s in enumerate(out)]
def arpeggio(notes, step=.11, n_each=.35):
total = int((len(notes) * step + n_each) * RATE)
out = [0.0] * total
for k, f in enumerate(notes):
start = int(k * step * RATE)
for i in range(int(n_each * RATE)):
t = i / RATE
out[start + i] += (math.sin(2 * math.pi * f * t) + .3 * math.sin(4 * math.pi * f * t)) * math.exp(-6 * t) * min(1, t / .003)
return out
def synth_chord(notes, n_sec=1.2):
n = int(n_sec * RATE)
return [sum(sum(math.sin(2 * math.pi * (f + d) * k * i / RATE) / k for k in (1, 2, 3)) for f in notes for d in (-.8, .8)) * riot.env(i, n, .01, .6) for i in range(n)]
def clank(seed=53):
n, out = int(.6 * RATE), []
for i in range(n):
t = i / RATE
out.append(sum(math.sin(2 * math.pi * f * t) * math.exp(-d * t) for f, d in ((311, 6), (523, 8), (887, 11), (1460, 15))) * min(1, t / .002))
return out
def snap():
rng, n = random.Random(54), int(.12 * RATE)
return [rng.uniform(-1, 1) * math.exp(-60 * i / RATE) + math.sin(2 * math.pi * 1800 * i / RATE) * math.exp(-80 * i / RATE) for i in range(n)]
SOUNDS = {
'fright': lambda: riot.mix(LENGTH, [(.7, creak(), .6), (1.2, organ_note(), .45)]),
'christmas': lambda: riot.mix(LENGTH, [(.8, sleigh(), .5), (2.2, b3.bell(784.0, 1.6), .45), (2.45, b3.bell(1046.5, 1.4), .35)]),
'drivfi': lambda: riot.mix(LENGTH, [(1.0, arpeggio([523.3, 659.3, 784.0, 1046.5, 1318.5, 1568.0, 2093.0]), .4), (1.0, b3.shimmer(1.6), .2)]),
'eighties': lambda: riot.mix(LENGTH, [(1.4, synth_chord([220.0, 277.2, 329.6, 440.0]), .4), (1.4, b3.gated_drum(55), .5)]),
'arnie': lambda: riot.mix(LENGTH, [(.8, clank(), .4), (1.47, clank(), .35), (2.0, riot.thump(.5, 60, 28, .5, 56), .6)]),
'themed': lambda: riot.mix(LENGTH, [(2.6, snap(), .7)]),
'premiere': lambda: riot.mix(LENGTH, [(.3, b4.pad_chord(3.3), .4), (.8, b3.shimmer(2.2), .2)]),
}
# ---- Build ----------------------------------------------------------------------------------------------------
def guide_card(key, d, stem):
card = Image.new('RGBA', (512, 160))
if key in TAKEOVERS:
img = board(key, 470, 150, 1)
card.alpha_composite(img, (21, 5))
else:
channel = BLOCKS[key]['channel']
epg = Image.open(DESIGNS / channel / 'exports' / f"{channel.replace('-', '_')}_epg.png").convert('RGBA')
epg = scaled(epg.crop(epg.getbbox()), .7)
card.alpha_composite(epg, (10, round((160 - epg.height) / 2)))
lines = [('THEMED', (232, 76, 203)), ('NIGHT', WHITE)] if key == 'themed' else [('FIRST', (255, 214, 120)), ('SCREENING', WHITE)]
y = 34
for i, (w, c) in enumerate(lines):
layer = scaled(text_layer(w, font('anton-regular.ttf', 34), c + (255,), 2), .95)
card.alpha_composite(layer, (316, y)); y += layer.height + 6
card.save(d / 'exports' / f'{stem}_guide.png')
card.resize((256, 80), Image.LANCZOS).save(d / 'exports' / f'{stem}_guide_app.webp', quality=90)
def build(key, frames):
cfg = BLOCKS[key]
d = HERE / cfg['folder']
for sub in ('exports', 'review'):
(d / sub).mkdir(parents=True, exist_ok=True)
stem = Path(cfg['folder']).name.replace('-', '_')
tmp = d / 'review' / '.frames'
report = dict(status='preview-not-integrated', template=cfg['title'], seconds=LENGTH, fps=FPS, size=[W, H], crf=riot.CRF)
sting = None
if key in SOUNDS:
sting = d / 'exports' / f'{stem}_sting.wav'
samples = SOUNDS[key]()
riot.write_wav(sting, samples)
m = riot.loudness(sting)
riot.write_wav(sting, samples, -14.0 + min(riot.STING_LUFS - m['integratedLufs'], riot.STING_PEAK - m['truePeakDbfs']))
if key == 'themed':
# No video of its own: it rides on the host event's ident. The preview shows Cult Classics with the card.
shown = b4.render(Block(key, frames, title='ROB ZOMBIE NIGHT'), tmp)
preview = d / 'review' / f'{stem}_preview_silent.mp4'
b4.encode(tmp, preview)
b4.with_sound(preview, sting, d / 'review' / f'{stem}_preview_with_sound.mp4')
shown[-1].save(d / 'review' / f'{stem}_final_still.png')
b4.sheet(shown, f"{cfg['title']} / the app's card over Cult Classics (no extra video)", d / 'review' / f'{stem}_contact_sheet.png')
clapper_card('ROB ZOMBIE NIGHT').save(d / 'exports' / 'themed_card_example.png')
report.update(extraVideoBytes=0, heldFrameStill=riot.hold_check(shown))
else:
base = b4.render(Block(key, frames), tmp)
silent = d / 'exports' / f'{stem}_ident.mp4'
b4.encode(tmp, silent)
report.update(identBytes=silent.stat().st_size, ssim=riot.ssim(silent, tmp), finalHoldStillForHalfSecond=riot.hold_check(base), flash=riot.flash_check(silent))
if key == 'premiere':
for kind, film in (('first', 'Dune: Part Two'), ('new', 'The Iron Giant')):
shown = b4.render(Block(key, frames, title=(kind, film)), tmp)
preview = d / 'review' / f'{stem}_{kind}_preview_silent.mp4'
b4.encode(tmp, preview)
b4.with_sound(preview, sting, d / 'review' / f'{stem}_{kind}_preview_with_sound.mp4')
shown[-1].save(d / 'review' / f'{stem}_{kind}_final_still.png')
report[f'heldFrameStill_{kind}'] = riot.hold_check(shown)
if kind == 'first':
b4.sheet(shown, f"{cfg['title']} / First Screening (badge and title drawn by the app)", d / 'review' / f'{stem}_contact_sheet.png')
base[-1].save(d / 'review' / f'{stem}_final_still_no_booking.png')
else:
base[-1].save(d / 'review' / f'{stem}_final_still.png')
shutil.copy(silent, d / 'review' / f'{stem}_preview_silent.mp4')
b4.with_sound(silent, sting, d / 'review' / f'{stem}_preview_with_sound.mp4')
b4.sheet(base, f"{cfg['title']} / Drive-In takeover preview, {LENGTH:.0f} s", d / 'review' / f'{stem}_contact_sheet.png')
if sting:
report['sting'] = riot.loudness(sting)
guide_card(key, d, stem)
shutil.rmtree(tmp, ignore_errors=True)
(d / 'review' / 'checks.json').write_text(json.dumps(report, indent=1))
print(json.dumps(report))
def review_board():
f = lambda s: font('barlow-semibold.ttf', s)
rows = [(BLOCKS[k]['title'], HERE / BLOCKS[k]['folder'] / 'review' / f"{Path(BLOCKS[k]['folder']).name.replace('-', '_')}_final_still.png") for k in TAKEOVERS]
rows += [('Themed night card (over Cult Classics)', HERE / BLOCKS['themed']['folder'] / 'review' / 'themed_night_final_still.png'),
('First Screening', HERE / BLOCKS['premiere']['folder'] / 'review' / 'premiere_first_final_still.png'),
('New Arrivals', HERE / BLOCKS['premiere']['folder'] / 'review' / 'premiere_new_final_still.png')]
rows = [r for r in rows if r[1].exists()]
b = Image.new('RGB', (1920, 90 + ((len(rows) + 2) // 3) * 410), NAVY)
d = ImageDraw.Draw(b)
d.text((30, 24), 'Batch 5 presentation templates: final hold frames (previews only)', font=f(36), fill='white')
for i, (title, still) in enumerate(rows):
x, y = 30 + (i % 3) * 630, 90 + (i // 3) * 410
b.paste(Image.open(still).resize((600, 338), Image.LANCZOS), (x, y + 40))
d.text((x, y), title, font=f(26), fill='white')
b.save(HERE / 'batch5_review.png')
if __name__ == '__main__':
frames = sys.argv[1]
for key in sys.argv[2:] or list(BLOCKS):
build(key, frames)
review_board()