summaryrefslogtreecommitdiff
path: root/ffmpeg/Pkgfile
blob: ce9642fc30b13988640fdad0ee3dd461f49df3a8 (plain)
    1 # Description: Complete solution to record, convert and stream audio and video.
    2 # URL: https://ffmpeg.org/
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: yasm
    5 # Optional: alsa-lib cuda dav1d fdk-aac nv-codec-headers gnutls gsm jack jack-audio-connection-kit lame libass libsdl2 libtheora libva libvdpau libvorbis libvpx libwebp opus pulseaudio x264 x265
    6 
    7 name=ffmpeg
    8 version=5.1.2
    9 release=1
   10 source=(https://ffmpeg.org/releases/$name-$version.tar.bz2
   11 	add-av_stream_get_first_dts-for-chromium.patch
   12 	ffmpeg-x264-10bit.sh)
   13 
   14 build() {
   15 	cd $name-$version
   16 
   17 [[ -e '/usr/bin/clang' && -e '/usr/lib/pkgconfig/cuda.pc' && -e '/usr/share/pkgconfig/ffnvcodec.pc' ]] && \
   18 	PKGMK_FFMPEG+=' --enable-cuda-llvm --enable-nonfree --enable-cuda-nvcc --enable-libnpp' && \
   19 	PKGMK_FFMPEG+=' --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64' && PATH="$PATH:/opt/cuda/bin"
   20 
   21 [ -e '/usr/share/pkgconfig/ffnvcodec.pc' ] && PKGMK_FFMPEG+=' --enable-nvdec --enable-nvenc'
   22 [ -e '/usr/include/AMF/core/VulkanAMF.h' ] && PKGMK_FFMPEG+=' --enable-amf'
   23 [ -e '/usr/lib/pkgconfig/libwebp.pc' ] && PKGMK_FFMPEG+=' --enable-libwebp'
   24 [ -e '/usr/lib/pkgconfig/vdpau.pc' ] && PKGMK_FFMPEG+=' --enable-vdpau'
   25 [ -e '/usr/lib/pkgconfig/freetype2.pc' ] && PKGMK_FFMPEG+=' --enable-libfreetype'
   26 [ -e '/usr/lib/pkgconfig/jack.pc' ] && PKGMK_FFMPEG+=' --enable-libjack'
   27 [ -e '/usr/lib/pkgconfig/x264.pc' ] && PKGMK_FFMPEG+=' --enable-libx264'
   28 [ -e '/usr/lib/pkgconfig/x265.pc' ] && PKGMK_FFMPEG+=' --enable-libx265'
   29 [ -e '/usr/lib/pkgconfig/libass.pc' ] && PKGMK_FFMPEG+=' --enable-libass'
   30 [ -e '/usr/lib/libgsm.so' ] && PKGMK_FFMPEG+=' --enable-libgsm'
   31 [ -e '/usr/include/lame/lame.h' ] && PKGMK_FFMPEG+=' --enable-libmp3lame'
   32 [ -e '/usr/lib/pkgconfig/opus.pc' ] && PKGMK_FFMPEG+=' --enable-libopus'
   33 [ -e '/usr/lib/pkgconfig/vpx.pc' ] && PKGMK_FFMPEG+=' --enable-libvpx'
   34 [ -e '/usr/lib/pkgconfig/vorbis.pc' ] && PKGMK_FFMPEG+=' --enable-libvorbis'
   35 [ -e '/usr/lib/pkgconfig/theora.pc' ] && PKGMK_FFMPEG+=' --enable-libtheora'
   36 [ -e '/usr/lib/pkgconfig/libpulse.pc' ] && PKGMK_FFMPEG+=' --enable-libpulse'
   37 [ -e '/usr/lib/pkgconfig/fdk-aac.pc' ] && PKGMK_FFMPEG+=' --enable-libfdk-aac --enable-nonfree'
   38 [ -e '/usr/lib/pkgconfig/dav1d.pc' ] && PKGMK_FFMPEG+=' --enable-libdav1d'
   39 
   40 	if [ -e '/usr/lib/pkgconfig/gnutls.pc' ]; then
   41 		PKGMK_FFMPEG+=' --enable-gnutls'
   42 	else
   43 		PKGMK_FFMPEG+=' --enable-openssl --enable-nonfree'
   44 	fi
   45 
   46 	patch -Np1 -i $SRC/add-av_stream_get_first_dts-for-chromium.patch
   47 
   48 	./configure ${PKGMK_FFMPEG} \
   49 		--prefix=/usr \
   50 		--disable-debug \
   51 		--disable-doc \
   52 		--enable-gpl \
   53 		--enable-version3 \
   54 		--enable-shared \
   55 		--enable-pic \
   56 		--enable-ffplay \
   57 		--enable-avfilter \
   58 		--enable-postproc \
   59 		--enable-pthreads \
   60 		--enable-swresample
   61 
   62 	make
   63 	make DESTDIR=$PKG install install-man
   64 
   65 	rm -r $PKG/usr/share/ffmpeg/examples
   66 
   67 	if [ -e '/usr/lib/pkgconfig/x264.pc' ]; then
   68 		install -m 0755 -D $SRC/ffmpeg-x264-10bit.sh \
   69 			$PKG/usr/bin/ffmpeg-x264-10bit
   70 	fi
   71 }

Generated by cgit