Skip to content

Conversation

@ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Jul 5, 2025

Description

This PR adds a FreeBSD build of FFmpeg which will be required to complete LizardByte/Sunshine#4049

See: LizardByte/roadmap#90

Noteworthy changes:

  • fixed issue where we could not use the recursive option of the actions/checkout GitHub action, x265 required tags to be fetched if git is installed otherwise the x265.pc file would not be installed
  • fixed issue where parallel builds would always be 1 instead of using the processor count
  • artifact upload will now fail if no files are found
  • many FFmpeg flags are now defined by what cmake build options are enabled/disabled
  • CC/CXX flags are now properly passed to x264

More notes specific to FreeBSD build:

  • AMF is disabled as the build failed
  • cuda, ffnvcodec, nvenc are disabled for aarch64
  • cuda_llvm is disabled
  • v4l2 encoder is disabled (with it enabled the build actually succeeds for amd64, not sure why it fails on aarch64)

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@ReenigneArcher ReenigneArcher force-pushed the feat/ffmpeg/add-freebsd-build branch 30 times, most recently from 306559b to 352df0f Compare July 6, 2025 14:00
@ReenigneArcher ReenigneArcher force-pushed the feat/ffmpeg/add-freebsd-build branch 15 times, most recently from b71a051 to 2fcf99c Compare July 7, 2025 12:04
@ReenigneArcher
Copy link
Member Author

@cgutman would you mind taking a look at this? Not sure why but I had an itch to see if Sunshine would work on FreeBSD. It's relatively easy to setup a FreeBSD environment in a GitHub runner so decided to give a shot.

It would be nice if we didn't have to disable anything, and be on parity with the Linux build.

  1. AMF is disabled as the build failed
  2. cuda, ffnvcodec, nvenc are disabled for aarch64
  3. cuda_llvm is disabled
  4. v4l2 encoder is disabled (with it enabled the build actually succeeds for amd64, not sure why it fails on aarch64)

Number 4 errors on aarch with the following:

[ 94%] Target: FFmpeg
ERROR: v4l2_m2m requested, but not all dependencies are satisfied: linux_videodev2_h sem_timedwait

I can't remember the errors for the others at the moment, but I can revisit them if needed.

I am probably missing something simple, possibly just missing a package here and there. I don't know if there's a better way to search packages on FreeBSD other than https://www.freshports.org/

@ReenigneArcher ReenigneArcher marked this pull request as ready for review July 7, 2025 13:24
@ReenigneArcher ReenigneArcher changed the title feat(ffmpeg): add freebsd build feat(FFmpeg): add FreeBSD build Jul 7, 2025
@ReenigneArcher ReenigneArcher force-pushed the feat/ffmpeg/add-freebsd-build branch from 2fcf99c to d861225 Compare July 7, 2025 22:21
@ReenigneArcher ReenigneArcher force-pushed the feat/ffmpeg/add-freebsd-build branch 2 times, most recently from a126326 to fb62d12 Compare July 9, 2025 01:58
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

@ReenigneArcher
Copy link
Member Author

I will merge this since compiling Sunshine is working using these builds. If any solutions to the above items comes up they can be addressed in separate PRs.

@ReenigneArcher ReenigneArcher merged commit 80ad6ba into master Jul 9, 2025
15 of 18 checks passed
@ReenigneArcher ReenigneArcher deleted the feat/ffmpeg/add-freebsd-build branch July 9, 2025 02:34
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.

2 participants