[Server-devel] Taking pictures with an XSCE on an XO
Anna
aschoolf at gmail.com
Sat Feb 22 03:52:04 EST 2014
A long time ago, I posted on OLPC News Forum about how to make your XO-1
take and display an image with gstreamer and the boa web server. You can
take and display an image from the XO-1's camera via any browser on the
LAN. These instructions are mostly still valid for the XO-1.
http://web.archive.org/web/20111128021343/http://www.olpcnews.com/forum/index.php?topic=4710.0
But for the XSCE on an XO 1.5, 1.75 or 4? Apache makes things a little
more difficult to configure. So let's just see what to do, then.
As root, create this file:
-bash-4.2# cat /var/www/cgi-bin/webcam.cgi
#!/bin/sh
# CGI script to take and display an on-demand image
echo "Content-type: text/html"
echo
echo "<html><head><title>A Picture from the XO XSCE Webcam</title><body>"
echo "<h1>Here's a Real Time image from the XO XSCE Webcam</h1>"
echo "<b>"
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink
location=/var/www/html/images/webcam.png > /dev/null
echo "<br />"
echo "<IMG SRC="../images/webcam.png">"
echo "<br />"
echo "<h2>Refresh this page to take another picture</h2>"
echo "</b></body></html>"
chmod +x webcam.cgi
Still as root, Put apache into the video and audio groups in /etc/groups:
-bash-4.2# cat /etc/group |grep apache
video:x:39:olpc,apache
audio:x:63:olpc,apache
mkdir /var/www/html/images and then:
chown apache:apache /var/www/html/images
Reboot. Then go to http://whatever your XSCE's IP is/webcam.cgi and it
automagically takes and displays a picture of what your XSCE XO is pointed
at.
Then hit F5 to refresh as needed for new pictures.
Anna Schoolfield
Birmingham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/server-devel/attachments/20140222/e4cf4886/attachment.html>
More information about the Server-devel
mailing list