Skip to content

Add Segments view: multi-timestamp video preview grid - #980

Open
kelvincht wants to merge 2 commits into
whyboris:mainfrom
kelvincht:feature/segments-view
Open

Add Segments view: multi-timestamp video preview grid#980
kelvincht wants to merge 2 commits into
whyboris:mainfrom
kelvincht:feature/segments-view

Conversation

@kelvincht

Copy link
Copy Markdown

Summary

Adds a new gallery view, Segments, that shows every extracted clip snippet of a video side by side in one row — all sampled timestamps visible and playable at once — complementing the existing Filmstrip (static, all timestamps) and Clips (single playing preview) views.

  • Reuses the existing clips/<hash>.mp4 file (no new extraction, no .vha2 schema change): the clip already concatenates N uniform snippets back to back, so each cell just seeks/loops within its own segment window client-side.
  • Default mode parks each cell on its still frame (near-zero CPU); hover-to-play and an opt-in "autoplay all" mode reuse the existing Clips-view settings buttons and pause on window blur.
  • Clicking a segment opens the video at its real source timestamp.
  • Clip encoding now sets -pix_fmt yuv420p -movflags +faststart so newly-extracted clips are hardware-decodable and start instantly.
  • Raised the wizard's clip-snippet cap from 15 to 20.
  • Registered like the other views: ribbon button, per-view zoom, keyboard shortcut (8), settings persistence.

Compatibility

.vha2 and extracted assets are untouched. New settings.json keys are additive with fallbacks for older files, and an unrecognized currentView value falls back to Thumbnails instead of showing a blank gallery. Verified with real pre-feature and post-feature builds round-tripping the same settings.json in both directions with no crashes or data loss.

Test plan

  • tsc --noEmit (renderer + main process)
  • Production Angular build
  • Manual verification in a packaged build: import → Segments view renders correct per-snippet timestamps, hover/autoplay loop within each snippet's window, zoom, single-view-toggle, click-to-timestamp
  • Forward/backward settings compatibility verified against a real build of the pre-feature codebase (round-tripped a real settings.json old → new → old)

Adds a new gallery view mode showing every extracted clip snippet of a
video side by side in one row, so all sampled timestamps are visible
and playable at once (inspired by fc2daily-style preview grids),
complementing the existing Filmstrip (static, all timestamps) and
Clips (single playing preview) views.

No new extraction or .vha2 schema change: it reuses the existing
clips/<hash>.mp4 file, since that already concatenates N uniform
snippets back to back. Each cell seeks into and loops within its own
segment window client-side.

- New `SegmentsComponent`, registered as `showSegments` alongside the
  other gallery views (ribbon button, zoom, keyboard shortcut `8`,
  settings restore).
- Clicking a segment opens the video at its real source timestamp via
  a new optional `timeSeconds` field on `VideoClickEmit`.
- Default mode parks each cell on its snippet's still frame (near-zero
  CPU); hover-to-play and an opt-in "autoplay all" mode reuse the
  existing Clips-view settings buttons and pause on window blur.
- Clip encoding now sets `-pix_fmt yuv420p -movflags +faststart` so
  newly-extracted clips are hardware-decodable and start instantly.
- Backward/forward compatible: `.vha2` and extracted assets are
  unchanged; new `settings.json` keys are additive with fallbacks for
  older files, and an unrecognized `currentView` value falls back to
  Thumbnails instead of showing a blank gallery.
- Raised the wizard's clip-snippet cap from 15 to 20.
@whyboris

Copy link
Copy Markdown
Owner

@kelvincht OH WOW 🤩 I'll try this out - sounds interesting from the description 😁

I suspect I'll like it enough to merge in before the 3.3.0 release 🚀 🤞

I just finished updating my https://github.com/whyboris/Simplest-File-Renamer and am trying to get https://github.com/whyboris/Simple-Image-Browser released at the same time as Video Hub App - probably mid August (all three at the same time). I'll likely get to this PR later this month / early next month.

Please let me know if you prefer I try before then 🤝

Cheers ❤️

… current zoom

When a video has more snippets than fit at the current zoom, the row
always showed the first N (e.g. segments 0-9 of 20) -- the back half of
the video was never visible without zooming out. `segmentIndexes()` now
evenly samples across the full range when zoomed in, always including
the first and last snippet, using the standard "k evenly-spaced points
across N items" formula. `maxVisibleTiles` (home.component.ts's
`currentImgsPerRow`, already computed for this exact purpose) is passed
in to know how many tiles actually fit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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