Changeset 41 for www


Ignore:
Timestamp:
Feb 1, 2008, 9:55:02 PM (17 years ago)
Author:
george
Message:

Opraveno: Periodické obnovování snímku webkamery.

Location:
www/webcam
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • www/webcam

    • Property svn:ignore
      •  

        old new  
        11webcam_cache.jpg
         2nohup.out
  • www/webcam/index.php

    r31 r41  
    44ShowHeader('Kamera', 'Webová kamera');
    55
    6 $ReloadPeriod = 2000; // ms
     6$ReloadPeriod = $Config['Web']['WebcamRefresh'] * 1000; // ms
    77
    88echo('
     
    3636</script>');
    3737
    38 echo('<br><div align="center"><img name="theImage" src="" idth="640" height="480" alt="Webcam image"><br>Poslední aktualizace: '.date('j.n.Y G:i', filemtime('webcam.jpg')).'</div><br>');
     38echo('<br><div align="center"><img name="theImage" src="" idth="640" height="480" alt="Webcam image"><br>Poslední aktualizace: '.date('j.n.Y G:i', filemtime('webcam.jpg')).'<br>Obnovování po '.$Config['Web']['WebcamRefresh'].' sekundách</div><br>');
    3939
    4040echo('<strong>Kamery v okolí:</strong><br><a href="http://www.inext.cz/webkamera_updated.htm">Ulice nádražní a Smetanova Vsetín</a><br>');
  • www/webcam/webcam_refresh.php

    r31 r41  
    11<?php
    22include('../global.php');
    3 
    4 $RefreshPeriod = 1;
    5 
    6 //Header('Content-type: image/jpeg');
    7 // Header("Cache-Control: no-cache");
    8 // Header("Pragma: no-cache");
    93
    104while(1)
    115{
    126  $ModifyTime = filemtime('webcam.jpg');
    13   if((time() - $RefreshPeriod) >= $ModifyTime)
     7  if((time() - $Config['Web']['WebcamRefresh']) >= $ModifyTime)
    148  {
    15     exec('wget "http://kamera-stred/Webcam.jpg?MobilePass='.$Config['Web']['WebcamPassword'].'&V=2&Q=2&B=2&U=0" -O webcam_cache.jpg');
    16     exec('mv -f webcam_cache.jpg webcam.jpg');
     9    $Output = shell_exec('wget "http://kamera-stred/Webcam.jpg?MobilePass='.$Config['Web']['WebcamPassword'].'&V=2&Q=2&B=2&U=0" -O webcam_cache.jpg -T 2');
     10  if((strpos($Output, 'failed') === false) and (strpos($Output, 'error') === false))
     11    shell_exec('mv -f webcam_cache.jpg webcam.jpg');
    1712  }
     13  //echo('.');
     14  Sleep($Config['Web']['WebcamRefresh']);
     15}
    1816
    19   //echo(file_get_contents('webcam.jpg'));
    20   Sleep(1);
    21 }
    2217?>
Note: See TracChangeset for help on using the changeset viewer.