-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch-render.sh
More file actions
executable file
·44 lines (32 loc) · 972 Bytes
/
batch-render.sh
File metadata and controls
executable file
·44 lines (32 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Batch render CountryCompare videos from JSON props files
# Usage: ./batch-render.sh [props-dir]
# Each .json file in props/ becomes a separate video in out/
set -e
PROPS_DIR="${1:-props}"
OUT_DIR="out"
mkdir -p "$OUT_DIR"
echo "=== Batch Render: CountryCompare ==="
echo ""
count=0
total=$(ls "$PROPS_DIR"/*.json 2>/dev/null | wc -l | tr -d ' ')
if [ "$total" -eq 0 ]; then
echo "No .json files found in $PROPS_DIR/"
exit 1
fi
echo "Found $total props files in $PROPS_DIR/"
echo ""
for props_file in "$PROPS_DIR"/*.json; do
name=$(basename "$props_file" .json)
output="$OUT_DIR/$name.mp4"
count=$((count + 1))
echo "[$count/$total] Rendering: $name"
echo " Props: $props_file"
echo " Output: $output"
npx remotion render CountryCompare "$output" --props="$props_file" 2>&1 | tail -3
size=$(du -h "$output" | cut -f1)
echo " Done! ($size)"
echo ""
done
echo "=== All $total videos rendered! ==="
ls -lh "$OUT_DIR"/*.mp4