CreatBotCrowsnest/crowsnest
Stephan Wendel 95c1dca13f
feat!: adds camera-streamer to crowsnest
This introduces camera-streamer as streamer option
via `mode: multi`

camera-streamer is a feature packed stream service.
It is capable to deliver mjpg/snapshots/webrtc and rtsp

Limited to raspberry pi sbc's for now.

This should also resolv
Feature request #51
Feature request #37
Fixes #83
Closes #85
Fixes #89

BREAKING CHANGES:

Dropping support for Debian Buster based images and kernels older than
5.15y

Dropping RTSP support due aler9/simple-rtsp-server

Dropping usage of ffmpeg

No support anymore for Raspicam V1 (EOL)

Signed-off-by: Stephan Wendel <me@stephanwe.de>

Signed-off-by: Stephan Wendel <me@stephanwe.de>
2023-03-11 18:57:19 +01:00

81 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
#### Webcamd Core Application.
#### crowsnest - A webcam Service for multiple Cams and Stream Services.
####
#### Written by Stephan Wendel aka KwadFan <me@stephanwe.de>
#### Copyright 2021
#### https://github.com/mainsail-crew/crowsnest
####
#### This File is distributed under GPLv3
####
# shellcheck enable=require-variable-braces
# Exit upon Errors
set -Ee
# Base Path
BASE_CN_PATH="$(dirname "$(readlink -f "${0}")")"
## Import Librarys
# shellcheck source-path=SCRIPTDIR/../libs/
. "${BASE_CN_PATH}/libs/camera-streamer.sh"
. "${BASE_CN_PATH}/libs/configparser.sh"
. "${BASE_CN_PATH}/libs/core.sh"
. "${BASE_CN_PATH}/libs/hwhandler.sh"
. "${BASE_CN_PATH}/libs/init_stream.sh"
. "${BASE_CN_PATH}/libs/logging.sh"
. "${BASE_CN_PATH}/libs/messages.sh"
. "${BASE_CN_PATH}/libs/ustreamer.sh"
. "${BASE_CN_PATH}/libs/v4l2_control.sh"
. "${BASE_CN_PATH}/libs/versioncontrol.sh"
. "${BASE_CN_PATH}/libs/watchdog.sh"
#### MAIN
## Args given?
if [ "$#" -eq 0 ]; then
missing_args_msg
exit 1
fi
## Parse Args
while getopts ":vhc:d" arg; do
case "${arg}" in
v )
echo -e "\ncrowsnest Version: $(self_version)\n"
exit 0
;;
h )
help_msg
exit 0
;;
c )
check_cfg "${OPTARG}"
export CROWSNEST_CFG="${OPTARG}"
;;
d )
set -x
;;
\?)
wrong_args_msg
exit 1
;;
esac
done
init_logging
initial_check
construct_streamer
## Loop and Watchdog
## In this case watchdog acts more like a "cable defect detector"
## The User gets a message if Device is lost.
clean_watchdog
while true ; do
crowsnest_watchdog
sleep 120 & sleep_pid="$!"
wait "${sleep_pid}"
done