diff --git a/Dockerfile.base b/Dockerfile.base index 6c2f97b..56b4159 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -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 ===" && \