Commit Graph

296 Commits

Author SHA1 Message Date
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 aea12d2d32 Improve audio visualization styles, opacity, waveform, and rainbow color
- Fix Neon/Soft/Clean fill alphas — were far too low, colors appeared nearly invisible on dark backgrounds
- Fix Neon glow on waveform — double-reduced alpha and too-narrow spread made it invisible
- Fix Rainbow mode on waveform/filled waveform — now sweeps hue horizontally via QLinearGradient, no per-segment loop
- Line waveform now follows true ±signal instead of magnitude envelope; remove unused bottom_edge
- Remove Retro style — too visually similar to Clean to justify
- Minimal style is now fully opaque (fill alpha 1.0)
- Clip waveform shortcut defaults to Minimal style + Filled Waveform
2026-04-30 23:37:16 -05:00
Jonathan Thomas 9ef70177f2 Improving performance of audio visualization modes. Redesigning waveform and filled waveform to be more CPU efficient. Adding audio visualizations to our benchmark tool. 2026-04-30 16:05:28 -05:00
Jonathan Thomas dd18401242 Merge branch 'film-grain' into audio-visualizations
# Conflicts:
#	tests/CMakeLists.txt
2026-04-29 21:51:08 -05:00
Jonathan Thomas 2a9a480870 Fixed a long standing bug related to CROP scale mode, where -1/+1 location_x/y did not correctly calculate the offscreen coordinates. This will have backwards compatibility implications, since old projects that combine custom location_x/y + CROP scale mode will calculate position differently now.
Added tests:
- location_x/y = -1/+1 offscreen behavior for all scale enums and multiple scale_x/y combinations.
- all 9 gravity anchors when location_x/y = 0, including sub-100% and non-uniform scale.
- Crop-specific intermediate location behavior so the original bug stays covered.
2026-04-28 13:27:08 -05:00
Jonathan Thomas 7d429424b6 Add audio visualization effect and waveform modes
- Add AudioVisualization effect with waveform, bars, radial, spectrum, particles, VU, and related modes
- Add styling, color spread/rainbow, channel layout, frequency, glow, detail, and background controls
- Wire Clip::waveform to use the new effect and add waveform_mode
- Register the effect and add focused unit coverage for rendering, JSON, and clip properties
2026-04-26 23:05:44 -05:00
Jonathan Thomas f1544b6b31 Add flac extension to common extension list so FFmpegReader is the first reader we attempt to open it. 2026-04-09 12:53:49 -05:00
Jonathan Thomas 6c67d762cb Adding new MaxDecodeSize functionality to ReaderBase, which allows FFmpegReader and QtImageReaders to inspect and thumbnail clips much faster, and no longer be forced to do that a full resolution. Also refactoring CreateReader() inside Clip() constructor, so it can be called outside of the constructor, for example, when needing to create a reader for inspection or thumbnailing in openshot-qt. 2026-03-30 14:59:06 -05:00
Jonathan Thomas 2c6e166013 Disabling clip cache, since it's faster on the openshot-benchmark, and the benefits of clip cache don't seem obvious at this point (if caching is slower than not caching) 2026-03-24 17:50:21 -05:00
Jonathan Thomas 6dfc0c2945 Fix FFmpegReader fallback frame ownership and restore timeline-safe clip compositing 2026-03-24 16:19:45 -05:00
Jonathan Thomas bad0ee5f5f Slower, but safer memory access to Clip image - to prevent mutations from corrupting cached frame pixels 2026-03-24 15:37:50 -05:00
Jonathan Thomas 503bbcb7c6 Protect core clip keyframes from being empty after loading from JSON (scale_x/y, location_x/y, origin_x/y, shear_x/y, rotation) 2026-03-22 15:48:03 -05:00
Jonathan Thomas 74abca2b4f - Playback stays fast because frames are not copied in the normal path.
- Right after edits (ApplyJsonDiff), rendering temporarily switches to safe
    composition to prevent frame mutation/bleed.
- After that short window drains, it automatically returns to fast playback mode.
2026-03-06 22:02:30 -06:00
Jonathan Thomas ebb4a013dd Fixing an issue with frame's getting mutated accidentally during rapid updates and ensuring safe composition during timeline rendering, without losing performance on the openshot-benchmark. 2026-03-03 11:50:32 -06:00
Jonathan Thomas 83d4d1f8ea Improving cache invalidation during playback, to add an epoch counter to Timeline, so we know when an update took place outside of timeline (i.e. in our video cache thread) and can rescan our entire cache range for potentially missing frames after cache invalidation). 2026-03-01 17:45:02 -06:00
Jonathan Thomas 90d0710d78 Fixing some regressions in performance of Mask effect, and flickering cached frames during updates (i.e. property slider updates) 2026-03-01 16:56:42 -06:00
Jonathan Thomas 4387f8b394 - Timeline composition no longer mutates cached clip frames (fixes trails/ghosting).
- Clip updates via ApplyJsonDiff now also clear clip cache (not just timeline/reader ranges).
- Added regressions for cache invalidation + no cached-frame mutation; kept paused preroll/cache-bar behavior intact.
2026-03-01 14:19:27 -06:00
Jonathan Thomas 1ad401c66d - Added a new common mask_reader feature at EffectBase, so all video effects can be mask-limited automatically (audio effects ignore it).
- Added optional Mask Mode overrides for Blur, Saturation, Brightness, Hue, Pixelate, and Sharpen (Limit to Mask, Vary Strength).
- Kept unified mask property naming (mask_reader) with legacy JSON compatibility where needed.
- Added/updated unit tests for base mask behavior, per-effect mode behavior, and JSON round-trips.
- Fixed profile tests to write generated files into the build/test directory instead of the source examples/ folder.
2026-02-23 00:00:33 -06:00
Jonathan Thomas 16f791a55a Adding missing <sstream> includes for older compilers, and because it should be included anyway 2025-12-16 18:23:57 -06:00
Jonathan Thomas 355bea44d9 Fixing small regression on initial rotation keyframes from our previous commit. 2025-11-18 13:43:40 -06:00
Jonathan Thomas a7dfc596ca Fixing regression in Clip::init_reader_rotation() function, which could sometimes override scale_x and scale_y, when a rotation keyframe contained more than 1 point. 2025-11-13 16:18:18 -06:00
Jonathan Thomas 7e29fc0935 Improving audio directionality, with new function: SetAudioDirection(), so we can safely flip audio buffer direction when needed (i.e. time curves, reversed time). Also adding a new SetDirectionHint function to FrameMapper class - so our Clip class can inform the FrameMapper of its direction at any given moment. Also, clear resampler when changing directions inside a Time curve (since the audio buffer will be flipped - the resampler internal cache must be cleared). 2025-10-11 16:29:11 -05:00
Jonathan Thomas fd2952752d Improving audio directionality, with new function: SetAudioDirection(), so we can safely flip audio buffer direction when needed (i.e. time curves, reversed time). Also adding a new SetDirectionHint function to FrameMapper class - so our Clip class can inform the FrameMapper of its direction at any given moment. Also, clear resampler when changing directions inside a Time curve (since the audio buffer will be flipped - the resampler internal cache must be cleared). 2025-10-11 13:43:15 -05:00
Jonathan Thomas c165eca5d8 Improving AudioWaveformer to be able to correctly generate waveforms for time-curved clips that have a modified duration/video_length (i.e. repeated clips, slowled down clips, etc...). Adding a new ReaderBase.h VideoLength() that can be overridden in Clip.cpp when time curves are involved. 2025-09-22 12:28:12 -05:00
Jonathan Thomas 523ef17aa4 Adding composite/blend modes to libopenshot:
-Normal
-Darken
-Multiply
-Color Burn
-Lighten
-Screen
-Color Dodge
-Add
-Overlay
-Soft Light
-Hard Light
-Difference
-Exclusion
2025-09-12 17:47:41 -05:00