#!/bin/zsh # VIDGOD smoke test — fast lanes only (beats, transcode, index, find). ~1-2 min. # Add --roto to also run the full SAM2+MatAnyone pipeline on a bundled demo clip (minutes). export PATH=/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin VG="$(cd "$(dirname "$0")/.." && pwd)" T="$VG/tests/smoke" mkdir -p "$T/oldstyle" fails=0 check(){ if [ $1 -eq 0 ]; then echo "PASS: $2"; else echo "FAIL: $2"; fails=$((fails+1)); fi } echo "== 1. vg-beats (synthetic 120bpm click) ==" "$VG/venvs/index/bin/python" - </dev/null 2>&1 [ -s "$T/click120.beats.edl" ] && grep -q "ResolveColor" "$T/click120.beats.edl" check $? "vg-beats produced marker EDL" echo "== 2. vg-transcode (fake xvid avi + wmv) ==" ffmpeg -hide_banner -loglevel error -y -f lavfi -i "testsrc=duration=4:size=640x480:rate=25" -c:v mpeg4 -vtag xvid -qscale:v 5 "$T/oldstyle/fake_xvid.avi" ffmpeg -hide_banner -loglevel error -y -f lavfi -i "smptebars=duration=4:size=640x480:rate=25" -f lavfi -i "sine=frequency=440:duration=4" -c:v wmv2 -c:a wmav2 "$T/oldstyle/fake_wmv.wmv" "$VG/bin/vg-transcode" "$T/oldstyle" >/dev/null 2>&1 [ -s "$T/oldstyle-prores/fake_xvid.mov" ] && [ -s "$T/oldstyle-prores/fake_wmv.mov" ] check $? "vg-transcode converted both to ProRes" echo "== 3. vg-index + vg-find (speech clip with a hard cut) ==" if command -v say >/dev/null; then say -o "$T/speech.aiff" "The radical robot destroyed the shopping mall. Totally awesome dude." ffmpeg -hide_banner -loglevel error -y -f lavfi -i "testsrc2=duration=2.5:size=640x360:rate=25" -f lavfi -i "smptebars=duration=2.5:size=640x360:rate=25" -i "$T/speech.aiff" -filter_complex "[0:v][1:v]concat=n=2:v=1[v]" -map "[v]" -map 2:a -c:v libx264 -crf 20 -c:a aac -shortest "$T/dialogue_test.mp4" "$VG/bin/vg-index" "$T/dialogue_test.mp4" --force >/dev/null 2>&1 "$VG/bin/vg-find" radical | grep -qi radical check $? "vg-index + vg-find round-trip (whisper heard 'radical')" else echo "SKIP: no 'say' binary for speech synthesis" fi if [ "${1:-}" = "--roto" ]; then echo "== 4. vg-roto (bundled demo clip, full SAM2+MatAnyone) ==" DEMO="$VG/tools/MatAnyone/inputs/video/test-sample3.mp4" ffmpeg -hide_banner -loglevel error -y -t 4 -i "$DEMO" -c:v libx264 -crf 12 -an "$T/roto_in.mp4" "$VG/bin/vg-roto" "$T/roto_in.mp4" --point 970,220 --point 1150,500 --out "$T/roto_out" [ -s "$T/roto_out/roto_in_alpha.mov" ] check $? "vg-roto produced ProRes 4444 alpha" fi echo if [ $fails -eq 0 ]; then echo "SMOKE TEST: all passed"; else echo "SMOKE TEST: $fails FAILED"; fi exit $fails