Skip to content

Commit b55ff45

Browse files
committed
Initial Commit
Signed-off-by: Stephan Wendel <[email protected]>
0 parents  commit b55ff45

17 files changed

+2286
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Ignore ustreamer static for now.
2+
ustreamer-www/
3+
4+
#Ignore ERRORS.txt
5+
ERRORS.txt
6+
7+
# Ignore leftover
8+
leftover*
9+
10+
#Ignore Test Files
11+
test*
12+

LICENSE

+674
Large diffs are not rendered by default.

README.md

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# crowsnest
2+
3+
A webcam daemon for Raspi Lite images like mainsailOS
4+
5+
---
6+
7+
It inherited his name from Sail ships Crow's nest.
8+
---
9+
> A crow's nest is a structure in the upper part of the main mast of a ship or a structure that is used as a lookout point.\
10+
See https://en.wikipedia.org/wiki/Crow's_nest
11+
12+
So, this will be the 'lookout point' for your Printer.
13+
14+
### Install on MainsailOS 0.5.0 as update
15+
cd ~
16+
git clone https://github.com/mainsail-crew/crowsnest.git
17+
cd webcamtest
18+
./installer_ms050.sh
19+
20+
An installer for other Distribution than MainsailOS will come.
21+
Give me some time to prepare!
22+
23+
_NOTE: This project has WIP Status! Changes may occure and possibly break things!_
24+
---
25+
26+
---
27+
28+
## Simple Configuration
29+
---
30+
31+
All you need to get your Camera up and running is a small block of code in your _webcam.conf_\
32+
In MainsailOS you can do that in mainsail Web Interface.\
33+
Open the 'config' section, there should be the mentioned file.
34+
35+
By default it look like this:
36+
37+
[webcamd]
38+
log_path: ~/klipper_logs/webcamd.log
39+
debug_log: false
40+
41+
[cam 1]
42+
streamer: mjpg
43+
port: 8080
44+
device: /dev/video0
45+
resolution: 640x480
46+
max_fps: 15
47+
48+
What that basicly means is:
49+
50+
log_path: ~/klipper_logs/webcamd.log
51+
52+
Where crowsnest (webcamd) should store its Logfile.
53+
54+
debug_log: false
55+
56+
You can set this to true or false.\
57+
In case of true you get an more verbose output in the log file.
58+
Useful to DEBUG your setup.
59+
60+
Now the more interessting part.
61+
62+
[cam 1]
63+
streamer: mjpg
64+
port: 8080
65+
device: /dev/video0
66+
resolution: 640x480
67+
max_fps: 15
68+
69+
> _Note: You can name the cam, how you want!_\
70+
_ex.: [cam raspicam]_
71+
72+
---
73+
74+
This section should be pretty much self explantory.
75+
76+
streamer: mjpg
77+
78+
means your choosen streamservice will be mjpg_streamer.\
79+
You can choose:
80+
- mjpg - well known [Jacksonliam's mjpg-streamer-experimental](https://github.com/jacksonliam/mjpg-streamer)
81+
82+
- ustreamer - A streamserver from Pi-KVM Project\
83+
active maintained by [Maxim Devaev](https://github.com/mdevaev)\
84+
[ustreamer on github](https://github.com/pikvm/ustreamer)
85+
86+
- rtsp - v4l2rtspserver with Multiprotocol Support\
87+
active maintained by [Michel Promonet](https://github.com/mpromonet) \
88+
[v4l2rtspserver on github](https://github.com/mpromonet/v4l2rtspserver)
89+
90+
More Services will come in the (hopefully, near) future.
91+
92+
---
93+
94+
port: 8080
95+
96+
The port where the choosen service will listen on\
97+
**_NOTE: If you choose 'rtsp' use Port 8554!_**
98+
99+
**_NOTE: Ports 8080 - 8084 are covered by nginx reverse proxy! \
100+
According to that 8080 will be /webcam, port 8081 will be /webcam1 and so on._**
101+
102+
---
103+
104+
device: /dev/video0
105+
106+
The Videodevice (Camera) what should be used by choosen Streamservice.
107+
108+
device: /dev/v4l/by-id/usb-PixArt_Imaging_Inc._USB2.0_Camera-video-index0
109+
110+
is also valid. Your devices are listed in your log-file on every run.\
111+
So, you can easily copy it from there.
112+
113+
---
114+
115+
resolution: 640x480
116+
max_fps: 15
117+
118+
This last 2 should be pretty obvious :)
119+
120+
---
121+
122+
There are two more existing parameters,
123+
124+
log_method: debug
125+
126+
**This parameter _has_ to reside under [webcamd] section!**
127+
128+
This forces webcamd to spit out more camera informations.\
129+
Like that:
130+
131+
[10/24/21 02:46:00] webcamd: INFO: Detect available Cameras
132+
[10/24/21 02:46:00] webcamd: INFO: Found 1 available Camera(s)
133+
[10/24/21 02:46:00] webcamd: Detected 'Raspicam' Device -> /dev/video0
134+
[10/24/21 02:46:00] webcamd: Supported Formats:
135+
[10/24/21 02:46:00] webcamd: [0]: 'YU12' (Planar YUV 4:2:0)
136+
[10/24/21 02:46:01] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
137+
[10/24/21 02:46:01] webcamd: [1]: 'YUYV' (YUYV 4:2:2)
138+
[10/24/21 02:46:01] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
139+
[10/24/21 02:46:01] webcamd: [2]: 'RGB3' (24-bit RGB 8-8-8)
140+
[10/24/21 02:46:01] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
141+
[10/24/21 02:46:01] webcamd: [3]: 'JPEG' (JFIF JPEG, compressed)
142+
[10/24/21 02:46:01] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
143+
[10/24/21 02:46:01] webcamd: [4]: 'H264' (H.264, compressed)
144+
[10/24/21 02:46:01] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
145+
[10/24/21 02:46:02] webcamd: [5]: 'MJPG' (Motion-JPEG, compressed)
146+
[10/24/21 02:46:02] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
147+
[10/24/21 02:46:02] webcamd: [6]: 'YVYU' (YVYU 4:2:2)
148+
[10/24/21 02:46:02] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
149+
[10/24/21 02:46:02] webcamd: [7]: 'VYUY' (VYUY 4:2:2)
150+
[10/24/21 02:46:02] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
151+
[10/24/21 02:46:02] webcamd: [8]: 'UYVY' (UYVY 4:2:2)
152+
[10/24/21 02:46:02] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
153+
[10/24/21 02:46:02] webcamd: [9]: 'NV12' (Y/CbCr 4:2:0)
154+
[10/24/21 02:46:03] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
155+
[10/24/21 02:46:03] webcamd: [10]: 'BGR3' (24-bit BGR 8-8-8)
156+
[10/24/21 02:46:03] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
157+
[10/24/21 02:46:03] webcamd: [11]: 'YV12' (Planar YVU 4:2:0)
158+
[10/24/21 02:46:03] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
159+
[10/24/21 02:46:03] webcamd: [12]: 'NV21' (Y/CrCb 4:2:0)
160+
[10/24/21 02:46:03] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
161+
[10/24/21 02:46:03] webcamd: [13]: 'RX24' (32-bit XBGR 8-8-8-8)
162+
[10/24/21 02:46:03] webcamd: Size: Stepwise 32x32 - 2592x1944 with step 2/2
163+
164+
This is useful to determine what the Hardware Encoder of your Camera is capable of.\
165+
In this case a "cheap" raspicam for about 7€ was used.\
166+
But it has a downside, everytime you restart webcamd, it will delete the Logfile!
167+
So, truly made for Debugging purposes.
168+
169+
---
170+
171+
As the last option and the most tricky one:
172+
173+
custom_flags:
174+
175+
If you enable this in your [cam whatevernameyouset],\
176+
you gain the full control over your choosen streamservice.\
177+
This option is for more Advanced Users.
178+
179+
To setup Services to your need you have to take a closer look to the documentation of the Projects named above.\
180+
As a pointer in the right direction:
181+
182+
- mjpg
183+
- This one is a bit more complex due the fact it depends on your cam type.
184+
- For 'Raspicam' see [Plugin: input_raspicam](https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_raspicam/README.md)
185+
- For USB Type Cams see [Plugin: input_uvc](https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_uvc/README.md)
186+
- For the output is ,in this case, only used [Plugin: output_http](https://github.com/jacksonliam/mjpg-streamer/tree/master/mjpg-streamer-experimental/plugins/output_http)
187+
188+
- ustreamer
189+
- For sake of simplicity I converted ustreamers manpage to
190+
[ustreamer's manpage](./ustreamer_manpage.md)
191+
192+
193+
If you use custom_flags, we try to help you out but it is really a feature for Advanced Users and your a kind of on your own.
194+
195+
So, with all that said, get your position seaman! Prepare to get wet feets on your Journey.\
196+
ARRRR yooo rrready to sail?

custompios/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Crow's Nest
2+
A multiple Cam and Stream Service for mainsailOS
3+
4+
# Developer Documentation
5+
6+
The folder 'crowsnest' is made to add to your existing CustomPIOS Structure.
7+
8+
Please take a closer look to the 'config' File and set it up to your specific needs.
9+
This is pretty much self explantory.
10+
11+
At least you have to configure:
12+
13+
CROWSNEST_DEFAULT_CONF="mainsail_default.conf"
14+
This takes a conf file from the 'sample_configs' called mainsail_default.conf
15+
and put it to
16+
17+
CROWSNEST_DEFAULT_CONF_DIR="/home/${BASE_USER}/klipper_config"
18+
the folder you configured above.\
19+
Please feel free to Pull Request your config!
20+
I will add them.
21+
22+
Last but not least:
23+
24+
CROWSNEST_MOONRAKER_SUPPORT="y"
25+
this will tell the module to add the content of moonraker_update.txt to your
26+
moonraker.conf\
27+
_Please take note, that moonraker.conf has to be in your CROWSNEST_DEFAULT_CONF_DIR !_
28+
29+
Finally add crowsnest to your config!
30+
As example:
31+
32+
export MODULES="base(network,(klipper,moonraker,mainsail,crowsnest))"
33+
34+
Make sure it is barely the last one, because it mangles cmake quiet often
35+
unfortunatly.\
36+
This isn't my fault, more the "pickynese" behavior of
37+
mjpg-streamer and v4l2rtspserver :)

custompios/crowsnest/config

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[ -n "$CROWSNEST_CROWSNEST_REPO_SHIP" ] || CROWSNEST_CROWSNEST_REPO_SHIP=https://github.com/mainsail-crew/crowsnest.git
2+
[ -n "$CROWSNEST_CROWSNEST_REPO_BRANCH" ] || CROWSNEST_CROWSNEST_REPO_BRANCH=main
3+
[ -n "$CROWSNEST_CROWSNEST_DEPS" ] || CROWSNEST_DEPS="git crudini"
4+
[ -n "$CROWSNEST_DEFAULT_CONF" ] || CROWSNEST_DEFAULT_CONF="mainsail_default.conf"
5+
[ -n "$CROWSNEST_DEFAULT_CONF_DIR" ] || CROWSNEST_DEFAULT_CONF_DIR="/home/${BASE_USER}/klipper_config"
6+
[ -n "$CROWSNEST_MOONRAKER_SUPPORT" ] || CROWSNEST_MOONRAKER_SUPPORT="y"
7+
8+
# mjpg-streamer
9+
[ -n "$CROWSNEST_MJPG_REPO_SHIP" ] || CROWSNEST_MJPG_REPO_SHIP=https://github.com/jacksonliam/mjpg-streamer.git
10+
[ -n "$CROWSNEST_MJPG_REPO_BRANCH" ] || CROWSNEST_MJPG_REPO_BRANCH=master
11+
[ -n "$CROWSNEST_MJPG_REPO_DEPTH" ] || CROWSNEST_MJPG_REPO_DEPTH=1
12+
[ -n "$CROWSNEST_MJPG_DEPS" ] || CROWSNEST_MJPG_DEPS="git build-essential libv4l-dev imagemagick ffmpeg"
13+
14+
# ustreamer
15+
[ -n "$CROWSNEST_USTREAMER_REPO_SHIP" ] || CROWSNEST_USTREAMER_REPO_SHIP=https://github.com/pikvm/ustreamer.git
16+
[ -n "$CROWSNEST_USTREAMER_REPO_BRANCH" ] || CROWSNEST_USTREAMER_REPO_BRANCH=master
17+
[ -n "$CROWSNEST_USTREAMER_REPO_DEPTH" ] || CROWSNEST_USTREAMER_REPO_DEPTH=1
18+
[ -n "$CROWSNEST_USTREAMER_DEPS" ] || CROWSNEST_USTREAMER_DEPS="git build-essential libevent-dev libjpeg8-dev \
19+
libbsd-dev libraspberrypi-dev libgpiod-dev cmake cmake-data"
20+
[ -n "$CROWSNEST_USTREAMER_WITH_OMX" ] || CROWSNEST_USTREAMER_WITH_OMX="y"
21+
[ -n "$CROWSNEST_USTREAMER_WITH_GPIO" ] || CROWSNEST_USTREAMER_WITH_GPIO="n"
22+
23+
# v4l2rtspserver
24+
[ -n "$CROWSNEST_V4L2RTSP_REPO_SHIP" ] || CROWSNEST_V4L2RTSP_REPO_SHIP=https://github.com/mpromonet/v4l2rtspserver.git
25+
[ -n "$CROWSNEST_V4L2RTSP_REPO_BRANCH" ] || CROWSNEST_V4L2RTSP_REPO_BRANCH=master
26+
[ -n "$CROWSNEST_V4L2RTSP_DEPS" ] || CROWSNEST_V4L2RTSP_DEPS="git build-essential liblivemedia-dev liblog4cpp5-dev"

0 commit comments

Comments
 (0)