Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/cmake-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,34 @@ jobs:
echo "CLEAN_BUILD is true, removing entire build directory."
if [ -d "build" ]; then rm -rf build; fi

- name: Cache FFmpeg Binaries
id: ffmpeg-cache
uses: actions/cache@v3
with:
path: external/FFmpeg/bin
key: ${{ runner.os }}-ffmpeg-6.0-${{ runner.arch }}

- name: Download FFmpeg and FFprobe Binaries
if: steps.ffmpeg-cache.outputs.cache-hit != 'true'
run: |
echo "Installing FFmpeg via Homebrew..."
brew update
brew install ffmpeg

echo "Creating destination directory..."
mkdir -p external/FFmpeg/bin

echo "Copying ffmpeg + ffprobe into project folder..."
cp "$(brew --prefix)/bin/ffmpeg" external/FFmpeg/bin/
cp "$(brew --prefix)/bin/ffprobe" external/FFmpeg/bin/

echo "Verifying versions:"
external/FFmpeg/bin/ffmpeg -version
external/FFmpeg/bin/ffprobe -version

- name: Add FFmpeg to Path
run: echo "$GITHUB_WORKSPACE/external/FFmpeg/bin" >> $GITHUB_PATH

- name: Check Formatting
run: |
brew install clang-format
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ if(CI_TEST OR INTERNAL_TEST)
include(GoogleTest)
include("cmake/eclipsa_test.cmake")
include("cmake/eclipsa_build_tests.cmake")

# Check for an FFmpeg install for tests that do additional media verification
include("cmake/find_ffmpeg.cmake")
if (FFMPEG_TOOLS_FOUND)
message(STATUS "FFmpeg found. Enabling tests that require FFmpeg.")
add_compile_definitions(ECLIPSA_FFMPEG_AVAILABLE=1)
else()
message(STATUS "FFmpeg not found. Tests requiring FFmpeg will be disabled.")
endif()
endif()

add_subdirectory(third_party)
Expand Down
38 changes: 38 additions & 0 deletions cmake/find_ffmpeg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Find FFmpeg package with platform-independent detection
# Supports standard installations and homebrew on macOS
#
# Sets:
# FFMPEG_TOOLS_FOUND - whether FFmpeg was found
# FFMPEG_EXECUTABLE - path to ffmpeg executable
# FFPROBE_EXECUTABLE - path to ffprobe executable

# Find ffmpeg and ffprobe executables
find_program(FFMPEG_EXECUTABLE ffmpeg)
find_program(FFPROBE_EXECUTABLE ffprobe)

# Check if executables were found
if(FFMPEG_EXECUTABLE AND FFPROBE_EXECUTABLE)
set(FFMPEG_TOOLS_FOUND TRUE)
else()
set(FFMPEG_TOOLS_FOUND FALSE)
if(NOT FFMPEG_EXECUTABLE)
message(WARNING "ffmpeg executable not found")
endif()
if(NOT FFPROBE_EXECUTABLE)
message(WARNING "ffprobe executable not found")
endif()
endif()
Loading
Loading