1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-10 09:39:00 +00:00
trezor-firmware/ci/hardware_tests/record_video.sh
2024-02-20 19:49:41 +01:00

24 lines
675 B
Bash
Executable File

#!/usr/bin/env bash
if [ $# -ne 3 ]
then
echo "Usage: $0 video_dev commit_id [start|stop]"
fi
INPUTDEVICE=$1
COMMIT=$2
ACTION=$3
OUTPUTFILE=video_${COMMIT}_$(date +%s).mp4
if [ "$ACTION" == "start" ]; then
echo "[software/video] Starting record to $OUTPUTFILE"
ffmpeg -loglevel warning -f oss -f v4l2 -i $INPUTDEVICE \
-flush_packets 1 \
-vf "drawtext=font=Dejavu Sans: \
text='$COMMIT | %{localtime} | %{pts}': x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1: fontsize=15" $OUTPUTFILE &
export VPID=$!
elif [ "$ACTION" == "stop" ]; then
echo "[software/video] Stopping the recording of $OUTPUTFILE"
pkill ffmpeg
sync
fi