Skip to content

Latest 🗞️

Sunday, August 2

Git Commits

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

    cam: new mediamtx paths, (wuuk|wyze1)-patch-rec, that record on-demand from corresponding *-patch paths. Recording can be switched on or off for a given path by calling the API with PATCH /v3/config/paths/patch/{path} and setting `sourceOnDemand` to no or yes, respectively.

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

    cam: WIP getting on-demand recording working via pure mediaMTX config, without running external ffmpeg readers.

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

    cam,bug: quiet ffmpeg; docker logs were getting huge.

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

    cam: add static ip of dashd container to mediaMTX auth config, allowing it to access the API endpoint.

dash commits 2 ohnsh/dash
  • 10:07 am — John Sherrell <dev@ohn.sh>

    dash-next: Move back to @latest next.js release. (I had moved to the preview release for an experimental config that adds support for Typescript 7. That config now appears to work in @latest.)

  • 2:04 am — John Sherrell <dev@ohn.sh>

    dash-next: Sidebar layout, configure rewrite from root route to /hls, fix up default stream handling to use the first one returned instead of a constant value.

YouTube

Saturday, August 1

Git Commits

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

    dashd: now dockerized. There's a new named docker network, tunnelnet, for cloudflared and anything that cloudflared proxies, including dashd. mediaMTX config now whitelists the IP address of dashd inside that network. For now, src/ is bind-mounted into the container, and the container command uses `bun --watch`, so dashd is automatically reloaded whenever a source file changes.

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

    dashd-next: minor fixes to get rid of diagnostics.

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

    dashd: snapshot endpoint is working. It fetches from the Thingino snapshot endpoint using the device-generated API key in the `token` query parameter. It also adds cache-control headers to prevent Cloudflare from caching the response. Also a new helper script, append-hosts.sh, that resolves .local addresses (cameras) and appends them to /etc/hosts.

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

    chore: bump dependencies

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

    dashd: toward dockerizing dashd. Doesn't yet quite work; need to look at bun's docker docs regarding recommended container user.

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

    dash-next: moved <Script> element out of main layout. Not that it matters but it seems to be working now in the individual HLS experiment components, both client and server. Much cleaner.

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

    dash-next: No longer setting hls.js to send credentials (cookies) with every request. It works fine and is much cleaner.

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

    bug: minor syntax improvement in `if` statement.

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

    stream-utils: add videotoolbox hardware acceleration option for transcoding to HLS. Automatically detects videotoolbox or vaapi. Calculate GOP (keyframe interval) from probed frame rate.

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

    cam: updated mediamtx.yml to match latest default config file. Hooks `runOnAvailable` and `runOnOnline` have been added.

  • 12:09 pm — John Sherrell <dev@ohn.sh>

    cam: Reverting to not run a snapshot script in a mediaMTX hook. A much better option is to switch the sources back to on-demand and run an external script that grabs snapshots directly from the thingino snapshot endpoint.

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

    cam: Add snapshot config to mediamtx.yml, update hook name from `runOnReady` to `runOnAvailable` to align with recent MediaMTX releases. Update compose.yml to bind-mount snapshot directory into container.

Friday, July 31

Git Commits

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

    next-dash: fix up dashd api/fetch types, recover from errors when dashd is down.

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

    mkoverlay: bug fixes. Refactored `Metadata` object creation into an inner function in `getMetadata` to make types cleaner and simplify the main logic.

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

    mkoverlay: ffprobe now extracting r_frame_rate, bit_rate, and pix_fmt metadata, with r_frame_rate evaluated and converted to a number ("30000/1001" is 29.97).

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

    mkoverlay: Metadata type is now a discriminated union with a `type` property. When 'hls', there is an additional `playlist` key with the path to the .m3u8 file. The script has now been tested a few times and generates thumbnails like a mf.

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

    mkoverlay: fixed some bugs related to building paths and handling non-existent directories.

dev commits 3 ohnsh/dev
  • 3:28 am — John Sherrell <dev@ohn.sh>

    sh: tweak ffmpeg command line for videotoolbox variant to use hardware decoding. Document the options a bit more.

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

    stream-utils: new script for generating VOD HLS streams from whole directories using VAAPI hardware acceleration.

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

    stream-utils: fixing up 'mkvod' scripts from a few weeks back, preparing for production HLS generation.

Thursday, July 30

Git Commits

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

    mkoverlay: big refactor to create a more flexible file structure and inventory data structure to accomodate, for example, HLS renditions of an entire folder. Completely untested for now.

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

    sh: changed default params in timelapse.sh. The default rate is now 8x and the strobe effect is 4 fps (or 1 frame every 2 real seconds).

YouTube

Wednesday, July 29

Git Commits

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

    next-dash: VOD route is becoming somewhat functional. Refactored into a layout and components for the main 'inventory list' (now in a sidebar with no css yet) and individual playlists, with <video> element.

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

    mkoverlay: clean-up; this project has effectively moved to the dash repo.

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.

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.

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.