Files
org_roam/convert-mov.sh
Zaine e2e4972123
All checks were successful
Build Roam Site / build (push) Successful in 28s
gitea runners
2026-05-06 15:26:35 +01:00

27 lines
725 B
Bash
Executable File

#!/usr/bin/env bash
# convert-mov.sh
# Run this after org-publish to convert any .mov files in the output assets
# to .mp4 so browsers can play them natively.
#
# Usage: ./convert-mov.sh
# Or add to your publish pipeline: make publish && ./convert-mov.sh
ASSETS_DIR="${1:-/home/zaine/master-folder/org_files/org_roam/output/assets}"
find "$ASSETS_DIR" -type f -iname "*.mov" | while read -r mov; do
mp4="${mov%.*}.mp4"
if [ -f "$mp4" ]; then
echo "[skip] $mp4 already exists"
continue
fi
echo "[convert] $mov$mp4"
ffmpeg -i "$mov" \
-c:v libx264 -preset fast -crf 23 \
-c:a aac -b:a 128k \
-movflags +faststart \
-y "$mp4" 2>&1 | tail -1
echo "[done] $mp4"
done
echo "All done."