Skip to content

Latest 🗞️

Tuesday, July 28

Git Commits

dash commits 6 ohnsh/dash
  • 11:59 am — John Sherrell <dev@ohn.sh>

    mkoverlay: Add comments, switch `rclone sync` to `rclone copy` for to avoid deleting remote files when uploading originals. There really needs to be a separate bucket for originals.

  • 11:58 am — John Sherrell <dev@ohn.sh>

    dash-next: VOD route now rendering video when a thumbnail is clicked, with state tracked in query parameters.

  • 10:48 am — John Sherrell <dev@ohn.sh>

    mkoverlay: mkroot helper to create the root manifest (list of inventory files). Also includes helper rclone command builders for uploading media and metadata to R2.

  • 10:47 am — John Sherrell <dev@ohn.sh>

    dash-next: Thumbnails now rendering on VOD route. Added zod and schema for Inventory files.

  • 5:18 am — John Sherrell <dev@ohn.sh>

    mkoverlay: Refactor shell commands and supporting types and helpers into separate library files (exiftool and ffprobe). Print a status update as each file is processed.

  • 1:42 am — John Sherrell <dev@ohn.sh>

    mkoverlay: new package to generate thumbnails and manifests (inventory.json) for directories of videos. It's probably functional enough to start building a VOD front end.

dev commits 1 ohnsh/dev
  • 9:02 am — John Sherrell <dev@ohn.sh>

    stream-utils: deleted a pointless helper script.

YouTube

Monday, July 27

Git Commits

dev commits 1 ohnsh/dev
  • 8:20 pm — John Sherrell <dev@ohn.sh>

    cam: set `-metadata creation_time=` to current time (ISO formatted UTC) when recording to mp4 with ffmpeg. In helper functions that fill array variables with ffmpeg options (`codec_opts`, `metadata_opts`, ...), check that the variables are declared and in scope, or return early with an error.

dash commits 1 ohnsh/dash
  • 1:41 pm — John Sherrell <dev@ohn.sh>

    WIP: new vod route.

YouTube

Sunday, July 26

Git Commits

dash commits 4 ohnsh/dash
  • 10:40 pm — John Sherrell <dev@ohn.sh>

    dashd: update all routes to use withCORS, add timestamp to events in SSE endpoint.

  • 10:31 pm — John Sherrell <dev@ohn.sh>

    dash-next: Generated types for MediaMTX API using openapi-typescript.

  • 8:56 am — John Sherrell <dev@ohn.sh>

    dash-next: SSE component is now working and streaming MediaMTX events. New DefinitionList component that renders [string, string][] entries.

  • 4:18 am — John Sherrell <dev@ohn.sh>

    dashd: change bun server handlers to use withCORS for nearly all routes.

dev commits 2 ohnsh/dev
  • 10:38 pm — John Sherrell <dev@ohn.sh>

    cam: update mediamtx config to call the webhook on unread (close) as well as read, and to pass the event type in the query string.

  • 3:52 am — John Sherrell <dev@ohn.sh>

    cron: refactor daily.sh to run a `main` function with output redirected (instead of using `exec` to redirect the parent shell). Just combine stdout and stderr into a daily.log file. `tee` it in case I'm running interactively.

Saturday, July 25

Git Commits

dash commits 7 ohnsh/dash
  • 1:23 pm — John Sherrell <dev@ohn.sh>

    dash-next: Putting together a skeleton front end that uses the dashd bun server, which mostly proxies MediaMTX GET APIs and provides an SSE endpoint for realtime updates. Simple server-fetched prototype is working. Add `withCors` helper to the backend to allow connections directly from the client.

  • 11:31 am — John Sherrell <dev@ohn.sh>

    next-dash: clean up stream menu now that all are fairly reliable. Keeping the *-patch streams (with clean audio) but mapping them to simple names (wuuk, wyze1).

  • 10:25 am — John Sherrell <dev@ohn.sh>

    refactor(next-dash): extract a custom hook, useHls, that takes an HLS stream URL, passes a RefObject<HTMLVideoElement> back to the user, and handles all the details of using hls.js to play the stream.

  • 7:32 am — John Sherrell <dev@ohn.sh>

    dash-next: greatly improve the reliability of HLS streams, mainly by switching the HLS variant from low-latency to traditional mpegts, but also by changing <Link> to <a> on the front end so that switching streams is accompanied by a full navigation. And by adding a retry timer on hls.js errors (similar to the mediamtx iframe implementation).

  • 4:18 am — John Sherrell <dev@ohn.sh>

    dashd: clean up route handler code, `/mx/status` route now implemented (roughly).

  • 1:35 am — John Sherrell <dev@ohn.sh>

    dashd: per mediamtx docs, changed webook to GET instead of POST. Makes for a much cleaner mediamtx config and is better suited to the minimal event data available.

  • 12:38 am — John Sherrell <dev@ohn.sh>

    dashd: new Bun server with API endpoints for monitoring status of MediaMTX streams. Includes a streaming SSE endpoint. Not yet used by the front end. Also need to implement the MediaMTX hooks that generate events.

dev commits 4 ohnsh/dev
  • 11:24 am — John Sherrell <dev@ohn.sh>

    cam: Detect when RTSP input is h.265 and include `-tag:v hvc1` in recorded mp4 files.

  • 11:05 am — John Sherrell <dev@ohn.sh>

    cam: huge upgrade to MediaMTX HLS config; after switching from the low-latency variant to fmp4, errors in web browsers have mostly disappeared. (`mpegts` variant also performs well but seemingly can't stream h.265 video.) Also added `curl` command to default `runOnRead` hook, to call my dashd webhook.

  • 6:13 am — John Sherrell <dev@ohn.sh>

    cam: Checking if removing audio delay helps with HLS streaming in Safari.

  • 3:50 am — John Sherrell <dev@ohn.sh>

    cron: Remove progress output from rclone command (badly needed), create variables at the top of daily.sh for ssh_user, ssh_host, ssh_script, clean up comments.

Friday, July 24

Git Commits

dash commits 2 ohnsh/dash
  • 4:51 pm — John Sherrell <dev@ohn.sh>

    next-dash: remove tailwind styles from mdx-components.tsx, beef up hls-switch CSS module, remove explicit size from <video> in HlsVideo component, add mdx for footer.

  • 1:08 pm — John Sherrell <dev@ohn.sh>

    Add ptz-websocket as submodule.

dev commits 3 ohnsh/dev
  • 2:49 pm — John Sherrell <dev@ohn.sh>

    fix(cron): New helper shell function `lsof_t` providing a (relatively) portable check whether a given file is open Uses `lsof -t` unless `lsof` is linked to busybox, in which case it falls back to `fuser`. There are plenty of other places where I currently use fuser but might switch to this.

  • 2:17 pm — John Sherrell <dev@ohn.sh>

    cleanup(cron): Normalize to a single trailing slash in `scp` destination dirs. Minor cleanup in comments.

  • 3:52 am — John Sherrell <dev@ohn.sh>

    cron: standard launchd logging mechanism doesn't work since we're running inside Ghostty.app, so instead redirect stdout and stderr from inside the script. Clean up plist file.

Thursday, July 23

Git Commits

dash commits 7 ohnsh/dash
  • 11:27 pm — John Sherrell <dev@ohn.sh>

    New layout.module.css for scoped rules targeting the main layout (main, header, footer). Remove tailwind classes which made <body> a flex container.

  • 10:20 pm — John Sherrell <dev@ohn.sh>

    next-dash: top-level mdx page linking to both switcher and experiment paths. Setting `aria-current` in switcher and using as a styling hook. Update hls.js initialization to pass cookies in requests, which is required when running in iOS.

  • 9:28 pm — John Sherrell <dev@ohn.sh>

    next-dash: add *-patch streams, debugging output, a CSS module for the HLS stream switcher.

  • 7:45 pm — John Sherrell <dev@ohn.sh>

    next-dash: New route that switches HLS streams using the component that won the experiment (sane client component that uses hls.js NPM package).

  • 6:44 pm — John Sherrell <dev@ohn.sh>

    dash-next: Reorganize and refactor HLS experiment into own section, change content to use MDX.

  • 4:31 pm — John Sherrell <dev@ohn.sh>

    next-dash: A new implementation of the HLS client component that uses the hls.js NPM package instead of a CDN script. This is the obvious right way. Also added proper cleanup to the effect in each client component.

  • 4:16 pm — John Sherrell <dev@ohn.sh>

    dash-next: HLS experiment is now in decent shape. Moved the CDN <script> tag to the layout; it's esssential for it to be above the client-side navigation boundary, or else <Link>s cause it to be removed or re-added to the DOM. Cleaned up the client HLS component by moving initialization to an effect instead of <Script onLoad>.

dev commits 2 ohnsh/dev
  • 3:09 pm — John Sherrell <dev@ohn.sh>

    cron: Add logging to daily.sh.

  • 2:47 pm — John Sherrell <dev@ohn.sh>

    cam: Factor library functions into lib.sh. Remove cam-proxy.sh, which originally ran the container before I started using Docker Compose. Document a sample Go program that listens for status updates on a socket, potentially a big upgrade over a bash script listening on a FIFO.

Wednesday, July 22

Git Commits

dev commits 4 ohnsh/dev
  • 5:29 am — John Sherrell <dev@ohn.sh>

    cam: Fixed bug in wait_folder by resetting num_ready to 0 before the inner loop. Removed pointless functions from start.sh, moved stream_folder input/output folder configuration to environment.

  • 5:25 am — John Sherrell <dev@ohn.sh>

    cron: remove pointless `rclone` function now that special configuration is unnecessary. Error reporting in archive functions, and a combined `archive` function for bug and cam files, which is now the subcommand called by the launchd service.

  • 4:33 am — John Sherrell <dev@ohn.sh>

    cam: make start.sh smarter about using STATUS_FIFO from environment.

  • 12:38 am — John Sherrell <dev@ohn.sh>

    cam: Improve status function to print unconditionally to stderr and tee to the status FIFO if available and open by a reader. Cleaner logic to detect the FIFO status.

dash commits 3 ohnsh/dash
  • 8:40 pm — John Sherrell <dev@ohn.sh>

    next-dash: Getting HLS experiments sorted.

  • 2:31 pm — John Sherrell <dev@ohn.sh>

    Silly tests to get hls.js working in a server component and a client component, both using next/script. The HLS MediaMTX endpoints work well. Currently serving over cloudflared.

  • 9:03 am — John Sherrell <dev@ohn.sh>

    A new project for the hell of it.

days commits 1 ohnsh/days
  • 6:33 am — John Sherrell <dev@ohn.sh>

    Bump dependencies.

Monday, July 20

Git Commits

dev commits 6 ohnsh/dev
  • 8:40 pm — John Sherrell <dev@ohn.sh>

    cam: Change recorded segment name format to `${date}_${camera_name}` so that lexical order is always chronoligical order, even when camera switches. Made `seg_name` a static variable instead of a function.

  • 8:17 pm — John Sherrell <dev@ohn.sh>

    stream-utils: document the use of traps in bash scripts to perform clean-up on SIGINT or SIGTERM.

  • 7:53 pm — John Sherrell <dev@ohn.sh>

    cron: Supporting logic on the remote side.

  • 7:52 pm — John Sherrell <dev@ohn.sh>

    cam: comment documenting env.sh

  • 7:51 pm — John Sherrell <dev@ohn.sh>

    cron: Most of the supporting logic now in place to run remote jobs. Archival of bug output is almost automated.

  • 6:46 pm — John Sherrell <dev@ohn.sh>

    cron: new package for cron-like automation using a launchd service.

Sunday, July 19

Git Commits

dev commits 3 ohnsh/dev
  • 7:11 pm — John Sherrell <dev@ohn.sh>

    cam: Added loop to wait for folder to contain at least two videos (that aren't open for writing) on stream_folder startup. This will make the script more automatable, although it still exits when it runs out of videos.

  • 5:42 pm — John Sherrell <dev@ohn.sh>

    stream-utils: Since paths in ffmpeg concat demuxer playlists are relative to the playlist file, I'm starting to prefer generating temp files in the current directory instead of using process substitution (which makes paths relative to /dev/fd). Added a new function in mkff.sh to that effect and changed most of the script to use it.

  • 5:15 pm — John Sherrell <dev@ohn.sh>

    stream-utils: Some old work I forgot about. strobe_multi function that takes a playlist input.