wader / static-ffmpeg

Multi-arch docker image with ffmpeg/ffprobe binaries built as hardened static PIE binaries with no external dependencies
https://hub.docker.com/r/mwader/static-ffmpeg/
MIT License
233 stars 56 forks source link

Cuda compile ffmpeg #482

Open ToshY opened 1 week ago

ToshY commented 1 week ago

Related #480


Hey @wader ๐Ÿ‘‹

This seems this really out of my league. I don't know what to do to even get this to compile right now, but I thought I'll just add the draft here for now anyway.

Issue 1

The install guide shows to install the following packages needed:

sudo apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev

I'm not sure what the libc6 libc6-devlibnuma1 libnuma-dev equivalents are on Alpine, but that's my first roadblock.

Issue 2

Looking at some other FFmpeg Dockerfiles for CUDA support, I see a lot using either nvidia/cuda (ubuntu) or normal ubuntu as base image. Almost makes me think it is either not easy, or not possible to compile for Alpine (?).

Issue 3

One of the other things in the installation guide, is to configure with --enable-nonfree. Now I saw that for libfdk_aac this was denoted in the README that you should build the image yourself, and it also has the --enable-nonfree flag. Would this pose an issue here as well?

wader commented 1 week ago

Related #480

Hey @wader ๐Ÿ‘‹

This seems this really out of my league. I don't know what to do to even get this to compile right now, but I thought I'll just add the draft here for now anyway.

Issue 1

The install guide shows to install the following packages needed:

sudo apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev

I'm not sure what the libc6 libc6-devlibnuma1 libnuma-dev equivalents are on Alpine, but that's my first roadblock.

Yeah this will be a mess probably, not sure there is any sane way to link an executable that include two libc variants. So anything that require gnu libc etc or sdk:s that are only shared object (.so) or archives (a.) files that require some variants of libc that is not musl i think will be hard :(

Issue 2

Looking at some other FFmpeg Dockerfiles for CUDA support, I see a lot using either nvidia/cuda (ubuntu) or normal ubuntu as base image. Almost makes me think it is either not easy, or not possible to compile for Alpine (?).

Mm i guess same a above, if it's not open source or require gnu libc, will be a mess.

Issue 3

One of the other things in the installation guide, is to configure with --enable-nonfree. Now I saw that for libfdk_aac this was denoted in the README that you should build the image yourself, and it also has the --enable-nonfree flag. Would this pose an issue here as well?

This we can probably figure out somehow if it turn out it is possible to link things somehow.

So in summary i think at least at the moment it's hard to link a static binary that includes things that don't work with musl. One solution i guess is to create a different image that links statically with gnu libc etc but that has other issues. My advice (and how i use this Dockerfile in some places) is to use it as a starting point, strip things you don't need, and then build using a different base image and compiler toolchains etc that is gnu libc based if that is needed.