monitor_room

来自「WWWcam 是一个从基于视频设备的Webcam中抓图」· 代码 · 共 51 行

TXT
51
字号
#!/usr/bin/perl# this program tells you if there was activity in your room in the# time you started and ended it. (CTRL-C or kill)# You can change say to print if you have no command "say" for computer speech.sub end {	my $signame = shift;	if ( time() - $firsttime > 10  && $firsttime != 0) {	# ALARM	`say "ALARM. Bewegung im Zimmer"`;	}	else {	# nix passiert	`say "Keine Bewegung im Zimmer"`;	}	die "bye...\n";}$SIG{INT} = 'end';$SIG{TERM} = 'end';$firsttime = 0;`say "Zimmer黚erwachung startet in"`;for ($u = 10; $u>0; $u--) {	`say "$u"`;	sleep (1);}`say "Zimmer黚erwachung aktiv"`;open(COUNTFILE, "/tmp/wwwcam.count.0");$frame = <COUNTFILE>;close(COUNTFILE);while ($firsttime == 0) {	open(COUNTFILE, "/tmp/wwwcam.count.0");	$frame2 = <COUNTFILE>;	close(COUNTFILE);	if ( $frame2 - $frame > 0) {		$firsttime = time();	}	sleep(1);}while (1) {  sleep(9999999);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?