#!/bin/bash
set -eu
# Run from the directory containing the copied raw browser recordings.
render() {
 local side="$1" commit="$2" waiting="$3" done="$4" wake="$5"
 ffmpeg -y -hide_banner -loglevel error -i "${side}-raw.mp4" -an -vf "fps=10,crop=2560:1300:0:0,drawbox=x=1980:y=130:w=560:h=225:color=white:t=fill,drawbox=x=580:y=250:w=1050:h=1050:color=white:t=fill:enable='gte(t,${wake})',pad=2560:1440:0:0:white,drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:fontsize=30:fontcolor=black:x=40:y=1330:text='${side} ${commit} | Linux Chromium 1280x800 light | synthetic GitHub upstream',drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:fontsize=28:fontcolor=black:x=40:y=1380:text='A running - Slow running - required Done absent':enable='lt(t,${waiting})',drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:fontsize=28:fontcolor=black:x=40:y=1380:text='A passed - Slow running - required Done absent':enable='between(t,${waiting},${done})',drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:fontsize=28:fontcolor=black:x=40:y=1380:text='A passed - Slow passed - required Done passed':enable='gt(t,${done})',scale=1920:1080" -c:v libx264 -preset veryfast -crf 21 -movflags +faststart "${side}.mp4"
}
render before 04f6cfca87 36.61 171.68 156
render after fade1cf561 32.37 167.43 272
