Webcam-Howto-2023: Unterschied zwischen den Versionen
K |
|||
(9 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 7: | Zeile 7: | ||
Pakete auf dem Router installieren | Pakete auf dem Router installieren | ||
− | 1) Freifunk Firmware openwrt- 21.02.6-9 Release ab 217 installieren. | + | * 1) Freifunk Firmware openwrt- 21.02.6-9 Release ab 217 installieren. |
+ | * 2) opkg update ausführen | ||
+ | * 3) opkg install kmod-video-uvc | ||
+ | * 4) opkg install mjpg-streamer | ||
+ | * 5) opkg install mjpg-streamer-input-uvc | ||
+ | * 6) opkg install mjpg-streamer-output-http | ||
+ | * | ||
+ | * 7) /www/webcam/index.html erstellen<sup>:</sup> | ||
+ | <syntaxhighlight lang="arrow"> | ||
+ | <html> | ||
+ | <head> | ||
+ | <title>MJPG-Streamer - Stream Example</title> | ||
+ | </head> | ||
+ | <body> | ||
+ | <center> | ||
+ | <img src="http://10.63.115.1:8080?action=stream" /> | ||
+ | </center> | ||
+ | </body> | ||
+ | </html> | ||
+ | </syntaxhighlight> | ||
+ | Anstelle 10.63.115.1 muss natürlich die ip-Adresse des Routers eingetragen werden! | ||
+ | |||
+ | ===Konfiguration anpassen=== | ||
+ | Die config-datei befindet sich in /etc/config/mjpg-streamer<syntaxhighlight lang="arrow"> | ||
+ | config mjpg-streamer 'core' | ||
+ | option enabled '1' | ||
+ | option input 'uvc' | ||
+ | option output 'http' | ||
+ | option device '/dev/video0' | ||
+ | option resolution '1024x768' | ||
+ | option yuv '0' | ||
+ | option quality '80' | ||
+ | option fps '5' | ||
+ | option led 'auto' | ||
+ | option www '/www/webcam' | ||
+ | option port '8080' | ||
+ | #option listen_ip '192.168.1.1' | ||
+ | #option username 'openwrt' | ||
+ | #option password 'openwrt' | ||
+ | </syntaxhighlight>Der streamer wird gestartet mit | ||
+ | |||
+ | /etc/init.d/mjpg-streamer start | ||
+ | |||
+ | Danach ist der stream im Browser zusehen: | ||
− | + | [http://10.63.nnn.1/webcam http://10.63.115.1/webcam] | |
− | + | Auch hier muß natürlich die Adresse des Routers anstelle von 10.63.115.1 eingetragen werden. | |
− | + | Weitere Informationen gibt es unter: | |
− | + | https://openwrt.org/docs/guide-user/hardware/video/webcam | |
− | + | === Als Dienst im Weimarnetz sichtbar machen === | |
+ | https://weimarnetz.de/services-monitoring/services | ||
− | |||
− | < | + | uci del ffwizard.olsr.'''service''' |
+ | |||
+ | uci add_list ffwizard.olsr.service=''''<nowiki>http://10.63.115.1:80/webcam/|tcp|Webcam</nowiki> von Christfried'''' | ||
− | |||
− | + | oder auf der WebSite des Routers unter | |
− | + | Administration --> Weimarnetz --> Einstellungen --> OLSR | |
− | + | === Script zur Installation === | |
+ | <blockquote><syntaxhighlight lang="shell"> | ||
+ | #!/bin/sh | ||
− | + | # rev 0.3 by R.Hoffmann @20240206 | |
− | + | opkg update | |
+ | opkg install kmod-video-uvc | ||
+ | opkg install mjpg-streamer | ||
+ | opkg install mjpg-streamer-input-uvc | ||
+ | opkg install mjpg-streamer-output-http | ||
− | + | mkdir -p /www/webcam/ | |
− | + | IP=$(/sbin/uci get network.lan.ipaddr) | |
+ | HOSTNAME=$(/sbin/uci get ffwizard.settings.hostname) | ||
+ | cat <<EOF >/www/webcam/index.html | ||
+ | <html> | ||
+ | <head> | ||
+ | <title>Webcam auf ${HOSTNAME}</title> | ||
+ | </head> | ||
+ | <body> | ||
+ | <center> | ||
+ | <img src="http://${IP}:8080?action=stream" /> | ||
+ | </center> | ||
+ | </body> | ||
</html> | </html> | ||
+ | EOF | ||
− | + | cat <<EOF >/etc/config/mjpg-streamer | |
− | < | + | config mjpg-streamer 'core' |
+ | option enabled '1' | ||
+ | option input 'uvc' | ||
+ | option output 'http' | ||
+ | option device '/dev/video0' | ||
+ | option resolution '1024x768' | ||
+ | option yuv '0' | ||
+ | option quality '80' | ||
+ | option fps '5' | ||
+ | option led 'auto' | ||
+ | option www '/www/webcam' | ||
+ | option port '8080' | ||
+ | #option listen_ip '192.168.1.1' | ||
+ | #option username 'openwrt' | ||
+ | #option password 'openwrt' | ||
+ | EOF | ||
− | + | /etc/init.d/mjpg-streamer start | |
+ | echo -e "\n\nto register your new service call:\n\t/sbin/uci add_list ffwizard.olsr.service='http://${IP}:80/webcam/|tcp|Webcam auf ${HOSTNAME}'" | ||
+ | </syntaxhighlight> | ||
</blockquote> | </blockquote> | ||
[[Kategorie:Howto]] | [[Kategorie:Howto]] |
Aktuelle Version vom 6. Februar 2024, 22:06 Uhr
An einem FreifunkRouter mit USB-Interface soll eine USB-Web-Cam angeschlossen werden.
Der Video-Stream soll im Freifunk-Netz als Dienst bereitgestellt werden.
Geeigneter Router: TP-Link TL-WR902AC v3.
Ablauf der Installation
Pakete auf dem Router installieren
- 1) Freifunk Firmware openwrt- 21.02.6-9 Release ab 217 installieren.
- 2) opkg update ausführen
- 3) opkg install kmod-video-uvc
- 4) opkg install mjpg-streamer
- 5) opkg install mjpg-streamer-input-uvc
- 6) opkg install mjpg-streamer-output-http
- 7) /www/webcam/index.html erstellen:
<html>
<head>
<title>MJPG-Streamer - Stream Example</title>
</head>
<body>
<center>
<img src="http://10.63.115.1:8080?action=stream" />
</center>
</body>
</html>
Anstelle 10.63.115.1 muss natürlich die ip-Adresse des Routers eingetragen werden!
Konfiguration anpassen
Die config-datei befindet sich in /etc/config/mjpg-streamer
config mjpg-streamer 'core'
option enabled '1'
option input 'uvc'
option output 'http'
option device '/dev/video0'
option resolution '1024x768'
option yuv '0'
option quality '80'
option fps '5'
option led 'auto'
option www '/www/webcam'
option port '8080'
#option listen_ip '192.168.1.1'
#option username 'openwrt'
#option password 'openwrt'
Der streamer wird gestartet mit
/etc/init.d/mjpg-streamer start
Danach ist der stream im Browser zusehen:
Auch hier muß natürlich die Adresse des Routers anstelle von 10.63.115.1 eingetragen werden.
Weitere Informationen gibt es unter:
https://openwrt.org/docs/guide-user/hardware/video/webcam
Als Dienst im Weimarnetz sichtbar machen
https://weimarnetz.de/services-monitoring/services
uci del ffwizard.olsr.service
uci add_list ffwizard.olsr.service='http://10.63.115.1:80/webcam/|tcp|Webcam von Christfried'
oder auf der WebSite des Routers unter
Administration --> Weimarnetz --> Einstellungen --> OLSR
Script zur Installation
#!/bin/sh # rev 0.3 by R.Hoffmann @20240206 opkg update opkg install kmod-video-uvc opkg install mjpg-streamer opkg install mjpg-streamer-input-uvc opkg install mjpg-streamer-output-http mkdir -p /www/webcam/ IP=$(/sbin/uci get network.lan.ipaddr) HOSTNAME=$(/sbin/uci get ffwizard.settings.hostname) cat <<EOF >/www/webcam/index.html <html> <head> <title>Webcam auf ${HOSTNAME}</title> </head> <body> <center> <img src="http://${IP}:8080?action=stream" /> </center> </body> </html> EOF cat <<EOF >/etc/config/mjpg-streamer config mjpg-streamer 'core' option enabled '1' option input 'uvc' option output 'http' option device '/dev/video0' option resolution '1024x768' option yuv '0' option quality '80' option fps '5' option led 'auto' option www '/www/webcam' option port '8080' #option listen_ip '192.168.1.1' #option username 'openwrt' #option password 'openwrt' EOF /etc/init.d/mjpg-streamer start echo -e "\n\nto register your new service call:\n\t/sbin/uci add_list ffwizard.olsr.service='http://${IP}:80/webcam/|tcp|Webcam auf ${HOSTNAME}'"