Skip to content

Commit cc888fb

Browse files
committed
refactor(verify): output webm directly from VHS
- VHS tapes now output webm directly to verification/videos/cli/ - Remove intermediate GIF to MP4 conversion step - Stitched video now uses webm format - Fix stitching filter to handle different video dimensions - Simplify video file patterns to webm only
1 parent bc728c4 commit cc888fb

File tree

6 files changed

+24
-34
lines changed

6 files changed

+24
-34
lines changed

.justfiles/verify.just

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,8 @@ videos: init
118118
[[ -f "$tape" ]] || continue
119119
name=$(basename "$tape" .tape)
120120
echo " Recording: $name"
121-
122-
# Run VHS - outputs GIF to verification/output/
123-
vhs "$tape" 2>/dev/null || true
124-
125-
# Convert GIF to MP4
126-
gif_path="{{verify_dir}}/output/${name}.gif"
127-
if [[ -f "$gif_path" ]]; then
128-
ffmpeg -i "$gif_path" -movflags faststart -pix_fmt yuv420p -vf "fps=30" \
129-
"{{verify_dir}}/videos/cli/${name}.mp4" -y 2>/dev/null && \
130-
echo " Converted: ${name}.mp4"
131-
fi
121+
# VHS outputs webm directly to verification/videos/cli/
122+
vhs "$tape" 2>/dev/null && echo " Created: ${name}.webm" || true
132123
done
133124
fi
134125

@@ -159,18 +150,19 @@ videos: init
159150

160151
# Stitch CLI + Web videos together if both exist
161152
echo "Stitching videos..."
162-
cli_count=$(find {{verify_dir}}/videos/cli -name "*.mp4" 2>/dev/null | wc -l | tr -d ' ')
163-
web_count=$(find {{verify_dir}}/videos/web \( -name "*.webm" -o -name "*.mp4" \) 2>/dev/null | wc -l | tr -d ' ')
153+
cli_count=$(find {{verify_dir}}/videos/cli -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
154+
web_count=$(find {{verify_dir}}/videos/web -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
164155

165156
if [[ "$cli_count" -gt 0 ]] && [[ "$web_count" -gt 0 ]]; then
166-
cli_video=$(find {{verify_dir}}/videos/cli -name "*.mp4" | head -1)
167-
web_video=$(find {{verify_dir}}/videos/web \( -name "*.webm" -o -name "*.mp4" \) | head -1)
157+
cli_video=$(find {{verify_dir}}/videos/cli -name "*.webm" | head -1)
158+
web_video=$(find {{verify_dir}}/videos/web -name "*.webm" | head -1)
168159

169160
if [[ -n "$cli_video" ]] && [[ -n "$web_video" ]]; then
161+
# Scale both videos to same height (360p) with padding to maintain aspect ratio
170162
ffmpeg -i "$cli_video" -i "$web_video" \
171-
-filter_complex "[0:v]scale=640:-1[left];[1:v]scale=640:-1[right];[left][right]hstack=inputs=2" \
172-
{{verify_dir}}/videos/stitched/combined.mp4 -y 2>/dev/null && \
173-
echo "✓ Created stitched video: verification/videos/stitched/combined.mp4"
163+
-filter_complex "[0:v]scale=640:360:force_original_aspect_ratio=decrease,pad=640:360:(ow-iw)/2:(oh-ih)/2[left];[1:v]scale=640:360:force_original_aspect_ratio=decrease,pad=640:360:(ow-iw)/2:(oh-ih)/2[right];[left][right]hstack=inputs=2" \
164+
-c:v libvpx-vp9 {{verify_dir}}/videos/stitched/combined.webm -y 2>/dev/null && \
165+
echo "✓ Created stitched video: verification/videos/stitched/combined.webm"
174166
fi
175167
fi
176168

@@ -195,9 +187,9 @@ report: init
195187

196188
snapshot_count=$(find {{verify_dir}}/snapshots -name "*.png" 2>/dev/null | wc -l | tr -d ' ')
197189
checkpoint_count=$(find {{verify_dir}}/checkpoints -name "*.png" 2>/dev/null | wc -l | tr -d ' ')
198-
cli_video_count=$(find {{verify_dir}}/videos/cli -name "*.mp4" 2>/dev/null | wc -l | tr -d ' ')
199-
web_video_count=$(find {{verify_dir}}/videos/web \( -name "*.webm" -o -name "*.mp4" \) 2>/dev/null | wc -l | tr -d ' ')
200-
stitched_count=$(find {{verify_dir}}/videos/stitched -name "*.mp4" 2>/dev/null | wc -l | tr -d ' ')
190+
cli_video_count=$(find {{verify_dir}}/videos/cli -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
191+
web_video_count=$(find {{verify_dir}}/videos/web -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
192+
stitched_count=$(find {{verify_dir}}/videos/stitched -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
201193

202194
# Find related stories
203195
stories=""
@@ -260,21 +252,21 @@ report: init
260252
if [[ "$total_videos" -gt 0 ]]; then
261253
if [[ "$cli_video_count" -gt 0 ]]; then
262254
echo "**CLI:**" >> {{verify_dir}}/report.md
263-
find {{verify_dir}}/videos/cli -name "*.mp4" 2>/dev/null | while read -r f; do
255+
find {{verify_dir}}/videos/cli -name "*.webm" 2>/dev/null | while read -r f; do
264256
echo "- $(basename "$f")" >> {{verify_dir}}/report.md
265257
done
266258
fi
267259
if [[ "$web_video_count" -gt 0 ]]; then
268260
echo "" >> {{verify_dir}}/report.md
269261
echo "**Web:**" >> {{verify_dir}}/report.md
270-
find {{verify_dir}}/videos/web \( -name "*.webm" -o -name "*.mp4" \) 2>/dev/null | while read -r f; do
262+
find {{verify_dir}}/videos/web -name "*.webm" 2>/dev/null | while read -r f; do
271263
echo "- $(basename "$f")" >> {{verify_dir}}/report.md
272264
done
273265
fi
274266
if [[ "$stitched_count" -gt 0 ]]; then
275267
echo "" >> {{verify_dir}}/report.md
276268
echo "**Stitched:**" >> {{verify_dir}}/report.md
277-
find {{verify_dir}}/videos/stitched -name "*.mp4" 2>/dev/null | while read -r f; do
269+
find {{verify_dir}}/videos/stitched -name "*.webm" 2>/dev/null | while read -r f; do
278270
echo "- $(basename "$f")" >> {{verify_dir}}/report.md
279271
done
280272
fi
@@ -300,9 +292,9 @@ summary:
300292

301293
snapshot_count=$(find {{verify_dir}}/snapshots -name "*.png" 2>/dev/null | wc -l | tr -d ' ')
302294
checkpoint_count=$(find {{verify_dir}}/checkpoints -name "*.png" 2>/dev/null | wc -l | tr -d ' ')
303-
cli_video_count=$(find {{verify_dir}}/videos/cli -name "*.mp4" 2>/dev/null | wc -l | tr -d ' ')
304-
web_video_count=$(find {{verify_dir}}/videos/web \( -name "*.webm" -o -name "*.mp4" \) 2>/dev/null | wc -l | tr -d ' ')
305-
stitched_count=$(find {{verify_dir}}/videos/stitched -name "*.mp4" 2>/dev/null | wc -l | tr -d ' ')
295+
cli_video_count=$(find {{verify_dir}}/videos/cli -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
296+
web_video_count=$(find {{verify_dir}}/videos/web -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
297+
stitched_count=$(find {{verify_dir}}/videos/stitched -name "*.webm" 2>/dev/null | wc -l | tr -d ' ')
306298

307299
echo "Tier 1 - Snapshots: $snapshot_count"
308300
echo "Tier 2 - Checkpoints: $checkpoint_count"

verification/.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# Ignore all artifacts except config, tapes, and report
1+
# Ignore all artifacts except the report
22
*
33
!.gitignore
44
!report.md
55
!snapshots.json
66
!checkpoints.json
7-
!tapes/
8-
!tapes/*.tape

verification/report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Verification Report
22

3-
Generated: 2026-01-18T21:23:59-08:00
3+
Generated: 2026-01-18T21:36:44-08:00
44
Branch: main
55
Stories: (none detected)
66

verification/tapes/help.tape

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# VHS tape for vibes --help command
22
# https://github.com/charmbracelet/vhs
33

4-
Output verification/output/help.gif
4+
Output verification/videos/cli/help.webm
55

66
Set FontSize 14
77
Set Width 900

verification/tapes/sessions.tape

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# VHS tape for vibes sessions command
22
# https://github.com/charmbracelet/vhs
33

4-
Output verification/output/sessions.gif
4+
Output verification/videos/cli/sessions.webm
55

66
Set FontSize 14
77
Set Width 900

verification/tapes/version.tape

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# VHS tape for vibes --version command
22
# https://github.com/charmbracelet/vhs
33

4-
Output verification/output/version.gif
4+
Output verification/videos/cli/version.webm
55

66
Set FontSize 14
77
Set Width 600

0 commit comments

Comments
 (0)