mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
initial motioneye setup: filter out non-camera v4l2 devices
This commit is contained in:
parent
cc2d0e0a57
commit
040df340cb
@ -92,14 +92,13 @@ start() {
|
|||||||
|
|
||||||
# add connected camera(s) with default settings
|
# add connected camera(s) with default settings
|
||||||
if responsive && ! [ -f $motion_conf ]; then
|
if responsive && ! [ -f $motion_conf ]; then
|
||||||
count=$(ls /dev/video* 2>/dev/null | wc -l)
|
|
||||||
index=1
|
index=1
|
||||||
for device in $(ls /dev/video* 2>/dev/null); do
|
for device in $(ls /dev/video* 2>/dev/null); do
|
||||||
if [ "$count" -gt "1" ]; then
|
# filter out devices that don't look like cameras
|
||||||
output_dir="/data/output/camera$index/"
|
if ! v4l2-ctl -d $device --list-formats-ext 2>/dev/null | grep -oE '[[:digit:]]+x[[:digit:]]+' &>/dev/null; then
|
||||||
else
|
continue
|
||||||
output_dir="/data/output/"
|
|
||||||
fi
|
fi
|
||||||
|
output_dir="/data/output/camera$index/"
|
||||||
loc="/config/add/?_username=admin"
|
loc="/config/add/?_username=admin"
|
||||||
device=$(find_persistent_device $device)
|
device=$(find_persistent_device $device)
|
||||||
body="{\"path\": \"$device\", \"proto\": \"v4l2\"}"
|
body="{\"path\": \"$device\", \"proto\": \"v4l2\"}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user