diff --git a/tools/clip/run.py b/tools/clip/run.py index 33c98a0213..12ac879baa 100755 --- a/tools/clip/run.py +++ b/tools/clip/run.py @@ -165,12 +165,16 @@ def clip(data_dir: str | None, quality: Literal['low', 'high'], prefix: str, rou # TODO: evaluate creating fn that inspects /tmp/.X11-unix and creates unused display to avoid possibility of collision display = f':{randint(99, 999)}' + box_style = 'box=1:boxcolor=black@0.33:boxborderw=7' meta_text = get_meta_text(route) overlays = [ - f"drawtext=text='{escape_ffmpeg_text(meta_text)}':fontfile=Inter.tff:fontcolor=white:fontsize=18:box=1:boxcolor=black@0.33:boxborderw=7:x=(w-text_w)/2:y=5.5:enable='between(t,1,5)'" + # metadata overlay + f"drawtext=text='{escape_ffmpeg_text(meta_text)}':fontfile=Inter.tff:fontcolor=white:fontsize=18:{box_style}:x=(w-text_w)/2:y=5.5:enable='between(t,1,5)'", + # route time overlay + f"drawtext=text='%{{eif\\:floor(({start}+t)/60)\\:d\\:2}}\\:%{{eif\\:mod({start}+t\\,60)\\:d\\:2}}':fontfile=Inter.tff:fontcolor=white:fontsize=24:{box_style}:x=w-text_w-38:y=38" ] if title: - overlays.append(f"drawtext=text='{escape_ffmpeg_text(title)}':fontfile=Inter.tff:fontcolor=white:fontsize=32:box=1:boxcolor=black@0.33:boxborderw=10:x=(w-text_w)/2:y=53") + overlays.append(f"drawtext=text='{escape_ffmpeg_text(title)}':fontfile=Inter.tff:fontcolor=white:fontsize=32:{box_style}:x=(w-text_w)/2:y=53") ffmpeg_cmd = [ 'ffmpeg', '-y', '-video_size', RESOLUTION, '-framerate', str(FRAMERATE), '-f', 'x11grab', '-draw_mouse', '0',