View imgcompare.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
* { | |
box-sizing: border-box; | |
} |
View upddns.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script from: | |
# https://postapocalyptech.com/posts/use_cloudflare_ddns/ | |
# adjusted for OpenWrt's ash | |
# Running curl command and getting your IP address using akamai's service | |
# Store it in IPADDRNOW variable | |
IPADDRNOW=$(curl -s http://whatismyip.akamai.com/); \ | |
# Using cat to read stored IP address and then putting it in STOREDIP variable |
View snapshot-curl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab snapshot from camera and upload via HTTP post | |
post_url="https://myserver/upload.php?token=" | |
camera_url="http://192.168.89.146/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=guest&password=guest123" | |
start_hour=6 | |
end_hour=18 | |
now=$(date +"%Y-%m-%d-%H-%M-%S") | |
year=$(echo "$now" | awk -F'-' '{ printf "%s", $1 }') | |
month=$(echo "$now" | awk -F'-' '{ printf "%s", $2 }') |
View ffmosaic-iina.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Watch multicast stream of two ip camera streams side-by-side in IINA player | |
url="udp://239.0.0.1:1234?ttl=13&pkt_size=1317" | |
ffmpeg -loglevel panic -re \ | |
-i "rtmp://camera1.lan/bcs/channel0_ext.bcs?channel=0&stream=2&user=guest&password=guest123" \ | |
-i "rtmp://camera2.lan/bcs/channel0_ext.bcs?channel=0&stream=2&user=guest&password=guest123" \ | |
-filter_complex "nullsrc=size=1280x480 [base]; \ |
View make_timelapse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$now = time(); | |
$currentYear = date("Y", $now); | |
$currentMonth = date("m", $now); | |
$currentDay = date("d", $now); | |
$currentHour = date('G', $now); | |
$currentMinute = intval(date('i', $now)); |
View camera.m3u
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EXTM3U | |
#EXTINF:0,rtsp://camera1.lan/h264Preview_01_sub | |
rtsp://guest:guest123@camera1.lan/h264Preview_01_sub | |
#EXTINF:0,rtsp://camera2.lan/h264Preview_01_sub | |
rtsp://guest:guest123@camera2.lan/h264Preview_01_sub | |
#EXTINF:0,rtmp://camera1.lan/bcs/channel0_main.bcs | |
rtmp://camera1.lan/bcs/channel0_main.bcs?channel=0&stream=0&user=guest&password=guest123 | |
#EXTINF:0,rtmp://camera2.lan/bcs/channel0_main.bcs | |
rtmp://camera2.lan/bcs/channel0_main.bcs?channel=0&stream=0&user=guest&password=guest123 | |
#EXTINF:0,rtmp://camera1.lan/bcs/channel0_sub.bcs |
View cam2.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('MIN_HOUR', 6); | |
define('MAX_HOUR', 18); | |
define('SNAPSHOT_DIR', 'cam'); | |
define('SNAPSHOT_PATTERN', '/camera[0-9]*_([0-9]+)\.jpg/'); | |
define('SECONDS_TO_CACHE', 660); // 11 minutes | |
define('PLACEHOLDER_TEXT', 'Stream is over for today. We will be back at 6:00am.'); | |
$now = time(); |
View maintenance.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "maintenance..."; | |
define("ONE_DAY_IN_SECONDS", 86400); | |
function delete_files_older_than($dir, $fileDateMask, $seconds, $now = NULL) { | |
if (is_dir($dir) === false) { | |
echo "Dir $dir doesn't exists\n"; | |
return; |
View record_cam.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -rtsp_transport tcp \ | |
-analyzeduration 100000 -probesize 100000 \ | |
-i rtsp://guest:guest123@192.168.89.146:554/h264Preview_01_main \ | |
-f segment -segment_time 300 -segment_format mpegts \ | |
-reset_timestamps 1 \ | |
-strftime 1 \ | |
-c copy \ | |
-movflags frag_keyframe /mnt/sda2/rec/cam-%Y%m%d-%H%M%S.mp4 |
View create_new_firmware.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
flash_size_in_MB=8 | |
sysupgrade_OpenWRT="openwrt-18.06.1-ramips-mt76x8-tl-wr840n-v5-squashfs-sysupgrade.bin" | |
art_file="upload_openwrt_art.bin" | |
boot_loader="upload_openwrt_mtd0.bin" | |
sysupgrade_OpenWRT_size=$(wc -c $sysupgrade_OpenWRT | cut -f 1 -d " ") | |
art_file_size=$(wc -c $art_file | cut -f 1 -d " ") | |
boot_loader_size=$(wc -c $boot_loader | cut -f 1 -d " ") |
NewerOlder