Skip to content

Latest 🗞️

Wednesday, August 12

Git Commits

dash commits 5 ohnsh/dash
  • 9:48 am — John Sherrell <dev@ohn.sh>

    mkoverlay: update video.sh log format

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

    mkoverlay: quiet curl output in video.sh when sending notification.

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

    mkoverlay: fix bug in video.sh: `if ! cmd1 && cmd2` only negates the result of cmd1, not the whole chain. better to learn late than never. 😬

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

    mkoverlay: Update video.sh to only update the inventory.json index (turso db) once per run.

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

    mkoverlay: overhaul to video.sh, now includes log_notify that fires a webhook with the log message when running in autopilot so that I'm notified. Also validates that recordings are larger than a min file size (currently 3 MB, configurable in environment), or else tosses them into an _error folder so they aren't, remuxed, synced, or added to inventory.json.

YouTube

Tuesday, August 11

Git Commits

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

    dash: bump dependencies

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

    mkoverlay: Added rudimentary "watching" to video.sh to automate runs. For now, it just sleeps for a half hour after each run (typical recordings are 15-20 min). FS watching will differ between macOS, Alpine, and Debian, so for now I'm keeping it simple.

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

    mkoverlay: New wrappers for rclone and video.ts that set up environment and `exec` into the commands. When running a bun script, .env is (apparently) loaded from the working directory, not the script directory, unless an option is passed on the command line. Also added `-xerror` option to ffmpeg remux command in video.sh, meaning fail immediately on errors. Otherwise, ffmpeg will "recover" from serious errors with mixed results and exit 0.

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

    dashd: Use lax wildcard fallback for CORS Access-Control-Allow-Origin. Now that the client isn't sending credentials (cookies), this is enough for web browsers to allow JavaScript access to dashd responses.

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

    dash-next: Now showing timestamps on VOD thumbnails and beneath the main player.

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

    dash-next: switch from <img> to next/image component for thumbnail strips, but pass `unoptimized` so no processing takes place. Add useEffect logic to thumbnail strips to scroll the active (playing) thumbnail into view, or else scroll to the most recent clips in strips that are not currently playing.

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

    dash-next: fixed titles above thumbnail strips.

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

    dash-next: Delete defunct file so that build/deploy works.

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

    dash-next: Now controlling sidebar state with context and a provider. I resisted but it is a much cleaner way to allow components throughout the layout to close the sidebar, especially links nested in sidebar menu components.

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

    dash-next: Layout refactor; Sidebar is now a client component that renders <aside> and receives React state directly. Fixed bug with positioned content in main (VOD <video> element) appearing above the sidebar and backdrop on mobile.

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

    dash-next: New InventoryProvider that works via context to provide a filtered map of date -> inventory.json paths. The map is used by the sidebar menu and the man VOD content area. This allows interactive filtering. Note that useContext runs *on the server* when a client component is prerendered, so there shouldn't be any issues with grabbing the value from context instead of a server-side async query.

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

    cam: Amend the previous to simply detect whether the URL should be `localhost` or `box.local`, rather than require an explicit environment variable.

Monday, August 10

Git Commits

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

    dash-next: layout now confines scrolling to <main>, keeping the sidebar fixed. Overhauled live route layout using flexbox to make <video> fluid while keeping the stats tabs underneath in view.

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

    dash-next: Load <video> using crossOrigin="anonymous" in preparation of filtering audio in JavaScript.

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

    dash-next: Add small radius to main video player, change `overflow: hidden` to `overflow: clip` to mask out cornders of underlying <video> (and <img> for thumbnails).

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

    dash-next: Add outline to currently-selected thumbnail.

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

    dummy commit to trigger deployment.

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

    dash-next: validate date and return 404 when invalid (or when there's no content) on /[date] route, or else it becomes a catch-all route that returns 200 and an empty video player. Also manage <video> element with an effect that runs whenever src changes. This is crucial to properly pause and tear down media streams when the source changes, otherwise phantom audio continues to play.

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

    cam: generalize mmtx_ctrl.sh to read API URL from environment so it can be used remotely.

Sunday, August 9

Git Commits

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

    dash-next: clean-up, give video player container a definite size so that the layout doesn't shift when <video> mounts/unmounts.

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

    dash-next: refactor, now using a single-segment [date] route param instead of a catch-all segment.

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

    cam: prepend -4 to curl options in mmtx-ctrl.sh because I can't figure out a reliable way to make the ip whitelist in mediamtx.yml work with the ipv6 link-local network. (The scope ID, e.g. %eth0, is perhaps causing issues with the Go libraries used by mediaMTX to parse IPs.)

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

    cam: rename ctrl.sh -> mmtx-ctrl.sh to disambiguate.

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

    cam: add check for "available" sources to ctrl.sh. The point is to check what's currently recording, and once I figure out the most reliable way to do that I'll make a more direct subcommand. Also add ctrl.sh to 'bin' in package.json. It was an afterthought that I now use every day.

Saturday, August 8

Git Commits

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

    dash-next: slugs without cams/categories now have their own page type which will list all available categories for that date.

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

    dash-next: InventoryList now queries inventories sorted by date with LIMIT 100, then organizes them by date so that the menu is hierarchical with dates at the top level, in reverse-chronological order.

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

    dash-next: finally, moved old hls experiment out of /live and into /hls-experiment. (Nothing links here.)

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

    dash-next: moved /hls route to /live.

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

    dash-next: remove `vod` prefix from dynamic vod routes--it was pointless, and I can still match `hls` or `category` with higher precedence than the [...slug] parameter.

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

    mkoverlay: big update to video.sh: now working folder is only synced to R2 once per run instead of once per file, and already-archived folders can be linked to a working folder in order to generate VOD assets using the existing logic and without copying files (unless they need to be remuxed).

YouTube

Friday, August 7

Git Commits

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

    dash-next: bump Next, hls.js, biome.

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

    dash-next: A saner VOD implementation is emerging. Now using a Turso hosted libsql database to track inventory.json files in R2. (The root.txt file in R2 would scale terribly, though it could work with a Next route handler or Cloudflare worker in front of it). Re-organized random colocated helpers into @/lib and @/components.

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

    mkoverlay: remove a few tags from exiftool output, along with the corresponding schema properties.

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

    mkoverlay: Log pipeline steps to stderr in video.sh; don't log db result in db.ts.

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

    mkoverlay: prevent errors by explicitly telling libsql to do nothing when we attempt to insert an existing row. Also attempt to insert the inventory record once per run of video.sh, instead of inside the loop.

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

    mkoverlay: added turso/libsql database to index inventory JSON files on R2. Also reorganized a bit.

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

    mkoverlay: sync to r2 on every remux/asset generation.

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

    mkoverlay: New shell script, video.sh, that will process "camera dirs", or daily directories where OBS or mediaMTX save recordings. Processing involves remuxing the fragmented mp4 files, generating assets (just a thumbnail for now), and saving the metadata in an inventory.json file that can be fetched from R2.

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

    mkoverlay: Re-thinking the whole overlay thing. Extracted typescript logic that isn't coupled to the days/overlay tree structure and made a new executable, meant to be called from scripts, that works on a single video and confines writes to the tree where the video lives.

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

    cam: mediamtx config: turn on playback server, change recordingPath to start a new folder every day named %Y-%m-%d (recordings from OBS will follow a similar scheme).

Thursday, August 6

Git Commits

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

    dash-next: Fix minor type diagnostics so that `next build` runs. Clean up grid layout, especially the sidebar grid column computation, which is now just 1/5 of the available space with implicit min of 'auto'.

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

    dashd: add `mak.local` as trusted CORS origin (for testing Next.js app from phone locally). Turn off logging every request.

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

    mediamtx: turn on prometheus /metrics endpoint, allow access from the new prometheus docker bridge network.

Wednesday, August 5

Git Commits

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

    dash-next: add styling to sidebar, add 'mak.local' to allowedDevOrigins in next.config.ts so that testing from phone works.

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

    dash-next: responsive grid in decent shape; main video content flexes nicely and `overflow: hidden` on <main> prevents the layout from overflowing the grid container.

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

    dash-next: Reasonable mobile layout implemented. The menu button needs some work. Main content <video> needs to be made fluid.

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

    dash-next: Sidebar is now back to a server component which is rendered and passed into the client layout component. Split Header into new component that will toggle sidebarOpen state.

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

    dashd: log request IP to get an idea of trusted proxies with which to configure mediaMTX

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

    dash-next: main layout now imports a client component containing the true layout in order to accomodate sidebar state (at mobile sizes), eventually theme preference.

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

    dash-next: New, screen reader-accessible StatusIndicator component that renders a red unfilled circle when offline, or a green filled circle when online.

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

    dash-next: convert descendant selectors to child selectors in main grid layout definition (since <header>, <footer>, and <aside> can appear throughout the document). Shorten date format returned in VOD playlist titles.

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

    dash-next: sidebar now a synchronous component wrapping dynamic menus in <Suspense>

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

    cam: Add traffic from tunnelnet/cloudflared to mediaMTX hlsTrustedProxies and webrtcTrustedProxies so that true source IP addresses are logged and returned via control API.

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

    sh: minor update to dxif.sh to generate category directories for desk_* and quad_* video files, and to sort wyze[0-9] and wuuk files appropriately regardless of suffixes like -patch or -patch-rec.

Tuesday, August 4

Git Commits

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

    dash-next: WIP get menus of live and VOD streams into root layout sidebar.

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

    dash-next: converted main layout to grid. Using track numbers; it would probably be an upgrade to use named areas. Also badly needs some responsive logic.

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

    dash-next: stats now lists all streams. Improved table formatting, added `title` attributes to the online/offline icons.

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

    dash-next: Extract Tab component into separate module.

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

    dash-next: clean up and comment CSS.

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

    dash-next: custom tab interface for stats and event stream tables.

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

    dash-next: converted stats and event stream views to tables.

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

    dash-next: refactor useStats to not return a strict discriminated union; it wasn't really appropriate (but a good learning experience). Removed the feature that marks pending fetches as stale and re-fetches when complete. I'd like to get some experience with TanStack Query before deciding how to tackle that sort of thing.

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

    dash-next: generate zod schema for mediaMTX Path API type. Make event stream a <table> and factor out a component for each row. CSS tweaks.

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

    dash-next: Refreshing stats in useStats hook in response to SSE events is now working.

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

    cam: new path 'quad' for 2x2 OBS scene.

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

    cam: automatically select `-patch-rec` paths for recording switch helper in ctrl.sh.

Monday, August 3

Git Commits

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

    dash-next: new blinking cursor style for h1.

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

    dash-next: Rename dynamic route param from vodSlug to slug. Make Meta type a proper discriminated union with `type` determining the presence of `playlist`.

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

    dash-next: update schema for inventory JSON, get VOD routes rendering again.

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

    dash-next: fix up handling of streams returned by API.

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

    cam: fixed 3 major bugs in one line of stream_folder.sh; I honestly don't understand how it's been working the past couple of weeks. Added logic to find a sensible folder to stream when given a bare specifier. E.g. given `wyze1`, if recordings/wyze1 is empty, try recordings/wyze1-patch-rec.

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

    cam,cron: Minor fixes to make helper scripts consistent with new recording folder structure created by mediamtx.

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

    cam: update mediamtx.yml to record streams to 'desk' endpoint (from OBS on macOS). New organizational scheme for recordings with subdirectories for each camera, which works much better with stream_folder.sh (folder to YouTube Live).