Rolling “Live” Timelapse on Mac using FFmpeg and Amcrest IP Camera

Amcrest UltraHD 5MP POE Bullet IP Security Camera* (Amazon Affiliate)
US: https://amzn.to/39CjeFg
*This camera is similar to the one used in the video.

FFmpeg notes (including FFmpeg install): https://www.rickmakes.com/ffmpeg-notes/

FFmpeg playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZOPDZ71Khzt5PX4X4j6flkg

Amcrest playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZNYE224qh9K0hhaaIxU-rta

Create RAM Disk (Mac only)
diskutil erasevolume HFS+ "tlramdisk" `hdiutil attach -nomount ram://409600`

A RAM disk is created to store the images. This reduces wear on the computer’s SSD or hard drive. The RAM disk size is 2048 * megabytes. 409600 is 200MB.

Create Image Download Script
nano rollingtimelapse.sh
#!/bin/bash

url=http://username:password@ip_address/cgi-bin/snapshot.cgi

fps=60
tl_length=5
image_count=$((fps*tl_length))

function download_image {
    # This loops until an image is saved as temp. This prevents the saving of empty image files. "temp" purposefully doesn't have an extension so it doesn't get picked up by ffmpeg.

    until [ -s "temp" ]
    do
        curl --digest -o "temp" $url
    done

    # "temp" is renamed to the current file

    mv "temp" $1
    echo $1
}

# Download image once and copy it image_count number of times to preload the image set

download_image `printf "%003d.jpg" 1`

for ((i=1; i<=image_count; i++)); do
    cp -v `printf "%003d.jpg" 1` `printf "%003d.jpg" $i`
done

# Continually download images in a loop

#initialsize the image_number

image_number=1

while :
do
    # Reset image number when it is greater than image count

    if [ $image_number -gt $image_count ]
    then
        image_number=1
    fi

    # current_file is padded with 2 zeros to help with ordering in file system

    current_file=`printf "%003d.jpg" $image_number`

    download_image $current_file;

    image_number=$((image_number+1))

    sleep $tl_length

done

Type control-o to save control-x to exit.

Make Script Executable
chmod +x rollingtimelapse.sh
View Video without Re-encoding (mjpeg)
ffmpeg -framerate 60 -f image2 -stream_loop -1 -pattern_type glob -i '*.jpg' -c:v copy -b:v 10000k -r 60 -f mjpeg pipe:1|ffplay -i pipe:0
Play video and resize on the fly
ffmpeg -framerate 60 -f image2 -stream_loop -1 -pattern_type glob -i '*.jpg' -vf crop=in_w:in_w*9/16,scale=1920:1080,fps=fps=60 -c:v h264_videotoolbox -b:v 10000k -r 60 -pix_fmt yuv420p -f flv pipe:1|ffplay -i pipe:0
Play Video without Resizing
ffmpeg -framerate 60 -f image2 -stream_loop -1 -pattern_type glob -i '*.jpg' -vf fps=fps=60 -c:v h264_videotoolbox -b:v 10000k -r 60 -pix_fmt yuv420p -f flv pipe:1|ffplay -i pipe:0

If you aren’t using an Intel Mac, you can use “libx264” in place of “h264_videotoolbox”.

Tracking Planes with RTL-SDR and a Raspberry Pi running PiAware

RTL-SDR Blog V3 R820T2 (Amazon Affiliate)
US: https://amzn.to/2z4hpDu
CA: https://amzn.to/3e3Ln8K (dongle only)
UK: https://amzn.to/2AuUdin
IN: https://amzn.to/2ZNJHez
AU: https://amzn.to/3iDbW8l

Raspberry Pi (Amazon Affiliate)
US: https://amzn.to/2LpyVob
UK: https://amzn.to/2Z2inKX
CA: https://amzn.to/2y5yAUA
ES: https://amzn.to/3fSDhSS
FR: https://amzn.to/2LpurxT
IT: https://amzn.to/2T2VZNu
DE: https://amzn.to/3buHRmQ
IN: https://amzn.to/2B3PGTN

Software Defined Radio Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZPHRD_m-N5pzrPPdkXa8Fsf

Raspberry Pi Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZPvIdR5BEqDgO7DsGAla_AZ

Set up Headless boot (do this after writing the image to the microSD Card

Create ssh or ssh.txt in boot directory.

Create wpa_supplicant.conf in boot directory file to set up Wifi.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>

network={
 ssid="<Name of your wireless LAN>"
 psk="<Password for your wireless LAN>"
}

Instructions on FlightAware’s site: https://flightaware.com/adsb/piaware/install

Update Package List and Packages
sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y
Change Hostname
sudo raspi-config

Network Options > Hostname

Download PiAware Repository
wget https://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.8.1_all.deb
Install PiAware Repository
sudo dpkg -i piaware-repository_3.8.1_all.deb
Update Package List
sudo apt update
Install piaware and dump1090
sudo apt install piaware dump1090-fa
Enable Automatic and Manual Updates
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
Reboot System
sudo systemctl reboot
Open PiAware Web Interface
http://piaware.local:8080

Updating Kiwix and Zim File on Raspberry Pi Offline Wikipedia Kiosk

Locked Down Offline Wikipedia Kiosk on Raspberry Pi 4: https://youtu.be/gtlydT6Lumg

CanaKit Raspberry Pi 4 (4GB) Starter Kit (Amazon Affiliate)
US: https://amzn.to/3azJgrW
UK: https://amzn.to/2JdMq9o
CA: https://amzn.to/3bwiRvY
ES: https://amzn.to/2T06LnM (similar)
FR: https://amzn.to/3cvIZrs (similaire)
IT: https://amzn.to/2Ar74Sj (simile)
DE: https://amzn.to/2AqfWHQ (ähnlich)
IN: https://amzn.to/3ey6fWj
AU: https://amzn.to/2VTUt1C
NL: https://amzn.to/3f5NdsD (vergelijkbaar)

Download Kiwix Server

https://www.kiwix.org/en/downloads/kiwix-serve/

Download Kiwix Content (Zim File)

https://wiki.kiwix.org/wiki/Content_in_all_languages

Login to Raspberry Pi (use your kiosk’s hostname, username and password)
ssh pi@raspberrypi.local
Disable OverlayFS (disable read-only system)
sudo raspi-config

Advanced Options > Overlay FS

Send Kiwix Server and Zim File to Raspberry Pi (run on local computer)
scp ~/Downloads/kiwix-tools_linux-armhf*.tar.gz pi@raspberrypi.local:~/
scp ~/Downloads/*.zim pi@raspberrypi.local:~/
Stop Kiwix Server
sudo systemctl stop kiwix
Open Kiwix Service Configuration
sudo nano /etc/systemd/system/kiwix.service

Update the zim filename. Control-o to save. Control-x to exit.

Move Zim File to Directory
sudo mv wikipedia*.zim /var/local/
Change zim file user/group to pi
sudo chown pi:pi /var/local/wikipedia*.zim
Decompress Kiwix Server
tar -zxvf kiwix-tools_linux-armhf*.tar.gz
Move Binaries to Executable Directory
sudo mv kiwix-tools_linux-armhf-*/* /usr/local/bin/
Reload systemd Manager Configuration
sudo systemctl daemon-reload
Start Kiwix Service
sudo systemctl start kiwix
Check Status of Kiwix Service
sudo systemctl status kiwix

Re-enable OverlayFS using instructions above and reboot Raspberry Pi.

Mac: Recording with Cheap HDMI Adapter using Quicktime

HDMI to USB Video Capture Card 1080P: http://ebay.us/Mv0snK (eBay Affiliate)

HDMI to USB Video Capture Card 1080P (Amazon Affiliate)
US: https://amzn.to/3cwUqjv
UK: https://amzn.to/2DD2QZh
CA: https://amzn.to/2PwBNS0
ES: https://amzn.to/30w07tM
FR: https://amzn.to/31sG92a
IT: https://amzn.to/30yMOsz
DE: https://amzn.to/2XD83aO
AU: https://amzn.to/3a3ItQZ

Audio/Video Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZN4KVIf7ad7Y1CBlosKdZkd

Stream Specs when using High
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt709/bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 10815 kb/s, 60 fps, 60 tbr, 30k tbn, 60k tbc (default)
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 215 kb/s (default)
Stream Specs when using Maximum
Stream #0:0(und): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, smpte170m/bt709/bt709, progressive), 1920x1080, 116856 kb/s, 25 fps, 25 tbr, 30k tbn, 30k tbc (default)
Stream #0:1(und): Audio: pcm_s16be (lpcm / 0x6D63706C), 96000 Hz, 1 channels, s16, 1536 kb/s (default)

Raspberry Pi: Fixing OMXPlayer Glitch when playing GoPro Video

In this video I copy the video and audio streams of a GoPro generated video to a new file. I do this to remedy a pausing glitch when playing the video back with OMXPlayer on a Raspberry Pi.

Raspberry Pi Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZPvIdR5BEqDgO7DsGAla_AZ

CanaKit Raspberry Pi 4 (4GB) Starter Kit (Amazon Affiliate)
US: https://amzn.to/3azJgrW
UK: https://amzn.to/2JdMq9o
CA: https://amzn.to/3bwiRvY
ES: https://amzn.to/2T06LnM (similar)
FR: https://amzn.to/3cvIZrs (similaire)
IT: https://amzn.to/2Ar74Sj (simile)
DE: https://amzn.to/2AqfWHQ (ähnlich)
IN: https://amzn.to/3ey6fWj
AU: https://amzn.to/2VTUt1C
NL: https://amzn.to/3f5NdsD (vergelijkbaar)

Play Video with OMXPlayer
omxplayer goprovid.mp4
View Video Stats with FFprobe
ffprobe goprovid.mp4
Copy Video and Audio Streams to New File
ffmpeg -i goprovid.mp4 -vcodec copy -acodec copy -dn -sn goprovid_fixed.mp4
List Files
ls -l 

Note: If ffprobe and ffmpeg are not installed, you can install them with:

sudo apt install ffmpeg