README.md

laughtown #

A 24/7 public domain comedy loop streaming to stream.place/laugh.town. Keaton, Chaplin, Lloyd, Laurel & Hardy, the Marx Brothers and friends, around the clock, from a Mac mini.

Inspired by JP Hastings' 30s loop.

How it works #

manifest.json          68 curated PD films, each pinned to an archive.org item + file
scripts/resolve.py     proposes/verifies archive.org items for the manifest
scripts/download.py    pulls the library into raw/ (resumable, idempotent)
scripts/encode.sh      normalizes raw/ -> encoded/ (720p30 h264 2.5Mbps + AAC, VideoToolbox)
scripts/gen_card.sh    renders _card.mp4, the branded interstitial between films
scripts/stream.sh      shuffles encoded/ into a playlist and streams it as one
                       continuous RTMPS session with -c copy (near-zero CPU)
launchd/               LaunchAgent that keeps stream.sh running forever

Because every file in encoded/ shares identical codec parameters, the loop streams with -c copy: the mini never transcodes while live (~1% of one core).

Runbook #

# one-time setup on the mini (repo lives at ~/laughtown)
python3 scripts/download.py        # ~34 GB from archive.org
bash scripts/encode.sh             # several hours, hardware-encoded, nice'd
bash scripts/gen_card.sh           # interstitial card
echo 'STREAMKEY' > ~/laughtown/.streamkey && chmod 600 ~/laughtown/.streamkey

# install + start the service
cp launchd/town.laugh.stream.plist ~/Library/LaunchAgents/
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/town.laugh.stream.plist

# watch it
tail -f ~/laughtown/logs/stream.log

# stop it
launchctl bootout gui/$(id -u)/town.laugh.stream

Adding a film #

  1. Screen it for documented content warnings first, and confirm the copy has an audio track.
  2. Add an entry to manifest.json (leave identifier null).
  3. python3 scripts/resolve.py candidates, pick an item, fill identifier.
  4. python3 scripts/resolve.py files to pin the file.
  5. python3 scripts/download.py && bash scripts/encode.sh. The next cycle picks it up.

Notes #

  • Channel policy: every film must have an audio track. encode.sh skips mute sources and flags them in logs/noaudio.log for re-sourcing from a scored copy. (This is why The Gold Rush is absent: the PD 1925 cut circulates mute and the scored 1942 reissue is still copyrighted.)
  • Stream identity is the laugh.town atproto account; the key in ~/laughtown/.streamkey comes from the stream.place Live Dashboard.