Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Allow a custom FFmpeg build to be provided using CMake variables - #1970

Merged
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg
May 13, 2024
Merged

Allow a custom FFmpeg build to be provided using CMake variables#1970
ReenigneArcher merged 2 commits into
LizardByte:nightlyfrom
chewi:custom-ffmpeg

Conversation

@chewi

@chewichewi commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

Description

For the Gentoo Linux package, we need to be able to use our own build of FFmpeg. We do not use the existing system installation as I understand that is sadly not possible. We do apply your patches for FFmpeg itself and libcbs.

I wanted to add CMake options here for completeness, but then realised they're only for booleans. I considered globbing for *.a for more flexibility, but the linking order does matter. It's just a coincidence that the alphanumeric order happens to be the correct order at present.

This is best viewed without whitespace changes.

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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Comment threadcmake/dependencies/common.cmake Outdated
Comment threadcmake/compile_definitions/linux.cmake
@ReenigneArcher

Copy link
Copy Markdown
Member

This is a long shot, but maybe you could help with this?

#1954

I'm trying to install boost from source on our macos build to save ~20 minutes of CI time. Somehow openssl headers aren't able to be found after this change. #1954 (comment)

@chewi

chewi commented Jan 1, 2024

Copy link
Copy Markdown
ContributorAuthor

This is a long shot, but maybe you could help with this?

Sorry, I deal with a number of environments but practically never encounter Macs. You had a hack to fix the OpenSSL headers before, perhaps that needs removing or adjusting now that you're explicitly installing it.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from 2412aed to 0561448CompareJanuary 1, 2024 16:54
@chewichewi changed the title Allow a custom FFmpeg build to be provided using CMake optionsAllow a custom FFmpeg build to be provided using CMake variablesJan 1, 2024
Comment threadcmake/dependencies/common.cmake Outdated
Comment on lines -82 to -68
${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit concerned about not including these libraries. What's the reason for removing them? Licensing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No, we're dynamically linking them via FFMPEG_PLATFORM_LIBRARIES, although this is also optional via Gentoo's USE flags. I have tested without them. If someone else wanted to statically link these, I suppose they could still provide them via FFMPEG_PLATFORM_LIBRARIES, using their full paths if necessary, but I haven't tried that.

Regarding HDR, I believe we (optionally) bake this support into the same libx265.so as the non-HDR support.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've only looked at the OBS one, but I don't think this would work. All these modules probably assume that the ffmpeg it finds is either a set of dynamic libraries or a set of entirely self-contained static libraries. They would not know that libx264 is also needed, for example. You'd also need to be careful not to pick up a vanilla system ffmpeg.

To be honest, I'm not a big CMake fan and I particularly don't like the find modules. pkg-config alone can handle this much better. In this case, it's a little awkward because you want this to work with your custom ffmpeg build out of the box, and a user could be building from any directory. To avoid needing to run something prior to CMake, you'd need to use configure_file to generate the right .pc file on the fly. Something like this:

Name: FFmpeg for Sunshine
Description:
Version: 0
Libs: -L@CMAKE_SOURCE_DIR@/third-party/ffmpeg/lib -lva -lva-drm -lx264 -x265
Cflags: -I@CMAKE_SOURCE_DIR@/third-party/ffmpeg/include

Gentoo could provide its own up front, and you could generate the above if an existing .pc file is not found. I'm not entirely sure this will work, as configure_file might not actually write the file early enough, but I'd be willing to give it a shot. Let me know what you think.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I gave this a go, and it was looking quite good, but then fell apart when I tried cross-compiling. pkg-config can handle cross-compiling very well under Gentoo, but it gets upset if you try to use files outside of the cross environment like in this case.

If you still want to clean this up a bit, renaming your directories in build-deps could make it simpler:

set(FFMPEG_PREFIX ${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
if(NOTIS_DIRECTORY${FFMPEG_PREFIX})
message(FATAL_ERROR"Unsupported operating system (${CMAKE_SYSTEM_NAME}) and processor (${CMAKE_SYSTEM_PROCESSOR}) combination")
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when I tried cross-compiling

I'd love to have some guidance on this, or info added to the docs. It could possibly save us many hours of CI time for arm builds.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that pkgconf (the modern pkg-config implementation) has a --define-prefix feature that might solve the issue I was having above. This might be good for Gentoo in general, so I'll look into that.

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be:

  • Windows-AMD64
  • Darwin-x86_64
  • Darwin-arm64
  • Linux-x86_64
  • Linux-aarch64
  • Linux-ppc64le (you were also matching ppc64, but it's not ABI-compatible with your binaries)

I see you've been doing ARM builds with QEMU. That hurts. I've done very little cross-compiling outside of Gentoo, and I don't know much about GitHub Actions, but maybe I can offer some advice. I'll get back to you on that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} pairs would be

Cool, I'll work on changing this over.

I see you've been doing ARM builds with QEMU.

It's actually not too bad for the Debian docker images. Those take ~45 minutes, which is somewhat bearable. But for some reason the Fedora images take 4-5 hours. For the life of me I cannot determine why they are so much slower.

I don't know much about GitHub Actions

It's really not much more than running shell/terminal commands. So if you know how to do it in Linux terminal, that's all I would need to try to incorporate it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You don't seem to have reorganised ffmpeg yet. Can we merge this in the meantime since it isn't dependent on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the delay, it's on my list of things to do.

@chewi
chewiforce-pushed the custom-ffmpeg branch 2 times, most recently from e116946 to d576f9eCompareJanuary 6, 2024 00:25
@ReenigneArcherReenigneArcher self-assigned this Feb 4, 2024
ReenigneArcher
ReenigneArcher previously approved these changes May 13, 2024

@ReenigneArcherReenigneArcher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I'm approving this, with the disclaimer that using FFMPEG_PREPARED_BINARIES will never be checked/validated in our CI... so breakages may be likely from time to time.

Also, it's not ideal to use different versions of ffmpeg or the libraries that go along with it as it will increase the burden on support. If a user comes to us for an encoding issue and they are using Gentoo, where should we send them?

@chewi

Copy link
Copy Markdown
ContributorAuthor

Of course, I am perfectly happy to fix any breakage. Having this merged still reduces my own maintenance burden.

Because the system-wide ffmpeg build cannot be used, the versioned Gentoo Sunshine package uses exactly the same ffmpeg release for everybody, currently 6.1.1. The "live" package, which is built from git and is understood to be potentially unstable, uses most of the submodules as you have them. Apart from being able to disable CUDA, AV1, VA-API, or x26[45], ffmpeg is also built the same way for everybody. I therefore don't anticipate any Gentoo-specific problems in this area, but the package does instruct users to contact us first, just as we agreed. If anyone comes here first, then please send them back to bugs.gentoo.org.

chewi added 2 commits May 13, 2024 17:58
It's only needed if libx265 was built with NUMA support. This support
may be disabled in a custom FFmpeg build.
@codecov

codecovBot commented May 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.82%. Comparing base (542cc71) to head (a9d3138).

Additional details and impacted files
@@ Coverage Diff @@## nightly #1970 +/- ##
==========================================
- Coverage 6.99% 6.82% -0.17% 
==========================================
Files 87 87 Lines 17679 17678 -1 Branches 8399 8399 ==========================================
- Hits 1237 1207 -30 - Misses 13808 15781 +1973 + Partials 2634 690 -1944 
FlagCoverage Δ
Linux5.34% <ø> (ø)
Windows2.56% <ø> (ø)
macOS-127.99% <ø> (ø)
macOS-13?
macOS-14?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Sign up for freeto 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

@chewi@ReenigneArcher