601 Commits

Author SHA1 Message Date
Jonathan Thomas 0a68c884e2 Merge pull request #1078 from OpenShot/object-mask-effect
New "Object Mask" Effect: Segment Anything / Track Anything
2026-05-22 14:50:34 -05:00
Jonathan Thomas d01ffe1ea8 Merge pull request #1077 from OpenShot/black-frames
Avoid Black Frames (Adding a new clip - and it does not appear)
2026-05-20 23:15:32 -05:00
Jonathan Thomas 8bd98a592b Replace ObjectMask EdgeSAM seed masks with EfficientSAM ONNX
- Use a single EfficientSAM ONNX model for ObjectMask seed mask generation
- Add EfficientSAM prompt preprocessing and mask candidate selection
- Keep seed-frame output as the raw EfficientSAM mask while still seeding XMem
- Add ClipProcessingJobs::PreviewObjectMask for single-frame interactive previews
- Accept EfficientSAM model JSON keys while preserving legacy encoder_model aliases
- Remove ObjectMask protobuf shutdown call that could destabilize Python teardown
- Add ObjectMask ONNX validation coverage
2026-05-18 19:18:56 -05:00
Jonathan Thomas 1f0b1b9698 Add Object Mask effect with EdgeSAM and XMem propagation
- Add ObjectMask effect for rendering and exposing generated object masks
- Add EdgeSAM preprocessing path for prompt-based seed and reseed masks
- Add XMem ONNX propagation between seed frames for single-object tracking
- Support positive/negative points, positive rect prompts, and prompt keyframes
- Store generated masks in protobuf data for playback and downstream effects
- Add mask color/alpha plus stroke color/alpha/width effect controls
- Register ObjectMask with effect discovery and clip preprocessing jobs
- Add focused ObjectMask effect tests
2026-05-18 16:28:13 -05:00
Jonathan Thomas ec370404d9 Add YOLO segmentation mask support to Object Detection
- Support YOLO segmentation ONNX outputs, persist sparse RLE masks in object-detection protobuf data, and render configurable mask overlays in the Object Detection effect.
- Also normalize tracked object classes at save time, smooth short mask gaps, and expose Draw Mask / Mask Color / Mask Alpha only when mask data is available.
2026-05-15 17:51:16 -05:00
Jonathan Thomas 195632ac86 Fix persistent black frames after clip open failure
- Only mark timeline clips as open after Clip::Open() succeeds
- Allow later GetFrame() calls to retry opening clips after transient failures
- Prevent cache rebuilds from repeatedly generating blank frames for closed clips
- Add regression coverage for a failed first open followed by a successful retry
2026-05-12 22:31:12 -05:00
Jonathan Thomas ae3d769f0a Fix stale timeline cache after adding clips
- Invalidate affected final_cache frames in AddClip()
- Remove duplicate JSON insert invalidation
- Add regression test for stale black frames
2026-05-12 18:38:45 -05:00
Jonathan Thomas 14c63f3714 Fix margin-bounded effects to avoid invalid image access
- Clamp and validate Blur, Bars, and Pixelate margin-derived regions
- Add regression coverage for collapsed/out-of-range margin cases
- Verify focused Bars, Blur, and Pixelate tests pass
2026-05-12 15:15:15 -05:00
Jonathan Thomas 4f289bc442 Fix saturation stride and parent effect updates
- Respect QImage::bytesPerLine() in saturation and mask blending
- Preserve child effect IDs when inheriting parent effect changes
- Propagate parent updates correctly through nested child effects
- Add regression tests for padded image stride and parent effect inheritance
2026-05-12 14:22:06 -05:00
Jonathan Thomas be99ec02c6 Migrate object detection to YOLOv5 ONNX
- Replace YOLOv3 Darknet loading with YOLOv5 ONNX model loading and validation.
- Parse YOLOv5 outputs with top class candidates for smoother labels.
- Improve SORT tracking with class-score smoothing and stricter geometry gates.
- Prevent active tracks from hopping to adjacent objects or tiny nested detections.
- Keep object ids stable through protobuf load/save and add an object-detection debug example.
- Add class-based default colors and matching border/background defaults.
- Add All Objects pseudo-selection support for tracked-object properties.
- Honor tracked-object corner radius when using tracker/object detector masks.
- Add regression tests for tracking stability, all-object styling, masks, and keyframes.
2026-05-10 21:48:24 -05:00
Jonathan Thomas d274163314 Improve tracked object rendering controls
- Remove unused tracked-object rotation property from JSON, properties, and box values
- Add per-object Draw Text support alongside Draw Box
- Use deterministic class colors for Object Detector instead of random seeded colors
- Scale tracked-object stroke widths based on preview raster size
- Keep Object Detector text rendering gated by both global and per-object text settings
2026-05-10 14:34:38 -05:00
Jonathan Thomas 0751153d5a Merge pull request #1074 from OpenShot/tracked-mask-source
Use TrackedObjectMask as "Mask: Source" for any Effect
2026-05-09 20:40:18 -05:00
Jonathan Thomas 07e60a8a60 Improve Caption margins and default visibility
- Add Bottom margin support to Caption JSON, properties, rendering, and tests
- Rename Caption margin property labels to "Margin: Top/Left/Bottom/Right"
- Clip Caption rendering to the configured margin rectangle
- Default Caption fade in/out to 0.0 so newly inserted captions render immediately
- Avoid divide-by-zero fade calculations when Caption fade durations are disabled
2026-05-09 16:27:10 -05:00
Jonathan Thomas ec71b7335c Added top/bottom/left/right margins to Blur effect, similar to Pixelate one (for consistency). Renamed the user-facing JsonProperty labels across all effects with similar keyframes to:
- Margin: Left
- Margin: Top
- Margin: Right
- Margin: Bottom
2026-05-09 14:50:36 -05:00
Jonathan Thomas a6e7d85c93 Adding the ability to use TrackedObjectMask as "Mask: Source" for any effect (i.e. blur/pixilate only the tracked area)
- Add tracked effect IDs as mask sources
- Generate bbox masks from Tracker/Object Detection
- Preserve original frame when no bbox is visible
- Add focused mask-source tests
2026-05-09 11:27:49 -05:00
Jonathan Thomas 22ec091a06 Merge pull request #1073 from OpenShot/source-rotation
Apply reader-side orientation metadata (i.e. rotate pixels before Clip)
2026-05-09 10:55:48 -05:00
Jonathan Thomas 0081cda5ee Apply reader-side orientation metadata and stabilize tracker stroke rendering
- Move phone/video rotation metadata handling into readers with an internal clip compatibility mode for legacy projects. FFmpegReader now reports oriented dimensions, applies orientation to decoded frames, and preserves old JSON behavior through reader_orientation_mode.

- Also adjust tracker/object-detection stroke width for preview raster scaling so tracked boxes remain visible during clip scale animations.
2026-05-08 20:58:53 -05:00
Jonathan Thomas 6011e73716 Merge pull request #1071 from OpenShot/small-svg-thumbnails
Fix SVG thumbnail rasterization with max decode size (fix fuzzy thumbnails for small SVG files)
2026-05-08 17:34:06 -05:00
Jonathan Thomas 226f686074 Fix SVG thumbnail rasterization with max decode size (SVG upscaling for tiny sizes)
-Treat SetMaxDecodeSize as the rasterization target for parentless SVG readers, instead of only as a downscale ceiling. This lets thumbnail generation render tiny SVG files at the requested decode size, avoiding blurry thumbnails caused by first rasterizing at the SVG document size.
-Raster images and SVGs with a parent clip/timeline keep their existing sizing behavior.
2026-05-08 14:22:33 -05:00
Jonathan Thomas 6ccb526cb9 Fixing GetMaxFrame() to fix tiny float overshoot, causing occasional black frames at the end of an export. For example, it might have concluded that we had 505.00001 frames, and this would then be converted later to 506 with ceil(). 2026-05-08 13:52:28 -05:00
Jonathan Thomas 9f4df7eed4 Merge branch 'fps-fix' into denoise 2026-05-06 15:48:14 -05:00
Jonathan Thomas 51ee44ab33 Adding new Denoise effect
- Adds a new DenoiseImage video effect for reducing luma grain and color speckles with adaptive spatial filtering, conservative temporal blending, motion protection, and brightness response controls.
- Added to openshot-benchmark
- New unit tests
2026-05-05 21:19:26 -05:00
Jonathan Thomas 3ebe4ea964 Changing caption unit tests to use minimal QT_QPA_PLATFORM, to avoid unit test crashes on our gitlab builders. 2026-05-05 15:05:33 -05:00
Jonathan Thomas 033d5777ff Fix FFmpegWriter MP4 frame duration metadata
-Ensure FFmpegWriter sets nominal video stream frame rates and assigns packet durations before muxing video packets, including delayed packets flushed from encoders. This prevents FFmpeg 4.2-era MP4 output from ending the video stream one frame short, which caused avg_frame_rate to report values like 30.14 instead of 30 fps.
-Add a regression test that writes a 30-frame, 30 fps MP4 with B-frames and verifies r_frame_rate, avg_frame_rate, and stream duration remain exact.
2026-05-05 14:25:27 -05:00
Jonathan Thomas 235a5c8491 Merge pull request #1067 from OpenShot/mask-fixes
Cap Mask contrast factor at maximum contrast
2026-05-03 23:38:18 -05:00