#!/bin/zsh # realtest.sh : real 1080p30 encode in the background while mtprobe drives Dante Virtual Soundcard cd ~/live-room-audio-fix-2026-10-07/probe C=$1 case $C in none) ENC=(-c:v rawvideo) ;; x264) ENC=(-c:v libx264 -preset veryfast -crf 23 -profile:v high) ;; vt) ENC=(-c:v h264_videotoolbox -b:v 10M -realtime 1) ;; x264noise) ENC=(-vf noise=alls=30:allf=t -c:v libx264 -preset veryfast -crf 23 -profile:v high) ;; esac ./ffmpeg -hide_banner -loglevel error -re -f lavfi -i testsrc2=size=1920x1080:rate=30 -pix_fmt yuv420p $ENC -t 200 -f null - & FF=$! sleep 5 for fr in 64 256; do ./mtprobe "Dante Virtual Soundcard" $fr 45 4 0.60 1 | sed "s/^/ENC=$C /" & P=$! sleep 20 echo "ENC=$C cpu_sample ffmpeg=$(ps -o pcpu= -p $FF) mediaanalysisd=$(ps -Ao pcpu,comm | grep -m1 mediaanalysisd$ | awk "{print \$1}") load=$(sysctl -n vm.loadavg)" wait $P done kill $FF 2>/dev/null; wait $FF 2>/dev/null