19 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 9e8d226353 Preserve live capture timing gaps 2026-06-22 17:40:18 -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 f33dec7f9d Reverting memory alignment changes to FFmpegWriter, due to instability and bugs. 2026-03-12 17:36:17 -05:00
Jonathan Thomas f75ee035d0 Fixing windows unit test failure due to alignment on FFmpegWriter. 2026-03-12 15:57:44 -05:00
Jonathan Thomas a13dcc4376 Fixing build failure regression to older versions of FFmpeg, caused by our alignment fix. Take 3 2026-03-12 14:52:10 -05:00
Jonathan Thomas 88325cbe76 Improving memory alignment on FFmpegWriter, to prevent misaligned sws_scale calls, and potentially get a speed up during scaling certain images. 2026-03-12 12:35:42 -05:00
Jonathan Thomas 49824c361b Adding ability to adjust allow_b_frames for encoding (using SetOption), and new unit tests for export quality settings. 2026-03-06 15:15:50 -06:00
Jonathan Thomas 9e9bfb3404 Merge pull request #935 from Ninpo/fix-test-file-collisions
Fixes test file collisions with high concurrency builds
2024-05-10 20:24:09 -05:00
Jonathan Thomas d87e9e49c8 Un-reverting previous commit, removing queuing from FFmpegWriter for simplicity. Increasing margin on webm unit tests, when checking pixel color. 2024-02-10 20:28:47 -06:00
Ninpo e17c2a3f14 Fixes test file collisions with high concurrency builds
Fix by Ninpo <ninpo@qap.la>

When tests are run in parallel it's possible for ImageWriter
and FFmpegWriter Gif tests to truncate/overwrite the other's
output1.gif. This change makes use of test file names unique
to the tests themselves.

Because cmake defaults to Makefiles and make does not -j$(nproc)
by default, this bug can't show up unless part of a build with parallel
make with tests included.

https://github.com/OpenShot/libopenshot/issues/933
2023-07-10 00:10:51 +01:00
Jonathan Thomas 70e86ef044 Improved Profile Class (Helper methods, Sortable, Unit tests) (#895)
* Removing legacy profile property. Add new operators for Profile classes (for comparison). Also added new functions to generate different variations of the Profile data (key, short name, long name, long name w/description).

* Add empty constructor for Profile class, and new Profile unit tets

* Adding zero padding to profile Key function, for easier sorting: 01920x1080i2997_16:09

* Clear setfill flag after creating Key() output

* Updating example exe to load an *.osp project file via C++, which makes debugging complex broken projects much easier.

* - Add new unit test to FFmpegWriter to create an animated GIF and verify it can be wrapped with a FrameMapper (with no audio track)
- Improve FrameMapper to ignore missing audio data (i.e. when no audio samples present, don't try and find them or resample them)

* Fix some whitespace issues

* Fix inline documentation mistype

* Fixed missing reuse licensing on new example profile files

* Changing Profile::Key() format to exclude the : character, since Windows file names cannot contain that

* - Large memory leak fixed in FFmpegWriter when closing the video & audio contexts
- Reducing # of cached frames and rescalers to 1, since we no longer use OMP and this is unneeded - we need to refactor much of this code out eventually

* - Fixing whitespace issues
- Code clean-up / line wrapping / etc...
2023-02-02 16:29:38 -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) 70ea2659d8 tests/FFmpegWriter: Add DisplayInfo test 2021-06-11 06:13:22 -04:00
FeRD (Frank Dana) d9775d4a5e Port unit tests to Catch2 2021-04-09 04:09:36 -04:00
FeRD (Frank Dana) c68b16643e Rename tests/*_Tests.cpp to tests/*.cpp 2021-04-07 23:41:04 -04:00