FFmpeg trim points#33
Conversation
|
Cursor Agent can help with this pull request. Just |
|
Bugbot Autofix resolved 2 of the 2 bugs found in the latest run.
|
Co-authored-by: me <me@kentcdodds.com>
Co-authored-by: me <me@kentcdodds.com>
- Wait for stdout/stderr readers to complete before closing stream - Preserve user-friendly cancel message when abort occurs
Co-authored-by: me <me@kentcdodds.com>
c58559f to
a2fd531
Compare
Co-authored-by: me <me@kentcdodds.com>
|
|
||
| const loadWaveform = async (url: string) => { | ||
| if (!url || waveformStatus === 'loading') return | ||
| if (waveformSource === url && waveformStatus === 'ready') return |
There was a problem hiding this comment.
Waveform data may display for wrong video
Medium Severity
The loadWaveform function returns early when waveformStatus === 'loading', but this creates a race condition. If a user loads video A and then quickly loads video B before A's waveform finishes, the second loadWaveform('B') call exits early without updating waveformSource. When video A's waveform fetch completes, its data is applied unconditionally (no check that waveformSource still matches the fetched URL), causing video A's waveform to display while video B is previewed.
Additional Locations (1)
- Track fetched URL and discard stale waveform data when source changes - Move cancelRun status updates inside runController check to prevent overwriting valid states
|
Bugbot Autofix resolved 2 of the 2 bugs found in the latest run.
|
- Fix duration check to prevent negative timestamps for videos shorter than MIN_TRIM_LENGTH - Add cleanup listener to abort ffmpeg operation when component unmounts
|
Bugbot Autofix resolved 2 of the 2 bugs found in the latest run.
|
| previewUrl = url | ||
| resetPreviewState() | ||
| handle.update() | ||
| } |
There was a problem hiding this comment.
Trim ranges persist when loading different video
Medium Severity
When loading a new video, trimRanges is not cleared. The resetPreviewState function only resets previewReady, previewError, and previewDuration, leaving existing trim ranges intact. If a user loads a shorter video after adding trim ranges to a longer one, the UI displays ranges that extend past the new video's duration. These invalid ranges appear in the list and timeline but are silently filtered out during normalization, causing a confusing "Add at least one trim range" error when the user attempts to run ffmpeg while seeing ranges in the UI.
Additional Locations (1)
|
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds a new 'Trim points' page for defining video trim ranges, generating
ffmpegcommands, and executing them with live progress.Note
Introduces a dedicated Trim Points flow for defining removal ranges, previewing, and running ffmpeg with live progress.
TrimPointsclient page with waveform, timeline handles, range list, output summary, and command preview; navigable via header linksPOST /api/trimstreaming endpoint (app/trim-api.ts) to run ffmpeg using normalized ranges and emit NDJSON logs/progress; integrates intosrc/app-server.tsapp/trim-commands.tsto normalize ranges, compute output duration, and build ffmpeg args/preview/trim-pointsroute and server handlers;app/client/app.tsxchooses page by pathnameWritten by Cursor Bugbot for commit 0ea8c33. This will update automatically on new commits. Configure here.