Up プログラムの改修 作成: 2024-12-26
更新: 2024-12-26


    修正とともに,DNG 用撮影ページは後で単独でつくることにして,DNG撮影ボタンを外す。
    そしてこれによってボタンが1つになるので,ボタンの絵もやめて,ストリーミング画像クリックをボタンクリックに変更する。

    <?php  $url = "http://10.10.10.1:8080/";  $storage = "./storage/";  /** mjpg-streamer を停止 **/  $cmd = "sudo pkill mjpg";  exec( $cmd );  if( isset( $_GET["n"] ) ) {   $n = $_GET["n"];   $n++;   /** 静止画撮影 **/   $file_name = date( "Ymd_His" );   $cmd = "raspistill -o ./storage/".$file_name.".jpg";   exec( $cmd );  }  else {   $n = 0;  }  /** mjpg-streamer を起動 **/  $cmd = "/home/pi/mjpg.sh 800 800 1 100";  $cmd = $cmd." > /dev/null &";  exec( $cmd );  /** storage 内の画像ファイルを数える **/  if( $dh = opendir( $storage ) ) {   $fn = -2;   while ( readdir($dh) !== false) {    $fn++;   }   closedir($dh);  }  else {   print "ディレクトリ storage のファイル読み込みに失敗";   exit;  }  print "   <html>   <head>    <meta charset=\"UTF-8\">    <title>Raspberry Pi Cemara</title>   </head>   <body>   <center>   <a href=\"./index.phtml?n=".$n."\"><img src=\"".$url."?action=stream\" /></a>    <br><br>   <font size=7><b>".$fn."</b></font>   </center>   </body>   </html>  "; ?>


    かくして,つぎのページに至る: