mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
update installer for rpicam-vid
This commit is contained in:
@@ -18,11 +18,21 @@ VIDEO_HEIGHT="${VIDEO_HEIGHT:-720}"
|
|||||||
VIDEO_FPS="${VIDEO_FPS:-30}"
|
VIDEO_FPS="${VIDEO_FPS:-30}"
|
||||||
VIDEO_BITRATE="${VIDEO_BITRATE:-3000000}"
|
VIDEO_BITRATE="${VIDEO_BITRATE:-3000000}"
|
||||||
|
|
||||||
LIBCAMERA_BIN="${LIBCAMERA_BIN:-/usr/bin/libcamera-vid}"
|
|
||||||
FFMPEG_BIN="${FFMPEG_BIN:-/usr/bin/ffmpeg}"
|
FFMPEG_BIN="${FFMPEG_BIN:-/usr/bin/ffmpeg}"
|
||||||
|
|
||||||
if [[ ! -x "$LIBCAMERA_BIN" ]]; then
|
if [[ -n "${LIBCAMERA_BIN:-}" ]]; then
|
||||||
echo "libcamera-vid not found at ${LIBCAMERA_BIN}" >&2
|
LIBCAMERA_BIN_PATH="$LIBCAMERA_BIN"
|
||||||
|
elif command -v rpicam-vid >/dev/null 2>&1; then
|
||||||
|
LIBCAMERA_BIN_PATH="$(command -v rpicam-vid)"
|
||||||
|
elif command -v libcamera-vid >/dev/null 2>&1; then
|
||||||
|
LIBCAMERA_BIN_PATH="$(command -v libcamera-vid)"
|
||||||
|
else
|
||||||
|
echo "Neither rpicam-vid nor libcamera-vid found; install the libcamera apps." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -x "$LIBCAMERA_BIN_PATH" ]]; then
|
||||||
|
echo "Video capture binary not executable at ${LIBCAMERA_BIN_PATH}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ ! -x "$FFMPEG_BIN" ]]; then
|
if [[ ! -x "$FFMPEG_BIN" ]]; then
|
||||||
@@ -31,7 +41,7 @@ if [[ ! -x "$FFMPEG_BIN" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
run_pipeline() {
|
run_pipeline() {
|
||||||
"${LIBCAMERA_BIN}" \
|
"${LIBCAMERA_BIN_PATH}" \
|
||||||
--inline \
|
--inline \
|
||||||
--timeout 0 \
|
--timeout 0 \
|
||||||
--width "${VIDEO_WIDTH}" \
|
--width "${VIDEO_WIDTH}" \
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ log() {
|
|||||||
echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*"
|
echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! command -v libcamera-vid >/dev/null 2>&1; then
|
if ! command -v rpicam-vid >/dev/null 2>&1 && ! command -v libcamera-vid >/dev/null 2>&1; then
|
||||||
log "WARNING: libcamera-vid not found in PATH; install libcamera-utils for video publishing"
|
log "WARNING: neither rpicam-vid nor libcamera-vid found in PATH; install the Raspberry Pi libcamera apps (sudo apt install libcamera-apps)."
|
||||||
fi
|
fi
|
||||||
if ! command -v ffmpeg >/dev/null 2>&1; then
|
if ! command -v ffmpeg >/dev/null 2>&1; then
|
||||||
log "WARNING: ffmpeg not found in PATH; install ffmpeg for WHIP publishing"
|
log "WARNING: ffmpeg not found in PATH; install ffmpeg for WHIP publishing"
|
||||||
|
|||||||
Reference in New Issue
Block a user