Commit Graph

258 Commits

Author SHA1 Message Date
Ethanfel b6e7b660a8 fix: scale end-frame preview to 320x240
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 00:18:48 +02:00
Ethanfel 2304286147 fix: make end-frame preview a floating tool window
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:55:43 +02:00
Ethanfel abe9e6ee66 feat: end-frame preview panel showing last frame of clip spread
Small panel to the right of the video displays the frame at cursor +
clip_span. Updated with 300ms debounce on cursor move, spread/clip
count change, and file load. Uses ffmpeg to grab a single PNG frame
off the main thread.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:52:56 +02:00
Ethanfel 01961e9192 fix: move QSettings init before timeline setup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:44:46 +02:00
Ethanfel d3e48f5276 fix: random portrait uses configured crop position, only randomizes which clip
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:43:16 +02:00
Ethanfel 0996670020 fix: random portrait always uses 9:16
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:40:47 +02:00
Ethanfel ffb99d3e66 fix: scale random portrait count — 1 per 3 clips (e.g. 2 for 6 clips)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:39:42 +02:00
Ethanfel 439bc85505 feat: random portrait — one clip per batch gets a random crop ratio + position
Checkbox '1 random portrait' in settings row. When checked, one random
clip in each batch receives a randomly chosen portrait ratio (9:16, 4:5,
or 1:1) with a random crop center. The rest use the global portrait
setting. Disabled for single-clip overwrite exports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:38:56 +02:00
Ethanfel 13973dd53d fix: read clip_count/spread from settings before timeline init
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:34:03 +02:00
Ethanfel 9e07910df1 feat: make clip count configurable (1–10, default 3)
Clips spinbox in settings row alongside Spread. Preview span and export
batch size adjust dynamically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:28:12 +02:00
Ethanfel 25250d6d8d fix: use lossless PCM audio in MP4 exports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:26:02 +02:00
Ethanfel 93cee40b06 feat: export 3 overlapping 8s clips per press with configurable spread
Each export generates clip_NNN_0, clip_NNN_1, clip_NNN_2 offset by the
spread value (2–8s, default 3s). Preview plays the full span covered by
all three clips. Marker click still overwrites a single clip.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 23:22:41 +02:00
Ethanfel 47ea6199fa feat: add Delete button to remove exports from disk, DB, and dataset.json
Targets last export by default; targets marker-selected clip when one is
active (shown as "Delete <name>"). Clears on cursor move if no last export.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:23:16 +02:00
Ethanfel 8bc42cabd9 fix: store absolute paths in dataset.json
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:10:06 +02:00
Ethanfel 8148971aae refactor: remove fps from annotation — path + label only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:09:08 +02:00
Ethanfel a8d8bd7fdc Revert "fix: pass source fps to ffmpeg export via fps filter"
This reverts commit fc9287a5a6.
2026-04-07 14:08:00 +02:00
Ethanfel f0484fac86 Revert "feat: write fps.txt alongside WebP sequence audio"
This reverts commit cf62940b84.
2026-04-07 14:08:00 +02:00
Ethanfel fd25e8fa37 feat: add migration script to generate dataset.json from DB history
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:04:29 +02:00
Ethanfel c3c480acc7 feat: replace dataset.tsv with dataset.json annotation file
Each exported clip writes an entry to <folder>/dataset.json containing
its relative path, sound label, and fps. Re-exporting to the same path
updates the existing entry (upsert). Empty labels are skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:01:50 +02:00
Ethanfel cf62940b84 feat: write fps.txt alongside WebP sequence audio 2026-04-07 13:56:13 +02:00
Ethanfel fc9287a5a6 fix: pass source fps to ffmpeg export via fps filter 2026-04-07 13:54:38 +02:00
Ethanfel 1256819dde ui: warn mask generation is untested, recommend ComfyUI 2026-04-07 12:35:44 +02:00
Ethanfel 58043dd7e3 docs: warn mask generation is untested, recommend ComfyUI 2026-04-07 12:35:13 +02:00
Ethanfel a652872d15 docs: add GPL v3 license and GitHub source link 2026-04-07 12:34:13 +02:00
Ethanfel 9d7791557b revert: restore ff0cd00 (label history, overwrite mode, crop overlay)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 12:11:36 +02:00
Ethanfel 2352d530d0 feat: queue done marks, export UX, scrub-while-playing, counter fix
- Queue ✓: mark files green after export and on drop if already in DB
- Export folder auto-created if missing
- Scrub while playing: cursor drag seeks and continues playback
- Counter auto-advances past existing files on disk
- Instant pending marker on timeline when export starts
- WebP quality 92 + lanczos scaling
- seek() guard against unloaded state (SystemError fix)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:41:07 +02:00
Ethanfel 6e02a08046 Revert "feat: label history, overwrite mode, crop overlay, UX improvements"
This reverts commit ff0cd00309.
2026-04-07 11:36:40 +02:00
Ethanfel ff0cd00309 feat: label history, overwrite mode, crop overlay, UX improvements
- Editable label combo with DB history (most recent first)
- Click marker to arm overwrite mode (↺ indicator, re-exports same file)
- Portrait crop overlay: red bands on cut regions (paused only)
- Cache video dimensions to avoid mpv property reads in paintEvent
- Queue marks done files with ✓ on drop and after export
- Export folder created automatically if missing
- Play continues from new position when scrubbing during playback
- Counter auto-advances past existing files on disk
- Instant marker on timeline when export starts (optimistic)
- Marker right-click delete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:34:47 +02:00
Ethanfel 6573fa6e05 feat: mpv Wayland embedding, timeline redesign, UX polish
mpv embedding:
- Replace wid/QOpenGLWidget with QOffscreenSurface + QOpenGLFramebufferObject
  + QPainter readback — works on Wayland/KDE without sub-surface compositing
- Force desktop OpenGL 3.3 core profile before QApplication (fixes black output on GLES)
- Timer-based render polling (16 ms) replaces signal-flood from mpv C thread;
  fixes playback animation and scrubbing preview
- Fix AB-loop: set ab-loop-a/b to "no" on stop (0 means infinite in mpv)

Timeline:
- Full redesign: time ruler with adaptive major/minor ticks, playhead triangle
  handle, selection region with edge lines, numbered marker badges
- Height 160 px; layout collapsed from 4 rows to 2 below timeline
- Markers appear immediately on export (optimistic update before ffmpeg finishes)
- Right-click marker → context menu to delete from DB

Hotkeys:
- Replace keyPressEvent with QShortcut(ApplicationShortcut) so keys work
  regardless of focused widget; MpvWidget gets NoFocus policy

Export:
- WebP: switch lossless→lossy quality 85, compression_level 1 (~10x faster)
- Add -threads 0 for full CPU utilisation during decode/filter
- Remember last export folder across sessions via QSettings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 22:22:58 +02:00
Ethanfel 7931a0e3db debug: write mpv log to /tmp/8cut-mpv.log 2026-04-06 20:56:14 +02:00
Ethanfel 939199717f fix: use QOpenGLContext.getProcAddress for mpv render context proc lookup 2026-04-06 20:54:19 +02:00
Ethanfel 8863634bce debug: add mpv log output and initializeGL trace 2026-04-06 20:51:11 +02:00
Ethanfel e5f2c732d9 fix: wrap get_proc_address as CFUNCTYPE for mpv render context 2026-04-06 20:50:02 +02:00
Ethanfel 1e0c1ae892 fix: replace wid embedding with OpenGL render context — works on Wayland and X11 2026-04-06 20:48:59 +02:00
Ethanfel 2c95c2618a debug: print platform/wid/WAYLAND_DISPLAY at mpv init 2026-04-06 20:41:55 +02:00
Ethanfel c130010e36 fix: hide WAYLAND_DISPLAY during mpv init so it uses X11 wid embedding 2026-04-06 20:41:16 +02:00
Ethanfel 02c63bdfde fix: force QT_QPA_PLATFORM=xcb so mpv embeds correctly on Wayland sessions 2026-04-06 20:39:12 +02:00
Ethanfel f30955b63c debug: print drag-drop events to diagnose Wayland DnD 2026-04-06 20:37:13 +02:00
Ethanfel c80ebf9383 fix: move drag-drop to MainWindow to bypass QListWidget viewport on Wayland 2026-04-06 20:35:47 +02:00
Ethanfel 3d92a66660 fix: re-apply LC_NUMERIC=C after QApplication resets locale 2026-04-06 20:33:51 +02:00
Ethanfel bdfb9354ca fix: set LC_NUMERIC=C before mpv init to prevent segfault on non-C locales 2026-04-06 20:32:56 +02:00
Ethanfel 41c36267e9 fix: use NoDragDrop mode + viewport.setAcceptDrops for Wayland/KDE compatibility 2026-04-06 20:31:37 +02:00
Ethanfel d720fc0541 fix: accept dragMoveEvent so file drops work on all desktop environments 2026-04-06 20:30:31 +02:00
Ethanfel 31f4df4c5b fix: suppress QFrame paintEvent on mpv native window 2026-04-06 20:29:06 +02:00
Ethanfel 39bbfedb9d fix: suppress paintEngine warnings from mpv native window embedding 2026-04-06 20:28:00 +02:00
Ethanfel 025d5afe1f chore: add shebang for direct execution 2026-04-06 20:25:07 +02:00
Ethanfel 191d1cf299 fix: move SELVA_CATEGORIES to module level, harden append_to_tsv, fix tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 18:48:46 +02:00
Ethanfel c76eb9ec84 feat: add label/category annotation fields and TSV export for SELVA
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 18:45:29 +02:00
Ethanfel 8fb8782e65 fix: use correct venv path on Windows (Scripts/python.exe) 2026-04-06 18:30:37 +02:00
Ethanfel a74e5022b3 docs: add README 2026-04-06 18:28:59 +02:00