refactor: build FFmpeg from source with NVIDIA CUDA support and remove unnecessary development libraries
Some checks failed
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Failing after 4m23s
Build Worker Base and Application Images / build-docker (push) Has been skipped
Build Worker Base and Application Images / deploy-stack (push) Has been skipped
Some checks failed
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Failing after 4m23s
Build Worker Base and Application Images / build-docker (push) Has been skipped
Build Worker Base and Application Images / deploy-stack (push) Has been skipped
This commit is contained in:
parent
59e8448f0d
commit
e2e5356047
1 changed files with 28 additions and 15 deletions
|
@ -24,14 +24,6 @@ RUN apt-get update && apt-get install -y \
|
|||
libvpx-dev \
|
||||
libmp3lame-dev \
|
||||
libv4l-dev \
|
||||
# FFmpeg development libraries for OpenCV integration
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libavdevice-dev \
|
||||
libavfilter-dev \
|
||||
libswscale-dev \
|
||||
libswresample-dev \
|
||||
# TurboJPEG for fast JPEG encoding
|
||||
libturbojpeg0-dev \
|
||||
# Python development
|
||||
|
@ -52,14 +44,35 @@ RUN cd /tmp && \
|
|||
make install && \
|
||||
rm -rf /tmp/*
|
||||
|
||||
# Download and install prebuilt FFmpeg with CUDA support
|
||||
# Build FFmpeg from source with NVIDIA CUDA support
|
||||
RUN cd /tmp && \
|
||||
echo "Installing prebuilt FFmpeg with CUDA support..." && \
|
||||
wget https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz && \
|
||||
tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz && \
|
||||
cd ffmpeg-master-latest-linux64-gpl && \
|
||||
# Copy binaries to system paths
|
||||
cp bin/* /usr/local/bin/ && \
|
||||
echo "Building FFmpeg with NVIDIA CUDA support..." && \
|
||||
# Download FFmpeg source
|
||||
wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz && \
|
||||
tar -xf ffmpeg-7.1.tar.xz && \
|
||||
cd ffmpeg-7.1 && \
|
||||
# Configure with NVIDIA support
|
||||
./configure \
|
||||
--prefix=/usr/local \
|
||||
--enable-shared \
|
||||
--enable-pic \
|
||||
--enable-gpl \
|
||||
--enable-version3 \
|
||||
--enable-nonfree \
|
||||
--enable-cuda-nvcc \
|
||||
--enable-cuvid \
|
||||
--enable-nvdec \
|
||||
--enable-nvenc \
|
||||
--enable-libnpp \
|
||||
--extra-cflags=-I/usr/local/cuda/include \
|
||||
--extra-ldflags=-L/usr/local/cuda/lib64 \
|
||||
--enable-libx264 \
|
||||
--enable-libx265 \
|
||||
--enable-libvpx \
|
||||
--enable-libmp3lame && \
|
||||
# Build and install
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
ldconfig && \
|
||||
# Verify CUVID decoders are available
|
||||
echo "=== Verifying FFmpeg CUVID Support ===" && \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue