Webcam mit PHP-Seite auslesen und anzeigen

Webcams mit Vidcat auslesen. vidcat ist im Paket w3cam enthalten (apt-get install w3cam) z.B.:

  • vidcat -s 640×480 -p c > test.jpg
<?php
 
 
//phpinfo();
 
$size_x = 352;
$size_y = 288;
 
$result = exec("/usr/bin/vidcat -d /dev/video1 -o /var/www/webserver/webcam.jpg -s ".$size_x."x".$size_y, $resultarray, $exitcode);
 
 
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- $Id: htmlquickstart.kmdr 542833 2006-05-20 13:55:07Z amantia $ -->
<head>
  <title>Webcam</title>
  <meta name="GENERATOR" content="Quanta Plus">
  <meta name="AUTHOR" content="GP">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-16">
  <meta name="KEYWORDS" content="Pasing">
</head>
<body>
<?php
 
if ($exitcode==0)
  echo "Bild aus Kamera gelesen<br>\n";
else 
  echo "Konnte Bild nicht aus Kamera lesen<br>\n";
 
//echo $result."<br />";
//print_r($r2);
 
echo "<p><a href=\"".$_SERVER["PHP_SELF"]."\">";
echo "<img border=\"1\" align=\"left\" vspace=\"2\" hspace=\"2\" width=\"".$size_x."\" height=\"".$size_y."\" src=\"./webcam.jpg\">";
echo "</a></p>";
 
 
 
echo "<p>".date("d.m.Y H:i:s")."</p>";
 
 
</body>
</html>
?>
 
Nach oben
usb/webcam/php.txt · Zuletzt geändert: 2024/02/29 13:36 von 127.0.0.1
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp   Dogecoin Donations Accepted Here    DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp  DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp