Skip to content

Keep decimals in --at timestamp labels; add --name for a stable montage file name - #1

Open
morinpic wants to merge 1 commit into
mainfrom
feat/at-decimal-timestamps-and-name
Open

Keep decimals in --at timestamp labels; add --name for a stable montage file name#1
morinpic wants to merge 1 commit into
mainfrom
feat/at-decimal-timestamps-and-name

Conversation

@morinpic

@morinpic morinpic commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Why

Feeding --at a list of sub-second times (from an external detector) worked, but two things got in the way of using vshot inside a pipeline:

  1. Burned-in and montage labels were M:SS, so --at 422.5,422.9 both showed as 7:02. The decimals were already kept in the frame filenames, just not in the labels.
  2. The montage file name carries a random run id, so a caller has to parse --json or glob *_montage_*.jpg to find it.

What

  • format_ts keeps one decimal for fractional input: 3.50:03.5. Integer input still renders as 0:03.
  • New --name NAME: the montage is written to <output>/<NAME>.jpg. Path separators are rejected, a trailing .jpg is tolerated, re-runs overwrite.
  • --help, README options table and examples updated.
  • Smoke tests: --name (creates, no random-suffixed file, re-run keeps one file, rejects ../), fractional and integer filename suffixes.

Checked

  • bash -n vshot
  • tests/smoke.sh: 66 passed, 0 failed (macOS, Homebrew ffmpeg 8.1 without drawtext, ImageMagick 7)
  • Real use: 31 --at times over a 20-minute clip → one montage in 5 s, labels like 7:00.5

https://claude.ai/code/session_01XQ8xsAfAFY4JANNooHJTax

… montage file name

- format_ts: fractional seconds (e.g. --at 3.5) render as M:SS.d instead of
  being truncated to M:SS, so two pinpoint frames inside the same second stay
  distinguishable in burn-ins and montage cell labels. Integer input is unchanged.
- --name NAME: write the montage as <output>/<NAME>.jpg instead of the
  run-id suffixed default. Rejects path separators; a trailing .jpg is
  accepted. Re-runs overwrite the file, which is what pipelines want.
- README and --help updated; smoke tests for both.

Claude-Session: https://claude.ai/code/session_01XQ8xsAfAFY4JANNooHJTax
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.

1 participant