Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

FFMPEG dependency update

Open PapyKahan opened this issue 3 years ago • 9 comments

Describe the bug

Hi guys I would like to update ffmpeg library, but I'm facing this issues:

  • CBS is now included into ffmpeg.
  • cbs.h, cbs_h264.h and cbs_h265.h aren't copied into local64/include/libavcodec directory.
  • Sunshine compilation fails during linking as cbs.o, cbs_h264.o and cbs_h265.o has been statically linked with ffmpeg. It conflicts with Sunshine's cbs.

Replacing current CBS implementation by ffmpeg one is a solution, only if I can fix the first issue.

I don't know how to add parameters to media-autobuild_suite so it can pass it to ffmpeg autoconf. It seems that options are into ffmpeg's CONFIG_EXTRA variable, but we can't set them externaly. Plus I don't know if it will copy right headers file to include directory.

To Reproduce Only for development purpose, then we must use Sunshine's Workflows.

  1. Execute media-autobuild_suite batch file
  2. Create a sunshine-prebuild.zip file (see SunshineStream/Sunshine-Windows-Prebuilt workflow to replicate the process localy)
  3. Comment CMakeList.txt sunshine-prebuild.zip
  4. Copy sunshine-prebuild.zip into Sunshine's build directory
  5. Execute Sunshine build.

Expected behavior Sunshine build and run correctly.

PapyKahan avatar Feb 08 '22 15:02 PapyKahan

If you just need to change the options for ffmpeg ./autoconfig (like --enable-d3dv11a or --enable-amf or other similar options), you just need to edit the ffmpeg_options.txt inside the Sunshine-Windows-Prebuilt folder. These options are applied automatically by media-autobuild_suite

TheElixZammuto avatar Feb 09 '22 09:02 TheElixZammuto

I know, but CBS is not available from command line as an --enable-* or --disable-*, it's specified into ffmpeg autoconf. This option is into CONFIG_EXTRA variable.

CBS obj are clearly compiled and linked into ffmpeg static library, but headers aren't copied into local64/include directory.

Another solution is to copy needed cbs*.h into local64/include, but it's an ugly solution.

PapyKahan avatar Feb 09 '22 14:02 PapyKahan

Ok, CBS is not intended to be exposed outside libavcodec lib. That's why there's no reference into include directory. I've managed to build a version with an up to date ffmpeg builded with SunshineStream/Sunshine-Windows-Prebuilt default parameters. @ReenigneArcher is it possible to create a new release of SunshineStream/Sunshine-Windows-Prebuilt binary ? I will create a pull request.

I currently use my version to play some games from my streaming server, but I only have an AMD graphic card. So I could only test AMD and Software encoding.

For the moment everything seems to be fine.

PapyKahan avatar Feb 10 '22 20:02 PapyKahan

Let's move development discussion on this to #50

ReenigneArcher avatar Feb 11 '22 00:02 ReenigneArcher

This issue is stale because it has been open for 30 days with no activity. Remove the stale label or comment, otherwise this will be closed in 5 days.

github-actions[bot] avatar Mar 13 '22 00:03 github-actions[bot]

We should probably use vcpkg to handle the ffmpeg dependency. It will make it more consistent between the different OSes.

Currently they are on 4.4.1, but have an open PR to update to 5.0. https://github.com/microsoft/vcpkg/pull/23312

Unfortunately it breaks a lot of other packages so they are currently blocking the PR from being merged.

ReenigneArcher avatar Mar 18 '22 02:03 ReenigneArcher

This issue is stale because it has been open for 30 days with no activity. Remove the stale label or comment, otherwise this will be closed in 5 days.

github-actions[bot] avatar Apr 18 '22 00:04 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Apr 24 '22 00:04 github-actions[bot]

This issue has been fixed and will be available in the next release.

LizardByte-bot avatar Dec 27 '22 14:12 LizardByte-bot