28 Commits
Author SHA1 Message Date
Jonathan Thomas a2e1297aa4 Fix preview alignment, export timestamps, and capture color range
Align reduced preview dimensions after aspect fitting while preserving native output sizes. Pad export scaler rows and copy planes by stride, including compatibility handling for legacy GIF palettes.

Preserve delayed audio encoder timestamps, skip unavailable packets, and use actual resampler output counts. Share JPEG-range normalization with live capture and add sizing, export, audio, GIF, and color regression tests.
2026-09-25 19:43:06 -05:00
Jonathan Thomas 1ee6dbe334 Fix reader lifecycle races and raw-video packet ownership 2026-09-19 15:38:20 -05:00
Jonathan Thomas 09c53893d3 Probe VAAPI initialization before running hardware decode tests
A render node and compiled FFmpeg support do not guarantee an operational VAAPI driver. Probe the exact adapter with the linked FFmpeg library and report missing prerequisites as skipped in CTest. Full suite: 517 passed, 2 skipped, 0 failed.
2026-09-05 14:15:03 -05:00
Jonathan Thomas fe4bb33b4f Discard buffered decoder output when closing FFmpeg readers
Addresses OPENSHOT-FYCC: avoid allocating discarded image frames during shutdown. Add a pending-packet close and reopen regression.
2026-09-05 14:07:53 -05:00
Jonathan Thomas fec6e901ed Preserve audio-only reader dimensions on pasted clips
-Set the parent timeline before hydrating clips inserted through JSON diffs, matching full project JSON load behavior. This lets copied/pasted clips expose timeline context while their nested readers are rebuilt.
-Avoid clobbering valid stored dimensions for audio-only FFmpeg readers with the 720x480 fallback. The fallback is now only used when width or height are missing, while parent timeline preview dimensions can still override when available.
-Add regression coverage for audio-only FFmpegReader JSON hydration and timeline JSON-diff insertion preserving 1280x720 dimensions.
2026-04-30 23:45:14 -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 5ee9d1b8b2 Fixing a bug where a non-EOF frame is otherwise ready but still has no image data: instead of stalling indefinitely, it reuses the most recent non-future image and finalizes the frame. Added new unit tests to verify the fix. 2026-03-20 14:34:28 -05:00
Jonathan Thomas d0ef59616f Improving Hardware decode handling, especially on failure to get a decoded frame from the GPU, to safely fallback to software decode in those cases, so we don't end up with a black blank frame. This should be compatible with all hardware decoding, but I tested this only on VAAPI and AMD Radeon GPU on Ubuntu 24.04. Also updating the HW-ACCEL.md file with updated notes, and tried to add more detail about how decode and decode fallback works. 2026-03-10 23:34:21 -05:00
Jonathan Thomas 6bd84f9482 Fixing mp3 (and mp3 like audio files with a single image-based thumbnail) to be much faster and better handled, improving responsiveness by huge margins: 97.4% faster. 2026-03-06 00:26:04 -06:00
Jonathan Thomas 1a44a6582c Fixing mac unit test failures due to filesystem dependency again,ughh. 2026-02-24 13:05:39 -06:00
Jonathan Thomas 89350a0419 Setting has_static_image correctly when FFmpegReader opens image formats and a video_length == 1, so we have consistent behavior in OpenShot regardless of QtImageReader or FFmpegReader, when opening images. 2026-02-24 12:06:42 -06:00
Jonathan Thomas 7efc48006a Modify all throw InvalidFile(...) callsites: each now has a distinct message string, and adding unit tests to verify this.
So a crash line will now be more like:
  what(): FFmpegReader could not open media file. for file C:\...\TitleFileName%04d.png
  instead of only File could not be opened.
2026-02-23 16:55:49 -06:00
Jonathan Thomas b7c37b84e4 - Fix FFmpegReader first-frame black regression by anchoring PTS offset to video start (and correcting video offset to use packet PTS), so AAC preroll/skip-samples no longer shifts frame 1.
- Add examples/test_aac_preroll.mp4 fixture (small, deterministic AAC-preroll sample) for reproducing and testing the regression.
2026-02-15 15:22:11 -06:00
Jonathan Thomas eea55982fd FFmpegReader: add duration strategy modes and unify duration/frame calculations. This is a potentially breaking change, where we ensure all durations and video_length calculations coming from FFmpegReader are now fully consistent - even if we must slightly adjust a duration from the video or audio stream. This keeps the 2 attributes identical in meaning (video_length X FPS == duration, no exceptions). Unknown durations are no longer -1 video_length but 0, and 0 duration. 2025-12-08 17:07:21 -06:00
Jonathan Thomas 021c6ecc07 Adding unit tests to validate FFmpegReader, Clip, and Timeline frame accuracy of GIF files, plus GIF with time curves. 2025-09-12 22:57:26 -05:00
Jonathan Thomas f544d84f48 Fixing memory leak on Clips, where we were not clearing cache on Close, or forcing Close on destruction. Especially noticeable on projects with a ton of clips. Tweaking unit tests to prevent crash due to new Clip destructor behavior when using stack variables. 2023-04-19 16:08:36 -05:00
Jonathan Thomas 4039851a66 Adding Invalid Codec exception to AV1 unittest 2022-11-16 17:11:30 -06:00
Jonathan Thomas 2c24d0ff32 Updating unit tests to ignore older versions of FFmpeg that do not support AV1 decoding. 2022-11-16 15:10:25 -06:00
Jonathan Thomas 58dc99d1f9 Fixing whitespacae 2022-11-15 14:52:13 -06:00
Jonathan Thomas cbff18ad95 Update AV1 unit testing to verify pixel values, to ensure correct decoding 2022-11-15 14:33:03 -06:00
Jonathan Thomas 63ebc4f4f3 Adding test for AV1 sync verification on Windows builder 2022-11-14 12:03:33 -06:00
FeRD (Frank Dana) 677ed5f591 Tests: Switch test files to openshot_catch.h 2022-06-17 15:37:51 -04:00
Frank Dana 59138ea3e4 Adopt license management via Reuse project/tool (#711)
* reuse-managed license/copyright headers

reuse is a tool for compliance with the REUSE recommendations. See
<https://reuse.software/> for more information, and
<https://reuse.readthedocs.io/> for the online documentation.

* Set jsoncpp license
* Add MIT license for Decklink sources
* Explicitly license examples/
  - Add headers to source files
  - Change blanket licensing in .reuse/dep5 to only cover binary media
  - Import CC-BY-3.0 license and assign to sintel_trailer
2021-10-16 01:26:26 -04:00
Frank Dana 88d3011455 Unit tests: Use == to compare strings (#741)
When there's a mismatch, Catch2 will output the contents of both
strings rather than a meaningless .compare() numeric value.
2021-09-27 07:14:48 -04:00
FeRD (Frank Dana) 528919027c Code formatting 2021-06-11 06:13:22 -04:00