Files
openclaw/skills/video-frames/scripts/frame.sh
Jackal Xin 1dd3b52cb7 fix(skills): restore executable bit on bundled whisper script + release-time check (#41351)
* Enforce executable shell scripts in bundled skills

* fix: format CONTRIBUTING.md (oxfmt trailing whitespace)

* fix: skip shell script executable check on Windows

Windows does not support Unix permission bits — chmod is a no-op and
statSync().mode never reports execute bits.  Skip the runtime check
and the corresponding tests on win32.

* style: restore contributing formatting

* chore(ci): refresh detect-secrets baseline

* fix(skills): mark video-frames frame script executable

* fix: revert unrelated CI/secrets changes from whisper chmod PR

* chore(ci): retrigger full PR checks

* test: annotate executable-bit regression suite

* test(tts): mock resolveModelAsync in summarizeText tests

* test(whatsapp): make append history test use stale timestamp

* test(models): tolerate registry loader option expansion

* docs: add changelog for bundled skill executable fix

* fix(config): allow partial Codex web search location

* Drop unrelated formatting from PR 41351

* Fix bundled plugin bridge source expectation

* test: restore bundled plugin bridge npm expectation

---------

Co-authored-by: xaeon2026 <xaeon2026@gmail.com>
Co-authored-by: Jackal Xin <jackal092927@users.noreply.github.com>
Co-authored-by: xaeon2026 <xaeon2026@users.noreply.github.com>
2026-05-22 15:37:15 -07:00

82 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
usage() {
cat >&2 <<'EOF'
Usage:
frame.sh <video-file> [--time HH:MM:SS] [--index N] --out /path/to/frame.jpg
Examples:
frame.sh video.mp4 --out /tmp/frame.jpg
frame.sh video.mp4 --time 00:00:10 --out /tmp/frame-10s.jpg
frame.sh video.mp4 --index 0 --out /tmp/frame0.png
EOF
exit 2
}
if [[ "${1:-}" == "" || "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
usage
fi
in="${1:-}"
shift || true
time=""
index=""
out=""
while [[ $# -gt 0 ]]; do
case "$1" in
--time)
time="${2:-}"
shift 2
;;
--index)
index="${2:-}"
shift 2
;;
--out)
out="${2:-}"
shift 2
;;
*)
echo "Unknown arg: $1" >&2
usage
;;
esac
done
if [[ ! -f "$in" ]]; then
echo "File not found: $in" >&2
exit 1
fi
if [[ "$out" == "" ]]; then
echo "Missing --out" >&2
usage
fi
mkdir -p "$(dirname "$out")"
if [[ "$index" != "" ]]; then
ffmpeg -hide_banner -loglevel error -y \
-i "$in" \
-vf "select=eq(n\\,${index})" \
-vframes 1 \
"$out"
elif [[ "$time" != "" ]]; then
ffmpeg -hide_banner -loglevel error -y \
-ss "$time" \
-i "$in" \
-frames:v 1 \
"$out"
else
ffmpeg -hide_banner -loglevel error -y \
-i "$in" \
-vf "select=eq(n\\,0)" \
-vframes 1 \
"$out"
fi
echo "$out"