Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,38 @@ jobs:
echo "CLEAN_BUILD is true, removing entire build directory."
if [ -d "build" ]; then rm -rf build; fi

# --- FFmpeg (macOS) ---
- name: Install FFmpeg (macOS)
if: runner.os == 'macOS'
run: |
echo "Installing FFmpeg via Homebrew..."
brew update
brew install ffmpeg

echo "Verifying installation:"
ffmpeg -version
ffprobe -version

echo "FFmpeg location:"
which ffmpeg
which ffprobe

# --- FFmpeg (Windows) ---
- name: Install FFmpeg (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
Write-Host "Installing FFmpeg via Chocolatey..."
choco install ffmpeg -y

Write-Host "Verifying installation:"
ffmpeg -version
ffprobe -version

Write-Host "FFmpeg location:"
where.exe ffmpeg
where.exe ffprobe

# --- Formatting (macOS only for now) ---
- name: Check Formatting
if: runner.os == 'macOS'
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ 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()

# FFmpeg is required for CI tests
if(CI_TEST AND NOT FFMPEG_TOOLS_FOUND)
message(FATAL_ERROR "FFmpeg tools not found. Required for CI tests.")
endif()
endif()

add_subdirectory(third_party)
Expand Down
4 changes: 4 additions & 0 deletions cmake/copy_resources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ function(copy_resources target plugin_path)
set(LIB_OBR_PATH "${CMAKE_SOURCE_DIR}/third_party/obr/lib/obr.dylib")
set(LIB_IAMF_TOOLS_PATH "${CMAKE_SOURCE_DIR}/third_party/iamftools/lib/libiamf_tools.dylib")
set(LIB_ZMQ_5_2_6_PATH "${CMAKE_BINARY_DIR}/_deps/zeromq-build/lib/libzmq.5.2.6.dylib")
set(LIB_GPAC_PATH "${CMAKE_SOURCE_DIR}/third_party/gpac/lib/libgpac.dylib")

# Set Resources directory and external subdirectories
set(RESOURCES_DIR "${plugin_path}/Contents/Resources")
set(EXTERNAL_IAMF_DIR "${RESOURCES_DIR}/third_party/iamftools/lib")
set(EXTERNAL_OBR_DIR "${RESOURCES_DIR}/third_party/obr/lib")
set(EXTERNAL_GPAC_DIR "${RESOURCES_DIR}/third_party/gpac/lib")

# Copy libraries to the appropriate directories
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTERNAL_IAMF_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTERNAL_OBR_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${EXTERNAL_GPAC_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${LIB_OBR_PATH} ${EXTERNAL_OBR_DIR}/obr.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${LIB_IAMF_TOOLS_PATH} ${EXTERNAL_IAMF_DIR}/libiamf_tools.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${LIB_GPAC_PATH} ${EXTERNAL_GPAC_DIR}/libgpac.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ZMQ_5_2_6_PATH} ${RESOURCES_DIR}/libzmq.5.2.6.dylib

# Create symbolic links for libzmq
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()
19 changes: 3 additions & 16 deletions common/processors/file_output/FileOutputProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,10 @@ void FileOutputProcessor::closeFileExport(FileExport& config) {
// video files.
const bool kIamfExported = iamfFileWriter_ ? iamfFileWriter_->close() : false;
if (kIamfExported && fileExportRepository_.get().getExportVideo()) {
const bool kVSourcePathValid = FileExport::validateFilePath(
fileExportRepository_.get().getVideoSource().toStdString(), true);
const bool kVOutputPathValid = FileExport::validateFilePath(
fileExportRepository_.get().getVideoExportFolder().toStdString(),
false);

bool muxIamfSuccess = false;
if (kVSourcePathValid && kVOutputPathValid) {
muxIamfSuccess = IAMFExportHelper::muxIAMF(audioElementRepository_,
mixPresentationRepository_,
fileExportRepository_.get());
} else {
LOG_WARNING(0,
"IAMF Muxing: Invalid video source or output path provided.");
}
const bool kMuxIamfSuccess =
IAMFExportHelper::muxIAMF(fileExportRepository_.get());

if (!muxIamfSuccess) {
if (!kMuxIamfSuccess) {
LOG_WARNING(0,
"IAMF Muxing: Failed to mux IAMF file with provided video.");
}
Expand Down
Loading