Below is a script that can be used to convert all files in the directory to AV1

#!/bin/bash

set -e

find * -type f -iname '*.mkv' | grep -v av1 | while read -r mkv; do
 file=${mkv%.*}
 av1="${file}-av1.mkv"
 if [ -f "${av1}" ]; then
  echo "${av1} already there"
#  echo "${file} -> ${av1}"
 else
  echo "converting ${file} --> ${av1}"
  ffmpeg -i "${mkv}" -c:v libsvtav1 -crf 35 "${av1}"  < /dev/null && echo "${av1}" >> completed.txt
 fi
done

With ffmpeg it takes stdin as well so you need to include the < /dev/null to the end of the loop otherwise it will fail with random errors.