惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
博客园 - 司徒正美
D
Darknet – Hacking Tools, Hacker News & Cyber Security
量子位
N
News | PayPal Newsroom
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LINUX DO - 热门话题
有赞技术团队
有赞技术团队
V
Visual Studio Blog
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Project Zero
Project Zero
B
Blog RSS Feed
J
Java Code Geeks
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
小众软件
小众软件
博客园 - 【当耐特】
Latest news
Latest news
T
Threat Research - Cisco Blogs
aimingoo的专栏
aimingoo的专栏
博客园_首页
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta
D
Docker
Forbes - Security
Forbes - Security
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V2EX - 技术
V2EX - 技术
N
Netflix TechBlog - Medium
The Last Watchdog
The Last Watchdog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threatpost
Cloudbric
Cloudbric
T
The Exploit Database - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
Webroot Blog
Webroot Blog

Danb Blog

Cheaper Sodastream Gas with a Big Tank June 2026: What I've Been Working On · Danb Blog Running Snyk On Forgejo/Codeberg Actions · Danb Blog Tuta & Proton: An Open Source Client Does Not Result in an Open Source Service · Danb Blog May 2026: What I've Been Working On · Danb Blog 3D Printing Parts for my Greenhouse, Round 2 · Danb Blog Great Devices: Nexus 7 2013 · Danb Blog R36S Console RetroArch Stuck Menu Issue · Danb Blog April 2026: What I've Been Working On · Danb Blog Basic OpenCode Sandboxing with Docker · Danb Blog Games Played in 2025 · Danb Blog March 2026: What I've Been Working On · Danb Blog Shivam Mathur's "node-docker" Images are Awesome for PHP CI · Danb Blog February 2026: What I've Been Working On · Danb Blog Your BookStackApp project was assigned as a project for my Software Architecture course · Danb Blog My Sovol SV08 3D Printer Setup in 2026 · Danb Blog January 2026: What I've Been Working On · Danb Blog Epson Printer: The administrator password you entered was not recognized · Danb Blog Pressure to Follow Process · Danb Blog Online Shopping Email Notifications · Danb Blog My HomeLab Setup in 2026 · Danb Blog Linux Label Printing with the Phomemo D30 · Danb Blog Reporting to the CMA: Google Android Developer Verification · Danb Blog OPNsense & Dnsmasq: Responding with specific DNS servers · Danb Blog An Impromptu Introduction to ZFS Drive Replacement at 1am · Danb Blog Experience with UK Medical Cannabis for Ankylosing Spondylitis · Danb Blog Copyright Takedown for Linking to the "State of Open Source" Report · Danb Blog No, Gumroad Did Not Become Open Source Today · Danb Blog Scripting Monitors (KDE on Fedora) · Danb Blog Amber flags in Open Source & Self-Hosted Projects · Danb Blog LLMs are Directing Open Source Licensing · Danb Blog Games Played in 2024 · Danb Blog Beware of Poison in the Source · Danb Blog Common Misconceptions of the AGPL · Danb Blog Adapting GitHub action PHPUnit tests for Codeberg/Forgejo · Danb Blog Lessons from the Allotment · Danb Blog Futo, Please don't attempt to create your own Open Source Definition · Danb Blog Material You (Dynamic/Adaptive) Colors in Legacy Android Apps · Danb Blog Scripting Monitors (Gnome & Wayland on Fedora) · Danb Blog Retaining a Greenhouse Roof with 3d Printing · Danb Blog Games Played in 2023 · Danb Blog Lessons From Growing Food Indoors · Danb Blog Why the Distinction Between "Open Source" and "Source Available" is Important · Danb Blog Removing the Rear Seats on a Volvo C30 · Danb Blog Reporting Google's WEI to the CMA · Danb Blog Controlling Default GRUB Boot Option via USB · Danb Blog Creating a Video Home for FOSS Projects · Danb Blog Paying for Search · Danb Blog My Favourite Static Site Deploy Method · Danb Blog PhpStorm (JetBrains IDE) 2023 Linux Scaling · Danb Blog Synology Hibernation with Active Backup for Business and Tailscale · Danb Blog My 2023 HomeLab Setup · Danb Blog Redefining Open Source via "Commercial Open Source" · Danb Blog Moving to Mastodon · Danb Blog Gaining Sponsors · Danb Blog "This is a Low Maintenance Project" · Danb Blog Upgrading my CPU, Ryzen 2600 to 5800x · Danb Blog Migrating Google Photos to my Personal NAS · Danb Blog Scheduling Proxmox Storage to Reduce Disk Activity · Danb Blog Why the Term "Open Source" is Important · Danb Blog Lessons From Working for Myself (9 Months In) · Danb Blog Misrepresenting Open Source for Business Benefit · Danb Blog Cat Images in WebP · Danb Blog My 2022 Workstation Setup · Danb Blog Leaving my Job to Focus on Open Source (For a bit) · Danb Blog Quickly Getting Placeholder Images With Unsplash Source · Danb Blog A Thanks to Laravel for the LTS Releases · Danb Blog A Quick Overview of Unix-Style Permissions · Danb Blog The Power of currentColor · Danb Blog Dealing With Ankylosing Spondylitis Flareups · Danb Blog Hugo Verbose Dates With Suffixes · Danb Blog
Raspberry Pi Camera Module 3 Timelapse · Danb Blog
2023-09-01 · via Danb Blog

Recently I’ve been playing with a Raspberry Pi Camera module 3. One thing I’ve been toying with is putting together timelapses to observe how my different plants grow.

There’s a lot of content out there for this use-case, like this project by Jeff Geerling, but there’s a lot of variation out there in terms of camera versions, compatibility libraries, legacy modes and Raspbian versions, which makes finding a working example tricky.

While searching about I found that the default provided “libcamera” library and apps, recommended for the Pi cam 3, have many abilities built in including the ability to create timelapses, making the process quite simple. Using the libcamera-still app & ffmepg, I put together a couple of bash scripts to easily capture timelapses.

Example Output

Here’s an example of an output of this process. Note that I would have played around with the framerates, and I’ve done some additional editing & cropped the video, to help reduce some heavy flicker (from artificial lights):

Capture Script

This script takes two position arguments, interval (in seconds) and total (rough) frame count. So, saving this as capture.sh I could call it like ./capture.sh 2 30 and it would capture an image every 2 seconds for a minute (30 frames). Images are saved to a <script_path>/captures/<capture_start_timestamp>/*.jpg location. They are saved as 1080p at 75% jpeg quality to ensure a reasonable filesize.

The --vflip towards the bottom of the script is specific to my usage, since I’ve seemed to mount my camera upside down relative to how I capture. Just remove this flag if you haven’t made the same mistake.

#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
DATESTAMP=$(date +'%Y-%m-%d_%H-%M')
DIR="$SCRIPT_DIR/captures/$DATESTAMP"

# Check if the number of arguments is correct
if [ $# -ne 2 ]; then
  echo "Usage: $0 <interval_secs> <frame_count>"
  exit 1
fi

# Get the variables from input
INTERVAL=$1
FRAME_COUNT=$2

# Calculate the total time and interval in MS
INTERVAL_MS=$((INTERVAL * 1000))
TIME_MS=$((FRAME_COUNT * INTERVAL_MS))

# Create the output directory
mkdir -p "$DIR"

# Start the timelapse
libcamera-still --timelapse "$INTERVAL_MS" \
    -t "$TIME_MS" \
    --vflip \
    --quality 75 \
    --width 1920 --height 1080 \
    -o "$DIR/frame_%05d.jpg"

Stitch Script

This script takes a directory of *.jpg images, like those created from the capture script above, and stitches them together into a output.mp4 in the same directory. This requires ffmpeg to be installed.

This stitches frames together for 60 input frames per second of video output. Adjust the -framerate 60 as desired based upon your amount of input frames and the desired length & smoothness of output.

#!/bin/bash

# Check if the directory argument is provided
if [ $# -eq 0 ]; then
    echo "Please provide a directory as an argument."
    exit 1
fi

# Ensure ffmpeg is installed
if ! command -v ffmpeg &>/dev/null; then
    echo "ffmpeg is not installed. Please install ffmpeg first."
    exit 1
fi

# Navigate to the directory
cd "$1" || exit 1

# Run ffmpeg to convert jpeg files to mp4
# If you want to different output framerate compared to input, 
# add a `-filter:v fps=fps=60` argument and adjust as desired for output fps.
ffmpeg -framerate 60 -pattern_type glob -i '*.jpg' -c:v libx264 output.mp4

echo "Conversion complete. The output file 'output.mp4' is created in the $1 directory."

Startup Service

If you want to start the timelapse capture upon startup, you can do so via a SystemD service by adding the below to a /etc/systemd/system/timelapse.service file, then run systemctl enable timelapse.service.

[Unit]
Description=Timelapse

[Service]
ExecStart=/path/to/capture.sh 5 1200
Restart=on-failure
User=dan

[Install]
WantedBy=multi-user.target