Skip to content

libopus feature for ffmpeg #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 24, 2025
Merged

libopus feature for ffmpeg #37

merged 18 commits into from
Jun 24, 2025

Conversation

sethvincent
Copy link
Contributor

No description provided.

@sethvincent sethvincent marked this pull request as ready for review June 18, 2025 18:32
Copy link
Contributor

@kasperisager kasperisager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The libopus build definition must be in a separate port, see https://github.com/holepunchto/bare-ffmpeg/blob/main/cmake/ports/svt-av1/port.cmake for an example. It's fortunately built with CMake as well so the port should be trivial.

@sethvincent
Copy link
Contributor Author

@kasperisager makes sense! Is there a way around recreating the equivalent of bare_arch for checking the arch?

@kasperisager
Copy link
Contributor

Is there a way around recreating the equivalent of bare_arch for checking the arch?

That shouldn't be necessary at all. What's the issue you're running into?

Copy link
Contributor

@tony-go tony-go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good % @kasperisager comment! :)

@sethvincent
Copy link
Contributor Author

Is there a way around recreating the equivalent of bare_arch for checking the arch?

That shouldn't be necessary at all. What's the issue you're running into?

Ah, I see, I guess I was assuming because of this in the x264 port, which we could probably remove?

if(CMAKE_SYSTEM_NAME)
set(platform ${CMAKE_SYSTEM_NAME})
else()
set(platform ${CMAKE_HOST_SYSTEM_NAME})
endif()
string(TOLOWER "${platform}" platform)
if(platform MATCHES "darwin|ios")
set(platform "darwin")
elseif(platform MATCHES "linux|android")
set(platform "linux")
elseif(platform MATCHES "windows")
set(platform "msys")
else()
message(FATAL_ERROR "Unsupported platform '${platform}'")
endif()
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
set(arch ${CMAKE_OSX_ARCHITECTURES})
elseif(MSVC AND CMAKE_GENERATOR_PLATFORM)
set(arch ${CMAKE_GENERATOR_PLATFORM})
elseif(ANDROID AND CMAKE_ANDROID_ARCH_ABI)
set(arch ${CMAKE_ANDROID_ARCH_ABI})
elseif(CMAKE_SYSTEM_PROCESSOR)
set(arch ${CMAKE_SYSTEM_PROCESSOR})
else()
set(arch ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
string(TOLOWER "${arch}" arch)
if(arch MATCHES "arm64|aarch64")
set(arch "aarch64")
elseif(arch MATCHES "armv7-a|armeabi-v7a")
set(arch "arm")
elseif(arch MATCHES "x64|x86_64|amd64")
set(arch "x86_64")
elseif(arch MATCHES "x86|i386|i486|i586|i686")
set(arch "i686")
else()
message(FATAL_ERROR "Unsupported architecture '${arch}'")
endif()

I got a little too into figuring out how the libopus build works with neon but I figured out the right option to make it build.

Assuming the workflow jobs succeed I think this is probably good now!

@sethvincent
Copy link
Contributor Author

Assuming the workflow jobs succeed I think this is probably good now!

Narrator voice: "But not all the workflow jobs would succeed."

Now they do! I got really into getting simd intrinsics working across platform/arch. Possibly too into it.

@sethvincent sethvincent requested a review from kasperisager June 21, 2025 21:58
@sethvincent sethvincent requested a review from kasperisager June 24, 2025 01:25
@sethvincent sethvincent merged commit dd0c3d0 into main Jun 24, 2025
13 checks passed
@sethvincent sethvincent deleted the libopus branch June 24, 2025 16:47
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.

3 participants