Files
FishServer/record.sh

25 lines
849 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# ZED 录制统一入口。
# 用法(在仓库根目录):
# ./record.sh # 本地前台录制Ctrl+C 停止
# ./record.sh --remote # HTTP 请求已运行的 fish_api 启录
# ./record.sh --stop # HTTP 停止录制
# ./record.sh --status # HTTP 查询录制状态
2026-04-16 16:28:33 +08:00
# ./record.sh --segment-sec 30 # 自定义分段时长(默认见 .env ZED_SVO_SEGMENT_SEC
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT/fish_api"
PY="${PYTHON:-python3.8}"
# Translate convenience flags into subcommands
for arg in "$@"; do
case "$arg" in
--stop) shift; exec "$PY" -m app.zed_record_cli stop "$@" ;;
--status) shift; exec "$PY" -m app.zed_record_cli status "$@" ;;
esac
done
exec "$PY" -m app.zed_record_cli start "$@"