Tesla Theater

← Home · ~/tesla-theater · updated 1 month ago

Tesla Theater

Serves downloaded videos as plain <video> pages the Tesla in-car browser can play, since the car blocks YouTube in its browser. Now playing: Cheap vs Expensive Foods (Blind Taste Test), Beyond Babish, 44:32.

Layout

Path Role
index.html Player page: <video src="video.mp4"> plus a caption
video.mp4 The current video, 720p H.264 Main-profile mp4
.venv/ RangeHTTPServer; stdlib http.server lacks Range support and seeking needs 206 responses
bin/yt-dlp Standalone yt-dlp binary
bgutil/ PO-token provider YouTube now requires; its yt-dlp plugin half lives in ~/.yt-dlp-plugins/

Serving

The LaunchAgent me.inmimo.tesla-theater runs .venv/bin/python -m RangeHTTPServer 8093 from this directory. The public Funnel mounts it at a random-suffixed path:

/Applications/Tailscale.app/Contents/MacOS/Tailscale funnel --bg --https=443 --set-path=/watch-53f08b4f http://127.0.0.1:8093

Tear down with the same command ending in off.

Replacing the video

node bgutil/server/build/main.js &   # PO tokens on :4416
bin/yt-dlp -f "bv*[vcodec^=avc1][height<=720]+ba[ext=m4a]" \
    --merge-output-format mp4 -o raw.mp4 <youtube-url>
kill %1
ffmpeg -i raw.mp4 -c:v h264_videotoolbox -profile:v main -b:v 2800k \
    -c:a copy -movflags +faststart video.mp4 && rm raw.mp4

Then update the <title> and caption in index.html. The transcode is not optional: the car's browser decodes H.264 Main profile but not High, and every YouTube avc1 stream is High — served directly, the audio plays over a black frame (the 2026-08-15 failure).

Constraints

  • The Funnel path is public internet; the random suffix is the only access control, the same bearer-link model as ~/www.
  • One video at a time by design: video.mp4 is overwritten, old videos are not archived.