text:text-webcam-server-en
Table of Contents
Text WebCam on Server
Introduction
The WebCam on Server provides the captured images to all connected clients.
Supported clients:
The captured WebCam image should be as small as possible to save bandwidth. This is especially important in case of connected mobile clients.
Setup
Text Object
- Refresh must be set to zero
- The WebCam option must be activated
- The new captured image will be searched in the Image Path
Action
The action calls an external Capture Script for capturing a new snapshot image from the WebCam.
The Asynchrone option should be disabled for this action.
Action Control
Capture Script
The script must provide an image in JPEG format and should be as small as possible and must be smaller then 100kB.
macOS
The wacaw –CIF option will generate a small image of 352 X 288. (Common Intermediate Format)
#!/bin/bash echo "Snapping a new image of the webcam..." /Users/rob/Projects/Rocrail/unxbin/rocnet/webcam/wacaw -d 2 --jpeg --CIF /Users/rob/Projects/Rocrail/unxbin/rocnet/webcam/_picture mv /Users/rob/Projects/Rocrail/unxbin/rocnet/webcam/_picture.jpeg /Users/rob/Projects/Rocrail/unxbin/rocnet/images/picture.jpg
Line explanation:
- The used interpreter
- Terminal message
- A call to the wacaw program to capture a new image
- move the captured image into the image path
Linux
#!/bin/bash picfile="/home/sven/rocrail/images/$(basename "$0").jpg" tmpfile="/home/sven/rocrail/images/_$(basename "$0").jpg" device="/dev/video${0: -1}" echo "Snapping a new picture from $device to $picfile" avconv -f video4linux2 -i "$device" -frames 1 "$tmpfile" mv "$tmpfile" "$picfile"
Windows
- Example with all needed files and programs:
https://github.com/tedburke/CommandCam/blob/master/CommandCam.exe
text/text-webcam-server-en.txt · Last modified: 2021/09/07 18:06 by rjversluis