Commit Graph

370 Commits

Author SHA1 Message Date
Ethanfel e2b4f9bf8d remove: mask generation, venv setup, and settings dialog
Dead code — masking is handled externally via ComfyUI. Removes
SetupWorker, MaskWorker, SettingsDialog, build_mask_output_dir,
the mask UI row, Settings button, and associated test cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 15:53:31 +02:00
Ethanfel bb6e3c623a fix: UX audit — shortcuts in text fields, delete confirmation, overwrite indicator
- Suppress global shortcuts (E/J/L/K/M/Space/P/arrows) when typing in
  text fields via ShortcutOverride event filter
- Add delete confirmation dialog before removing clips from disk + DB
- Export button turns red "Overwrite" when a marker is selected
- Reset stale overwrite/delete state when switching files
- Remove auto-advance after export; add N shortcut to advance manually
- Widen marker hit zones (±6→±10px click, ±4→±8px hover)
- Marker tooltip shows filename instead of full path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 15:49:27 +02:00
Ethanfel 89e0478777 feat: parallel export, playback position, double-click markers, reset clips on video switch
- Parallelize batch ffmpeg exports with ThreadPoolExecutor
- Show playback progress as color fill in timeline selection region
- Single click moves playhead, double-click selects/deselects markers
- Reset clip count and spread to defaults when switching videos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 11:42:40 +02:00
Ethanfel c287788d9e fix: marker click properly restores settings without cursor clear race
Emit marker_clicked before seek, and use a flag to prevent
_on_cursor_changed from immediately clearing the overwrite state
and settings that were just restored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 11:01:29 +02:00
Ethanfel 5a5961ae21 fix: default short_side to 512 in DB schema
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 02:55:09 +02:00
Ethanfel c174d891fb fix: migrate DB schema with ALTER TABLE instead of dropping old data
Legacy records get new columns with sensible defaults and are preserved
as markers. No more data loss on schema upgrade.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 02:53:12 +02:00
Ethanfel 74e8656335 feat: save and restore all export config on marker click
DB now stores short_side, portrait_ratio, crop_center, format,
clip_count, and spread per export. Clicking a marker restores all
fields to the original export settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 02:52:02 +02:00
Ethanfel 206b95fc28 feat: restore label and category when clicking a marker
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 02:49:48 +02:00
Ethanfel f11b3e298e feat: group clips into subfolders (clip_001/, clip_002/, etc.)
Each batch export creates a subfolder named after the group (e.g.
clip_001/) containing all sub-clips and their audio files. Keeps
the top-level export folder clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 01:05:10 +02:00
Ethanfel 22e2ad27a0 fix: show one marker per batch, not one per sub-clip
Pending marker uses cursor position for the whole batch. DB markers
deduplicated by start_time since all sub-clips share the same cursor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 00:41:41 +02:00
Ethanfel fee907f26f fix: raise clip count limit from 10 to 99
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 00:37:57 +02:00
Ethanfel 122f89547b feat: show crop bar with vertical lines when random portrait is enabled
When the random portrait checkbox is on and portrait dropdown is Off,
the crop bar appears and the video overlay shows 2 red vertical lines
(instead of filled red bands) indicating the 9:16 crop boundaries.
Clicking the crop bar or video adjusts the crop center position.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 00:30:49 +02:00
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