Skip to content

Conversation

brad-richardson
Copy link
Contributor

@brad-richardson brad-richardson commented Nov 22, 2022

Description

Use new ffmpeg prebuilts across all platforms, provides library consistency and preps for ffmpeg5 upgrade.

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files)

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

@psyke83
Copy link
Contributor

psyke83 commented Nov 24, 2022

Note that you can remove references to libavdevice58 from the .deb packaging sections (and possibly elsewhere). This will have a side-benefit of making the package compatible with Ubuntu 22.10 (as only libavdevice59 is available, which breaks dependency resolution).

@brad-richardson brad-richardson marked this pull request as ready for review December 10, 2022 16:05
@brad-richardson brad-richardson mentioned this pull request Dec 10, 2022
10 tasks
@ReenigneArcher ReenigneArcher merged commit e8aa749 into LizardByte:nightly Dec 11, 2022
@skbeh
Copy link

skbeh commented Dec 13, 2022

@ReenigneArcher @brad-richardson I think that sunshine should be dynamically linked to distribution-provided dependencies whenever possible, especially when doing custom build (like AUR). It would be better to only use prebuilts when the distribution-provided dependencies are unavailable.

@psyke83
Copy link
Contributor

psyke83 commented Dec 13, 2022

@skbeh

With this PR merged, Sunshine is still configured as a dynamic binary for everything except the ffmpeg libraries. Static builds of the latter are useful not only due to variances in ffmpeg versions between distributions, but also because we need custom patches to the ffmpeg source in order to fix issues with certain encoders.

conn@HP255G7:~$ ldd $(which sunshine)
	linux-vdso.so.1 (0x00007ffc8ab50000)
	libopus.so.0 => /lib/x86_64-linux-gnu/libopus.so.0 (0x00007fdbc71a6000)
	libva.so.2 => /lib/x86_64-linux-gnu/libva.so.2 (0x00007fdbc7fe9000)
	libva-drm.so.2 => /lib/x86_64-linux-gnu/libva-drm.so.2 (0x00007fdbc7fe4000)
	libvdpau.so.1 => /lib/x86_64-linux-gnu/libvdpau.so.1 (0x00007fdbc7fde000)
	libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fdbc7068000)
	libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007fdbc6fc1000)
	libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007fdbc6a00000)
	libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fdbc6f19000)
	libdrm.so.2 => /lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fdbc6f03000)
	libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007fdbc6ef8000)
	libwayland-client.so.0 => /lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fdbc6ee7000)
	libevdev.so.2 => /lib/x86_64-linux-gnu/libevdev.so.2 (0x00007fdbc6ec7000)
	libnuma.so.1 => /lib/x86_64-linux-gnu/libnuma.so.1 (0x00007fdbc6eba000)
	libpulse.so.0 => /lib/x86_64-linux-gnu/libpulse.so.0 (0x00007fdbc6e65000)
	libpulse-simple.so.0 => /lib/x86_64-linux-gnu/libpulse-simple.so.0 (0x00007fdbc6e5e000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdbc6600000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdbc6917000)
	libmvec.so.1 => /lib/x86_64-linux-gnu/libmvec.so.1 (0x00007fdbc6506000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdbc68f7000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdbc6200000)
	libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fdbc68e2000)
	libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fdbc68b8000)
	libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007fdbc688d000)
	libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fdbc686c000)
	librtmp.so.1 => /lib/x86_64-linux-gnu/librtmp.so.1 (0x00007fdbc684d000)
	libssh.so.4 => /lib/x86_64-linux-gnu/libssh.so.4 (0x00007fdbc6499000)
	libpsl.so.5 => /lib/x86_64-linux-gnu/libpsl.so.5 (0x00007fdbc6839000)
	libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fdbc6445000)
	libldap-2.5.so.0 => /lib/x86_64-linux-gnu/libldap-2.5.so.0 (0x00007fdbc61a2000)
	liblber-2.5.so.0 => /lib/x86_64-linux-gnu/liblber-2.5.so.0 (0x00007fdbc6435000)
	libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fdbc60f3000)
	libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fdbc682b000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdbc6419000)
	libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007fdbc640c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fdbc8037000)
	libpulsecommon-16.1.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so (0x00007fdbc606f000)
	libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fdbc6021000)
	libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fdbc6e50000)
	libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fdbc6019000)
	libunistring.so.2 => /lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fdbc5e6f000)
	libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fdbc5c79000)
	libhogweed.so.6 => /lib/x86_64-linux-gnu/libhogweed.so.6 (0x00007fdbc5c31000)
	libnettle.so.8 => /lib/x86_64-linux-gnu/libnettle.so.8 (0x00007fdbc5be1000)
	libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fdbc5b5e000)
	libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fdbc5a95000)
	libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fdbc5a69000)
	libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fdbc5a63000)
	libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fdbc5a56000)
	libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007fdbc5a3b000)
	libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fdbc5a18000)
	libsndfile.so.1 => /lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007fdbc5999000)
	libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fdbc5994000)
	libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fdbc58c2000)
	libasyncns.so.0 => /lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007fdbc58ba000)
	libapparmor.so.1 => /lib/x86_64-linux-gnu/libapparmor.so.1 (0x00007fdbc58a5000)
	libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fdbc588b000)
	libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fdbc574e000)
	libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fdbc5736000)
	libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fdbc572f000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fdbc571c000)
	libFLAC.so.8 => /lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007fdbc56de000)
	libvorbis.so.0 => /lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007fdbc56b1000)
	libvorbisenc.so.2 => /lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007fdbc5606000)
	libogg.so.0 => /lib/x86_64-linux-gnu/libogg.so.0 (0x00007fdbc55fc000)
	libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fdbc54b3000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fdbc5488000)
	liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fdbc5466000)
	libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fdbc5459000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fdbc5433000)

@skbeh
Copy link

skbeh commented Dec 13, 2022

There is no license file in https://github.com/LizardByte/build-deps, which may violate the licenses of these libraries.
Also, static linking x265 may violate patent laws in some countries, so you will have to pay royalties to distribute in these countries.

@psyke83
Copy link
Contributor

psyke83 commented Dec 13, 2022

Yes, a license file should be added.

Can you point me to more information re: royalties for static builds? The x265 source appears to be GPL2, and we have not modified or withheld any source modifications.

@skbeh
Copy link

skbeh commented Dec 13, 2022

@psyke83 Is it possible to publish these patches, or even write a script to allow locally building these libraries and linking them with sunshine easily?

@psyke83
Copy link
Contributor

psyke83 commented Dec 13, 2022

The patches are here: https://github.com/LizardByte/build-deps/tree/master/ffmpeg_patches/ffmpeg

The build procedure is done via a github workflow, but it can be reproduced locally. See: https://github.com/LizardByte/build-deps/blob/master/.github/workflows/build-ffmpeg.yml

@skbeh
Copy link

skbeh commented Dec 13, 2022

@psyke83 It is all about patent. H264 and H265 are patent protected. Using it with FOSS may be acceptable but is indeed questionable.
More information: https://www.reddit.com/r/linux/comments/zh03tv/following_fedora_and_opensuse_manjaro_moves/

@skbeh
Copy link

skbeh commented Dec 13, 2022

@psyke83 I see that most linux distros package x264 and x265. I am not a lawyer, but I think dynamically linking with the distro-provided one is enough to avoid the risk. (It seems that https://github.com/LizardByte/build-deps/tree/master/ffmpeg_patches/ffmpeg is only related to libavcodec.)

@psyke83
Copy link
Contributor

psyke83 commented Dec 13, 2022

While I think this requires more research - and the missing license file definitely needs addressing - I'm not convinced that there's additional risk in statically linking x265. The official ffmpeg site links to static builds of ffmpeg here: https://johnvansickle.com/ffmpeg/

Those builds are licensed as GPL3, and I verified that libx264 and libx265 are present with no dynamic linking whatsover. Note that I'm only a contributor to this repo, so please don't interpret my opinion here as reflecting the project.

@ReenigneArcher
Copy link
Member

The royalties of MPEG-LA are based on units sold. No units sold, means no royalties. Also x265 is not the same as H265.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants