<div dir="ltr"><div>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.<br>
<br><a href="http://web.archive.org/web/20111128021343/http://www.olpcnews.com/forum/index.php?topic=4710.0">http://web.archive.org/web/20111128021343/http://www.olpcnews.com/forum/index.php?topic=4710.0</a><br><br>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.<br>
<br>As root, create this file:<br><br>-bash-4.2# cat /var/www/cgi-bin/webcam.cgi <br>#!/bin/sh<br># CGI script to take and display an on-demand image<br>echo "Content-type: text/html"<br>echo<br>echo "<html><head><title>A Picture from the XO XSCE Webcam</title><body>"<br>
echo "<h1>Here's a Real Time image from the XO XSCE Webcam</h1>"<br>echo "<b>"<br>gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=/var/www/html/images/webcam.png > /dev/null<br>
echo "<br />"<br>echo "<IMG SRC="../images/webcam.png">"<br>echo "<br />"<br>echo "<h2>Refresh this page to take another picture</h2>"<br>echo "</b></body></html>"<br>
<br>chmod +x webcam.cgi<br><br>Still as root, Put apache into the video and audio groups in /etc/groups:<br><br>-bash-4.2# cat /etc/group |grep apache<br>video:x:39:olpc,apache<br>audio:x:63:olpc,apache<br><br>mkdir /var/www/html/images and then:<br>
<br>chown apache:apache /var/www/html/images<br><br>Reboot.  Then go to <a href="http://whatever">http://whatever</a> your XSCE's IP is/webcam.cgi and it automagically takes and displays a picture of what your XSCE XO is pointed at.<br>
<br></div>Then hit F5 to refresh as needed for new pictures.<br><div><br>Anna Schoolfield<br>Birmingham<br></div></div>