User Tools

Site Tools


text:text-webcam-server-en
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


text:text-webcam-server-en [2021/09/07 18:06] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Text WebCam on Server ======
 +[[:english#objects|{{  :objects.png}}]][[:english|{{  :rocrail-logo-35.png}}]]
 +[[:english|Content]] -> [[:english#objects|Objects]] ->   **[[:text-en|Text]]** 
 +  * [[:text:text-webcam-en|WebCam]] | **[[:text:text-webcam-server-en|WebCam on Server]]**
  
 + \\
 +=====Introduction=====
 +The WebCam on Server provides the captured images to all connected clients.\\
 +Supported clients:
 +  * __**[[:english#rocview|Rocview]]**__
 +  * __**[[:rocweb:rocweb-en|Rocweb]]**__
 +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====
 +{{:text:webcam-server-setup-en.png}}\\
 +
 +  * Refresh must be set to zero
 +  * The **WebCam** option must be activated
 +  * The new captured image will be searched in the __**[[:rocrailini-gen-en#image_path|Image Path]]**__
 +
 + \\
 +====Action====
 +{{:text:webcam-server-action-en.png}}\\
 +The action calls an external __**[[#capture_script|Capture Script]]**__ for capturing a new snapshot image from the WebCam.\\
 +The **Asynchrone** option should be disabled for this action.\\
 +
 + \\
 +
 +====Action Control====
 +{{:text:webcam-action-control-en.png}}\\
 +This action will be called every second, fixed, with the state set to "**webcam**".\\
 +
 + \\
 +
 +====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. ([[https://en.wikipedia.org/wiki/Common_Intermediate_Format|Common Intermediate Format]])\\
 +<code bash>
 +#!/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
 +</code>
 +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===
 +<code bash>
 +#!/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"
 +</code>
 +
 +===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 127.0.0.1