#!/usr/bin/env bash # MobileGL - tools/anland-mobilegl-plasma/scripts/rec.sh # Copyright (c) 2025-2026 MobileGL-Dev # Licensed under the GNU Lesser General Public License v3.0: # https://www.gnu.org/licenses/gpl-3.0.txt # https://www.gnu.org/licenses/lgpl-3.0.txt # SPDX-License-Identifier: LGPL-3.0-only # End of Source File Header # rec.sh - record 3 s of the screen while opening Kickoff, extract frames inside the container # with ffmpeg, pull them to $ANL_DIR/af_/ and build a 3x4 contact sheet $ANL_DIR/grid_.png # (needs Python + Pillow on Windows). Use it to catch flicker/black frames a single screenshot misses. # Env: TAP="x y" Kickoff button position (default "69 1349" = bottom-left on the 2560x1600 tablet; # device specific). Note: anland grabs the touchscreen (EVIOCGRAB); if `input tap` does nothing, use # `input mouse tap x y`. Env CHANNEL (default rec). set -euo pipefail here=$(cd "$(dirname "$0")" && pwd) . "$here/env.sh" N=${1:?usage: rec.sh }; TAP=${TAP:-69 1349} adb_ shell "su -c 'input keyevent 111; sleep 1.5; (screenrecord --time-limit 3 --bit-rate 20000000 $DEV_SHARE/$N.mp4 &); sleep 0.7; input tap $TAP; sleep 3; cp $DEV_SHARE/$N.mp4 $CT_ROOT/root/$N.mp4'" bash "$here/ct.sh" "${CHANNEL:-rec}" </dev/null python - "$ANL_DIR/af_$N" "$ANL_DIR/grid_$N.png" <<'P' import sys, os from PIL import Image d, out = sys.argv[1], sys.argv[2] fs = sorted(os.listdir(d)); n = len(fs) pick = [fs[min(n-1, int(i * n / 12))] for i in range(12)] ims = [Image.open(os.path.join(d, f)) for f in pick] w, h = ims[0].size; tw, th = w // 2, h // 2 g = Image.new('RGB', (tw * 3, th * 4)) for i, im in enumerate(ims): g.paste(im.resize((tw, th)), ((i % 3) * tw, (i // 3) * th)) g.save(out); print(n, pick) P