Created
December 28, 2024 09:20
-
-
Save FrankSpierings/1b6db73ddc5e765d4f22ddb19bec593a to your computer and use it in GitHub Desktop.
Build FFmpeg for LibreElec RPi5 with static x264 codec to fix Jellyfin transcoding issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:focal AS build | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update \ | |
&& apt-get dist-upgrade -y \ | |
&& apt-get install -y locales sudo \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN locale-gen en_US.UTF-8 \ | |
&& update-locale LANG=en_US.UTF-8 LANGUAGE=en_US:en | |
ENV LANG=en_US.UTF-8 \ | |
LANGUAGE=en_US:en \ | |
LC_ALL=en_US.UTF-8 | |
RUN adduser --disabled-password --gecos '' docker \ | |
&& adduser docker sudo \ | |
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
RUN apt-get update && apt-get install -y \ | |
curl bash bc gcc-10 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \ | |
unzip diffutils lzop make file g++-10 xfonts-utils xsltproc default-jre-headless python3 \ | |
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl \ | |
golang-1.18-go git openssh-client rsync \ | |
pkg-config \ | |
--no-install-recommends \ | |
&& ln -s /usr/lib/go-1.18 /usr/lib/go \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ | |
--slave /usr/bin/cpp cpp /usr/bin/cpp-10 \ | |
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 | |
RUN update-alternatives --config gcc | |
WORKDIR /building | |
RUN git clone https://code.videolan.org/videolan/x264.git \ | |
&& cd x264 \ | |
&& ./configure --enable-static --disable-shared \ | |
&& make -j$(nproc) \ | |
&& make install | |
WORKDIR /building | |
RUN git clone https://github.com/FFmpeg/FFmpeg.git \ | |
&& cd FFmpeg \ | |
&& ./configure \ | |
--enable-gpl \ | |
--enable-libx264 \ | |
--enable-static \ | |
--disable-shared \ | |
--extra-cflags="-I/usr/local/include" \ | |
--extra-ldflags="-L/usr/local/lib" \ | |
&& make -j$(nproc) \ | |
&& mkdir /app/ \ | |
&& cp ffmpeg ffprobe /app | |
FROM scratch | |
COPY --from=build /app /app | |
CMD ["/app/ffmpeg"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixes Jellyfin issue with
ffmpeg
when transcoding;Unrecognized option 'preset'.
docker build -t buildffmpeg .