Skip to content

Latest 🗞️

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.

YouTube

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.

Saturday, July 18

Git Commits

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

    cam,bug: Clean up status messages by using `$(basename $0)` instead of $0. Switch on allexport shell option (`set -a`) in env.sh files so that sourcing them is effective with no fuss. (Switched off again at end of files.)

YouTube

Friday, July 17

Git Commits

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

    sh: fix script dir detection when wyze_timelapse.sh is being sourced (${BASH_SOURCE[0]} instead of $0). In timelapse.sh, use `-qp 28` for timelapse_vaapi variant, for slightly smaller output (default `qp` is 25).

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

    cam: Convert container management to use compose.yml.

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

    cam: For now, quit stream_folder.sh when we run out of files. If I restart the stream after a delay, the broadcast is already over and YouTube just throws the stream away. A new broadcast could be created programatically with `youtube-client`, which is what stream_folder.sh already does on start-up, but I'm reluctant to put that in a loop and leave it on autopilot.

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

    bug: Now starting container with docker compose.

Thursday, July 16

Git Commits

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

    cam: Yikes, forgot the shebang in cam.sh. It ran, but not in a way that I could find with pgrep. It's definitely not a POSIX script.

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

    cam: Removed redact_tty wrapper around ffmpeg in stream_folder.sh. It's a fun idea but the `script`-based implementation introduces unnecessary complexity around signals and controlling terminals. Also added documentation and a guard to disable writes to the status FIFO when there's no reader, preventing hangs.

Wednesday, July 15

Git Commits

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

    cam: Document correct usage of monitor.sh: The status FIFO must be open for read/write (<>$STATUS_FIFO).

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

    cam: Status updates via named pipe and new monitor.sh, which reads from the pipe and logs to both stderr and ntfy.sh.

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

    bug: New helper script to separate old recordings not open for writing so that they can be archived.

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

    sh: In wyze_timelapse.sh, save ffmpeg concat playlist to temporary file in working directory to enable relative file paths. (Process substitution is more elegant but not worth the hassle here because it causes ffmpeg to interpret paths as relative to /dev/fd.)

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

    sh: Refactored wyze_timelapse.sh, split generic timelapse functions into separate library script timelapse.sh. Added default strobe effect (2 fps). Update to dxif.sh bringing compatibility with aac, opus, and ogg files.

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

    cam: Refactored relay.sh and record.sh, replacing both with cam.sh. Implemented audio delay when combining Thingino video with external (Pulseaudio) audio, resulting in roughly synchronized audio/video. (Delay implemented both in cam.sh and mediamtx.yml.) Lots of duplicate code removed and lots more edge cases now handled gracefully.

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

    cam: Recording functions moved to new file, record.sh. In mediamtx.yml, publish combined ("patched") streams with video from camera/Thingino and audio from macOS Pulseaudio server. Set PULSEAUDIO_SERVER in environment when creating Docker container.

Tuesday, July 14

Git Commits

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

    cam: Added a path to mediamtx for thingino/Wyze camera. Moved all mediamtx configuration into mediamtx.yml (source URL was previously passed in environment). Moved recording back out of mediamtx into an external ffmpeg process that combines video from mediamtx with high-quality microphone audio from a macOS PulseAudio server.

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

    cam: Add several utility functions to ctrl.sh to query the status and configuration of mediamtx via REST API calls, with output formatted through jq.

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

    cam: Turn on mediamtx control API, switch container to host network, new script ctrl.sh providing a command-line interface to stop/start wuuk recording by switching the `runOnDemand` config option.