2022-09-02 01:21:05 +00:00
|
|
|
# Maintainer: graysky <therealgraysky AT proton DOT me>
|
|
|
|
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
|
|
|
|
# Contributor: Ionut Biru <ibiru@archlinux.org>
|
|
|
|
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
|
|
|
|
# Contributor: Paul Mattal <paul@archlinux.org>
|
|
|
|
|
|
|
|
pkgbase=ffmpeg-rpi
|
|
|
|
pkgname=($pkgbase $pkgbase-bin)
|
2023-04-13 16:39:57 +00:00
|
|
|
pkgver=4.4.4
|
2024-02-29 20:37:36 +00:00
|
|
|
pkgrel=5
|
2022-09-02 01:21:05 +00:00
|
|
|
arch=(aarch64)
|
|
|
|
url=https://ffmpeg.org/
|
|
|
|
license=(GPL3)
|
|
|
|
makedepends=(
|
|
|
|
amf-headers
|
|
|
|
avisynthplus
|
|
|
|
clang
|
2023-03-02 09:20:34 +00:00
|
|
|
debugedit
|
2022-09-02 01:21:05 +00:00
|
|
|
ffnvcodec-headers
|
|
|
|
git
|
|
|
|
ladspa
|
|
|
|
nasm
|
|
|
|
)
|
|
|
|
depends=(
|
|
|
|
alsa-lib
|
|
|
|
bzip2
|
|
|
|
fontconfig
|
|
|
|
fribidi
|
|
|
|
gmp
|
|
|
|
gnutls
|
|
|
|
gsm
|
|
|
|
jack
|
|
|
|
lame
|
|
|
|
libass.so
|
|
|
|
libavc1394
|
|
|
|
libbluray.so
|
|
|
|
libepoxy
|
|
|
|
libdav1d.so
|
|
|
|
libdrm
|
|
|
|
libfreetype.so
|
|
|
|
libiec61883
|
|
|
|
libmodplug
|
|
|
|
libpulse
|
|
|
|
libraw1394
|
|
|
|
librsvg-2.so
|
|
|
|
libsoxr
|
|
|
|
libssh
|
|
|
|
libtheora
|
|
|
|
libva.so
|
|
|
|
libva-drm.so
|
|
|
|
libva-x11.so
|
|
|
|
libvdpau
|
|
|
|
libvidstab.so
|
|
|
|
libvorbisenc.so
|
|
|
|
libvorbis.so
|
|
|
|
libvpx.so
|
|
|
|
libwebp
|
|
|
|
libx11
|
|
|
|
libx264.so
|
|
|
|
libx265.so
|
|
|
|
libxcb
|
|
|
|
libxext
|
|
|
|
libxml2
|
|
|
|
libxv
|
|
|
|
libxvidcore.so
|
|
|
|
libzimg.so
|
|
|
|
opencore-amr
|
|
|
|
openjpeg2
|
|
|
|
opus
|
|
|
|
sdl2
|
|
|
|
speex
|
|
|
|
srt
|
|
|
|
v4l-utils
|
|
|
|
xz
|
|
|
|
zlib
|
|
|
|
)
|
|
|
|
options=(debug)
|
2022-12-18 21:44:39 +00:00
|
|
|
source=(https://ffmpeg.org/releases/${pkgname/-rpi}-$pkgver.tar.xz{,.asc}
|
2022-09-02 01:21:05 +00:00
|
|
|
0001-vmaf-model-path.patch
|
2023-04-13 16:39:57 +00:00
|
|
|
0002-ffmpeg-4.4.4n-rpi.patch
|
2023-03-02 09:20:34 +00:00
|
|
|
0003-fix_flags.patch
|
2022-09-02 01:21:05 +00:00
|
|
|
)
|
2023-04-13 16:39:57 +00:00
|
|
|
sha256sums=('e80b380d595c809060f66f96a5d849511ef4a76a26b76eacf5778b94c3570309'
|
2022-12-18 21:44:39 +00:00
|
|
|
'SKIP'
|
2023-03-02 09:20:34 +00:00
|
|
|
'2e8d885de789b461ddf63c10646cdb16ad5519b671efd1624bf5a8e7da43dbf3'
|
2023-05-09 19:03:09 +00:00
|
|
|
'c3db95417fbfdd9e7a96d63cb2a91ad1eee17ae233c0ef1cf1588f8c0eff90fa'
|
2023-03-02 09:20:34 +00:00
|
|
|
'42f57e7a55f250811515571c870372d6ed0ed504f823b341d26f383c082ce0a0')
|
2022-12-18 21:44:39 +00:00
|
|
|
validpgpkeys=('FCF986EA15E6E293A5644F10B4322F04D67658D8')
|
2022-09-02 01:21:05 +00:00
|
|
|
|
|
|
|
prepare() {
|
2022-12-18 21:44:39 +00:00
|
|
|
cd "${pkgname/-rpi}-$pkgver"
|
|
|
|
|
2022-09-02 01:21:05 +00:00
|
|
|
local src
|
|
|
|
for src in "${source[@]}"; do
|
|
|
|
src="${src%%::*}"
|
|
|
|
src="${src##*/}"
|
|
|
|
[[ $src = *.patch ]] || continue
|
|
|
|
echo "Applying patch $src..."
|
|
|
|
patch -Np1 < "../$src"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2022-12-18 21:44:39 +00:00
|
|
|
cd "${pkgname/-rpi}-$pkgver"
|
2022-09-02 01:21:05 +00:00
|
|
|
|
|
|
|
# -march= defined in /etc/makepkg.conf will override the value for -mcpu we
|
|
|
|
# uses here so unset them and redefine below
|
|
|
|
unset CFLAGS CXXFLAGS
|
|
|
|
|
|
|
|
if [[ $CARCH = "armv7h" ]]; then
|
|
|
|
# we use -mcpu=cortex-a53 rather than cortex-a72 to maximize RPi 3B and RPi 4B/400 compatibility
|
|
|
|
CFLAGS="-mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
|
|
|
|
elif [[ $CARCH = "aarch64" ]]; then
|
|
|
|
# note that we use a value of cortex-a53 here to allow RPi3 and RPi4 to use the same package
|
|
|
|
# consistent with rationale of previous comment
|
|
|
|
CFLAGS="-mcpu=cortex-a53"
|
|
|
|
fi
|
|
|
|
|
|
|
|
export CFLAGS+=" -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection"
|
|
|
|
export CXXFLAGS+="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
|
|
|
|
|
|
|
|
_args=(
|
|
|
|
--prefix=/usr
|
|
|
|
--incdir=/usr/include/ffmpeg-rpi
|
|
|
|
--libdir=/usr/lib/ffmpeg-rpi
|
|
|
|
--disable-debug
|
|
|
|
--disable-static
|
|
|
|
--disable-stripping
|
2024-02-29 20:37:36 +00:00
|
|
|
--disable-htmlpages
|
2022-09-02 01:21:05 +00:00
|
|
|
--enable-amf
|
|
|
|
--enable-avisynth
|
|
|
|
--enable-cuda-llvm
|
|
|
|
--enable-fontconfig
|
|
|
|
--enable-gmp
|
|
|
|
--enable-gnutls
|
|
|
|
--enable-gpl
|
|
|
|
--enable-ladspa
|
|
|
|
--enable-libass
|
|
|
|
--enable-libbluray
|
|
|
|
--enable-libdav1d
|
|
|
|
--enable-libdrm
|
|
|
|
--enable-libfreetype
|
|
|
|
--enable-libfribidi
|
|
|
|
--enable-libgsm
|
|
|
|
--enable-libiec61883
|
|
|
|
--enable-libjack
|
|
|
|
--enable-libmodplug
|
|
|
|
--enable-libmp3lame
|
|
|
|
--enable-libopencore_amrnb
|
|
|
|
--enable-libopencore_amrwb
|
|
|
|
--enable-libopenjpeg
|
|
|
|
--enable-libopus
|
|
|
|
--enable-libpulse
|
|
|
|
--enable-librsvg
|
|
|
|
--enable-libsoxr
|
|
|
|
--enable-libspeex
|
|
|
|
--enable-libsrt
|
|
|
|
--enable-libssh
|
|
|
|
--enable-libtheora
|
|
|
|
--enable-libv4l2
|
|
|
|
--enable-libvidstab
|
|
|
|
--enable-libvorbis
|
|
|
|
--enable-libvpx
|
|
|
|
--enable-libwebp
|
|
|
|
--enable-libx264
|
|
|
|
--enable-libx265
|
|
|
|
--enable-libxcb
|
|
|
|
--enable-libxml2
|
|
|
|
--enable-libxvid
|
|
|
|
--enable-libzimg
|
|
|
|
--enable-libxvid
|
|
|
|
--enable-libzimg
|
|
|
|
--enable-shared
|
|
|
|
--enable-version3
|
|
|
|
--host-cflags="-fPIC"
|
|
|
|
)
|
|
|
|
|
|
|
|
# for hw decoding
|
|
|
|
_args+=(
|
|
|
|
--disable-mmal
|
|
|
|
--enable-neon
|
|
|
|
--enable-v4l2-request
|
|
|
|
--enable-libudev
|
|
|
|
--enable-epoxy
|
|
|
|
--enable-sand
|
|
|
|
)
|
|
|
|
|
|
|
|
./configure "${_args[@]}"
|
|
|
|
make
|
|
|
|
make tools/qt-faststart
|
2024-02-29 20:37:36 +00:00
|
|
|
#make doc/ffmpeg.1
|
2022-09-02 01:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_ffmpeg-rpi() {
|
|
|
|
pkgdesc='FFmpeg from the release/4.4 branch with hw accel for RPi 3/4/400'
|
|
|
|
optdepends=(
|
|
|
|
'avisynthplus: AviSynthPlus support'
|
|
|
|
'ffmpeg-rpi-bin: binaries and man pages'
|
|
|
|
'ladspa: LADSPA filters'
|
|
|
|
)
|
|
|
|
provides=(
|
|
|
|
libavcodec.so
|
|
|
|
libavdevice.so
|
|
|
|
libavfilter.so
|
|
|
|
libavformat.so
|
|
|
|
libavutil.so
|
|
|
|
libpostproc.so
|
|
|
|
libswresample.so
|
|
|
|
libswscale.so
|
|
|
|
)
|
|
|
|
conflicts=(ffmpeg4.4 ffmpeg-shinobi)
|
|
|
|
|
2022-12-18 21:44:39 +00:00
|
|
|
make DESTDIR="${pkgdir}" -C "${pkgname/-rpi}-$pkgver" install
|
2022-09-02 01:21:05 +00:00
|
|
|
|
|
|
|
cd "${pkgdir}"
|
|
|
|
|
|
|
|
# Move libs to /usr/lib, except the .so symlinks
|
|
|
|
local f
|
|
|
|
for f in usr/lib/ffmpeg-rpi/*; do
|
|
|
|
if [[ $f == *.so ]]; then
|
|
|
|
ln -srf -- usr/lib/"$(readlink "$f")" "$f"
|
|
|
|
elif [[ ! -d $f ]]; then
|
|
|
|
mv "$f" usr/lib
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# these go in ffmpeg-rpi-bin
|
|
|
|
rm -r usr/share usr/bin
|
|
|
|
}
|
|
|
|
|
|
|
|
package_ffmpeg-rpi-bin() {
|
|
|
|
pkgdesc='binaries and man pages'
|
|
|
|
depends=(ffmpeg-rpi)
|
|
|
|
conflicts=(ffmpeg4.4 ffmpeg-shinobi ffmpeg)
|
|
|
|
provides=(ffmpeg)
|
|
|
|
|
2022-12-18 21:44:39 +00:00
|
|
|
make DESTDIR="${pkgdir}" -C "${pkgname/-rpi-bin}-$pkgver" install install-man
|
2022-09-02 01:21:05 +00:00
|
|
|
|
|
|
|
cd "${pkgdir}"
|
|
|
|
|
|
|
|
# Move libs to /usr/lib, except the .so symlinks
|
|
|
|
local f
|
|
|
|
for f in usr/lib/ffmpeg-rpi/*; do
|
|
|
|
if [[ $f == *.so ]]; then
|
|
|
|
ln -srf -- usr/lib/"$(readlink "$f")" "$f"
|
|
|
|
elif [[ ! -d $f ]]; then
|
|
|
|
mv "$f" usr/lib
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# these are provided by ffmpeg-rpi
|
|
|
|
rm -r usr/include usr/lib
|
|
|
|
}
|
|
|
|
# vim:set sw=2 et:
|