Files
org_roam/convert-mov.sh
Zaine 9a7a145390
Some checks failed
Build Roam Site / build (push) Has been cancelled
fix
2026-05-08 16:15:01 +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."