Skip to content

Playlist player: shader Setups and full-screen videos, shuffled together - #169

Merged
charliehuge merged 1 commit into
mainfrom
claude/playlist-app
Nov 8, 2026
Merged

charliehuge merged 1 commit into
mainfrom
claude/playlist-app

Conversation

@ii-impy

@ii-impy ii-impy commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What

ShowControl/FundingCAPTCHA/playlist_app.py is a new app. It plays shader Setups and full-screen videos from one shuffle bag, so every item plays once before any repeats.

  • playlist.json defines the list: setups (folders under shaders/), videos (files in videos/) and setup_duration_s (300).
  • Setups play for setup_duration_s, which overrides their own duration_s.
  • Videos play to the end of their file. They are silent and letterboxed, decoded with PyAV on a background thread and timed by frame timestamps.
  • videos/ is gitignored except for its README. Video files are copied onto the show PC by hand.
  • Failures: a missing or broken item is logged and skipped. A Setup that fails while rendering is dropped for the run. If nothing can play, the screen goes black and the app retries every 5 s.
  • Camera: it runs throughout, so calibration happens once at startup.
  • Keys: N / → next item, R reload the current Setup, Esc quit.

Refactor

shader_app.py's main() is split into open_display, start_camera, drain_camera and ShaderStage, which both apps now share. shader_app.py behaves the same as before.

Other changes

  • av>=12 added to requirements.txt.
  • New "Playlist player" section in docs/FundingCAPTCHA.md.

Testing

  • test_playlist_app.py adds 13 tests: the playlist file, letterbox geometry, frame pacing and end-of-file on a real encoded clip, and the rotation rules (setup duration override, video runs until done, missing videos skipped, render failure drops the Setup, retry when nothing plays).
  • Ran it windowed with --mock-camera and a test playlist. A 3 s video played for about 3.1 s and then a Setup took over, Setups ran at 30 fps, and the missing video was skipped.
  • Reading screen pixels back confirmed the letterbox and orientation: a 1920×800 frame in a 1280×720 window gets 93 px bars top and bottom, the right way up.
  • Python suite: 477 passed. One failure, test_hunter_bird.py::test_person_has_white_fill_and_ink_outline, also fails on main without this change. test_layout_tool.py was skipped because fastapi isn't installed on the test machine.
  • The Node tests in make test were not run (no Node on that machine).
  • Not yet tried fullscreen on the show display or with the real video files.

To make this the show, deploy/captcha.service would need ExecStart pointed at playlist_app.py --camera. That change is not in this PR.

🤖 Generated with Claude Code

playlist_app.py plays one shuffle bag of Setups and videos from
playlist.json. Setups play setup_duration_s (300 s) each, overriding their
own duration_s; videos play to the end of their file, silent and
letterboxed, decoded with PyAV on a background thread. Missing or broken
items are skipped; the camera runs throughout so calibration happens once.

shader_app.py's main() is split into open_display / start_camera /
drain_camera / ShaderStage so both apps share them; behaviour unchanged.
Video files live in the gitignored videos/ folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@charliehuge
charliehuge merged commit 56de83c into main Nov 8, 2026
1 check passed
@charliehuge
charliehuge deleted the claude/playlist-app branch November 8, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants