Skip to content

Latest 🗞️

Monday, August 17

Git Commits

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

    dashd: add wyze2 configs to env.sh and compose.yml, plus the dashd snapshot route handler.

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

    next: add wyze2, remove desk and quad from live route for now.

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

    next: useCrop kind of works but it prevents native seek controls from working. The ultimate answer will be rendering custom controls on a <canvas> or <video> with srcObject fed from a canvas. Leaving out of VODPlayer for now.

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

    next: useCrop is rough but functional. Keeping in a separate branch while I decide on a UI.

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

    next: first pass at a useCrop custom hook that crops a rectangle out of a hidden source <video> and renders it to an on-screen <video> via video.srcObject and canvas.captureStream(). (It doesn't work.)

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

    cam: add wyze2 config to compose.yml extra_hosts and mediamtx paths.

YouTube

Sunday, August 16

Git Commits

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

    next: extracted a VODView component that implements the main view at both / and /[date], (/ filters by voice activity and /[date] filters by date). The tsToString helper now takes only two paramters and passes `undefined` to `toLocaleString` to use the default (user) locale for date formatting (although not the timezone).

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

    vod,next: raise minimum confidence threshold for voice detection. To fix existing data and allow for greater front-end flexibility, start computing speechTotal for a given minimum confidence instead of just using the value computed at detection time. Rename `speechThreshold` property to `minConfidence`, update zod schema to handle both names.

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

    next: add star icon with accessible text description to list of voice segments, to match the icon in the thumbnails.

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

    Deployment oops. Next package now named @dash/next.

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

    next: add voice segment interface to the vod/archive (/[date]) route. The route now mirrors the home route with a flex-based layout and passing a Promise<DashVideo> to <VODPlayer>. Also add star indicator to thumbnails for videos with detected voice segments.

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

    Rename packages using org name @dash scoped to this monorepo.

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

    dash-next: player skeleton fills content area when <video> is absent.

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

    voice-detect: don't pad segments to below zero or above duration.

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

    dash-next: make home route layout fluid with the video occupying the content area while maintaining aspect ratio and room for one thumbnail strip at the bottom of the viewport. Use react state and 'timechange' event to highlight the active voice segment if there is one. Also handle negative numbers in segment data.

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

    cam: update cam.sh style to us ALL_CAPS for global script variables, add comments.

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

    cam: simpler notification mechanism that works without fifo and monitor script. Also organize global variable initialization into a function.

Saturday, August 15

Git Commits

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

    dash-next: helper scripts in package.json for using db dev server, turn home route into a flex layout that respects the viewport height, similar to the way /live has been for a few days.

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

    dash-next: rudimentary interface to skip between voice segments on the home route.

Friday, August 14

Git Commits

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

    dash-next: root route now shows only video with speech, along with a (very rough) interface to skip to each speech segment.

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

    dash-next: Add library functions for converting between short and long keys for URL query parameters, and for converting between keys and video sources.

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

    vod: extracted a helper to compute total speech duration from a VoiceResult, necessary because sometimes the `speechTotal` property is absent. util.ts is a package export.

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

    dash-next: new DashVideo type, derived from VODVideo with helpful computed properties. Refactor ThumbStrip to accept a promise that resolves to DashVideo[] instead of implementing its own inventory fetching/parsing logic.

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

    dash-next,dash-vod: big refactor to consolidate schemas and keep imports clean. If my vod processing code is anywhere in the import path from Next, it will crash the build. Schemas are now in vod/lib/schema.ts, which doesn't import any code that might cause build issues for depending projects.

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

    dash-next: front end now using drizzle and the migrated database.

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

    cam: new wrapper function to supervise recordings and restart them in case of a recoverable error. For now, the only recoverable error is when the date changes mid-run and ffmpeg starts trying to save to a folder that doesn't exist (since the path is computed from the date).

Thursday, August 13

Git Commits

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

    voice-detect,vod: log in consistent format.

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

    vod: tweak path handling in video.sh, remove leading _ in camera dir names when computing r2 path.

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

    vod: crucial to await db insert before letting script exit 😆

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

    vod: upsert database entries so that speech total is updated as the file progresses.

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

    vod: now using drizzle, along with a slightly more serious table. There's a new column for total speech duration (in seconds), along with supporting code in video.ts.

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

    vod: added reset subcommand to video.sh that moves processed files not in inventory.json into an _error_asset subdirectory for processing. (Otherwise the files will be synced to R2 but completely ignored.) Also improved error handling to use specific _error_{error_type} subdirectory names depending on the error.

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

    Updated workspaces.

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

    dash-next: add drizzle orm.

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

    dash-vod: rename from mkoverlay

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

    mkoverlay: Add try/catch around ffprobe audio stream detection; return false on error. voice-detect: Log stats about speech segments after inference runs.

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

    mkoverlay: dynamically import() voice-detect and gracefully recover from errors so the pipeline (minus inference) will run on Alpine (onnxruntime-node requires a glibc system). The ultimate solution will be to run the typescript portion of the pipeline in a debian-based docker container. Also remove -xerror from ffmpeg args for now. Unfortunately, lots of video from thingino and mediaMTX has out-of-order timestamp issues, which ffmpeg can eaily recover from. For now, my manual file size check should filter out most of the truly worthless files. If I leave -xerror, I will lose a lot of footage that doesn't need to be lost.

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

    mkoverlay,voice-detect: Add new voice-detect package that uses Silero VAD, via TypeScript and onnxruntime-node, to detect segments of voice activity in audio or video files. Also updated mkoverlay batch video pipeline to use the new package and include the segment information in inventory.json

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

    mkoverlay: fixed early loop continuation bug in video.sh on error.

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

    cam: dust off cam.sh to take over recording duties again. MediaMTX cannot seem to reliably record thingino streams, whereas ffmpeg complains about them but produces rock solid output.

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

    sh: stop sending files to _capture_2x2, let them go to 'quad' based on the way OBS now saves recordings.

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.

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).