Skip to content

Add ARM64 library builds and newer dependency compatibility - #1117

Merged
jonoomph merged 29 commits into
developfrom
arm64-support
Oct 18, 2026
Merged

jonoomph merged 29 commits into
developfrom
arm64-support

Conversation

@jonoomph

@jonoomph jonoomph commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

This prepares ARM64 library builds and updates dependency compatibility for validation alongside the matching audio and application branches.

Validation: current GitHub checks pass, including both ARM64 builds. #1096 is only partially incorporated; its remaining changes are outside this PR.

Integration order: audio → libopenshot → openshot-qt. Keep these integration branches separate from develop until final builder and packaging verification is complete.

Companion PRs: OpenShot/libopenshot-audio#174, OpenShot/openshot-qt#6205.

geekrebel and others added 11 commits April 16, 2026 13:50
libopenshot on both Apple Silicon (arm64) and Intel Macs. The previous
version still referenced Homebrew formulae and tools that have been gone
for a decade (gcc48, Python 3.3, Qt 5.4.2), used Intel-only
/usr/local/Cellar paths, suggested the non-existent "cmake -d" flag, and
had no Apple Silicon coverage at all. As a result, every current-day
macOS contributor who followed the file was landing on stale CMake
errors, typically the "Could not find a package configuration file
provided by OpenShotAudio" message (see libopenshot#1030).

The new document walks through the steps that were actually verified
end-to-end on macOS 15 / Apple Silicon with AppleClang 17 and CMake
4.0.3: installing Command Line Tools, installing the Homebrew
dependencies (qt@5, ffmpeg@7, libomp, cppzmq, swig, zeromq, etc.),
building libopenshot-audio, and then building libopenshot with the
OpenMP hint flags that AppleClang requires. All prefixes use
"$(brew --prefix ...)" so the same commands work on Intel Macs against
/usr/local and on Apple Silicon against /opt/homebrew.

A troubleshooting section documents the current set of macOS-specific
gotchas that contributors will still hit even with this recipe:

* AGL framework removal (recently fixed in libopenshot-audio 0.6.x).
* cppzmq marked optional in CMake but required by ZmqLogger.h.
* AppleClang OpenMP via libomp.
* Apple system Ruby headers using the C++17-removed 'register' keyword,
  which forces -DENABLE_RUBY=0 on all modern macOS builds.
* Homebrew default ffmpeg formula already being at FFmpeg 8, which the
  develop branch does not yet target (see libopenshot#1018).

This is a docs-only change. No CMake, source, or build system behaviour
is modified. Running the recipe in this file successfully produces
libopenshot.dylib, _openshot.so, and a working "import openshot" from
Python 3 on Apple Silicon.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
and updating the INSTALL-MAC.md recipe to document both Qt 5 and Qt 6
as supported options on macOS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dec 61+)

FFmpeg 7 removed the codec capability lists (pix_fmts,
supported_samplerates, sample_fmts, ch_layouts, channel_layouts) from
the public AVCodec struct. Accessing them no longer compiles against
current FFmpeg releases (e.g. 8.x/9.x as shipped by MSYS2 and newer
distros), breaking the build entirely.

Add wrapper helpers in FFmpegUtilities.h:

  ffmpeg_codec_pix_fmts()      -> AV_CODEC_CONFIG_PIX_FORMAT
  ffmpeg_codec_sample_rates()  -> AV_CODEC_CONFIG_SAMPLE_RATE
  ffmpeg_codec_sample_fmts()   -> AV_CODEC_CONFIG_SAMPLE_FORMAT
  ffmpeg_codec_ch_layouts()    -> AV_CODEC_CONFIG_CHANNEL_LAYOUT

For LIBAVCODEC_VERSION_MAJOR >= 61 they call
avcodec_get_supported_config(); for older FFmpeg they return the
existing struct fields directly. All call sites in FFmpegWriter.cpp
now go through these helpers, so behavior is identical on FFmpeg <= 6.

Also fix a pre-existing bug visible on the new path: the channel-layout
loop used 'if (av_channel_layout_compare(...))' — treating NON-matching
layouts as valid — instead of comparing == 0. On FFmpeg 7 this would
have accepted the first non-matching layout; now it matches upstream
intent (accept only an equal layout).

And add the missing #include "Exceptions.h" to tests/BeatSync.cpp,
which uses openshot::InvalidJSON but previously got it transitively.

Verified on Windows/MSYS2 with FFmpeg 9.0.1 (libavcodec 63) + GCC 16:
full build passes and a Timeline render + libx264/AAC export via
FFmpegWriter produces a valid MP4.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ting the INSTALL-MAC.md recipe to match: dropping zeromq and cppzmq from the Homebrew install list, removing the obsolete zmq.hpp troubleshooting entry, noting that the AGL link fix shipped in libopenshot-audio 1.0.1, and recording the macOS 27 / AppleClang 21 re-verification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrite doc/INSTALL-MAC.md with a working recipe for Apple Silicon and Intel Macs
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.93730% with 321 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.87%. Comparing base (eac81cf) to head (11f1c4e).
⚠️ Report is 66 commits behind head on develop.

Files with missing lines Patch % Lines
tests/Benchmark.cpp 0.00% 48 Missing ⚠️
src/ScreenCaptureReader.cpp 22.91% 37 Missing ⚠️
tests/CameraCaptureReader.cpp 79.44% 37 Missing ⚠️
src/FFmpegReader.cpp 53.33% 35 Missing ⚠️
src/FFmpegWriter.cpp 79.61% 21 Missing ⚠️
tests/FFmpegReader.cpp 88.42% 14 Missing ⚠️
src/Logger.cpp 89.65% 12 Missing ⚠️
src/Qt/VideoCacheThread.cpp 95.02% 11 Missing ⚠️
src/Timeline.cpp 84.93% 11 Missing ⚠️
tests/VideoCacheThread.cpp 96.50% 11 Missing ⚠️
... and 25 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1117      +/-   ##
===========================================
+ Coverage    70.87%   73.87%   +3.00%     
===========================================
  Files          262      275      +13     
  Lines        34458    36905    +2447     
===========================================
+ Hits         24421    27264    +2843     
+ Misses       10037     9641     -396     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@jonoomph

Copy link
Copy Markdown
Member Author

Fix PR #1088 version and channel-layout guards, preserve legacy validation, and reject failed capability queries. Use encoder-context queries as suggested by #1096 without importing its broader changes. Add codec regression tests and FFmpeg 7.0, 7.1, and 8.0 CI coverage.
@jonoomph jonoomph changed the title Add ARM64 library build scaffolding and Mac build instructions Add ARM64 build support and FFmpeg compatibility fixes Oct 17, 2026
jonoomph and others added 7 commits October 17, 2026 14:48
Select the OpenCV header/detection and portable test-path changes from #1096 (head 37a2106). Other changes in that PR are not included.

Co-authored-by: Gordon Lam (SH) (from Dev Box) <yeelam@microsoft.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the existing OpenCV 4 minimum and 4.5.1 exclusion. Prefer Protobuf config packages for their transitive libraries, falling back to FindProtobuf on older builders. Print invalid Ninja rules if the Windows build fails so that the remaining generator issue can be diagnosed.
Use VERBATIM for the coverage-disabled test targets so CMake escapes dollar signs in anchored CTest label expressions. Windows Ninja otherwise rejects build.ninja before compilation.
The Windows ARM64 libc++ build does not indirectly declare std::insert_iterator through other standard headers.
Adapt the focused MagickCore linkage fix from #1096 (head 37a2106). Windows requires direct linkage for the core functions used by the image readers and writers. Retain the existing fallback for older CMake packages.

Co-authored-by: Gordon Lam (SH) (from Dev Box) <yeelam@microsoft.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the CrashHandler include inside the existing non-Windows guard. The SIGPIPE test has no Windows body and does not need to include Windows SDK headers after Catch2.
Keep spherical side data on the encoder context across parameter initialization. Verify the saved MP4 orientation independently, and only bypass reader angle assertions when libavformat 62 or 63 returns exactly zero for all three angles. Log the submitted upstream patch and retain normal assertions for fixed versions and other results.
@jonoomph jonoomph changed the title Add ARM64 build support and FFmpeg compatibility fixes Add ARM64 library builds and newer dependency compatibility Oct 17, 2026
@jonoomph
jonoomph merged commit 71c6c34 into develop Oct 18, 2026
20 checks passed
@jonoomph
jonoomph deleted the arm64-support branch October 18, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants