123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645 |
- #
- # Copyright (C) 2006-2017 OpenWrt.org
- #
- # This is free software, licensed under the GNU General Public License v2.
- # See /LICENSE for more information.
- #
- include $(TOPDIR)/rules.mk
- PKG_NAME:=ffmpeg
- PKG_VERSION:=3.2.2
- PKG_RELEASE:=1
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
- PKG_SOURCE_URL:=https://ffmpeg.org/releases/
- PKG_MD5SUM:=e34d1b92c5d844f2a3611c741a6dba18
- PKG_HASH:=3f01bd1fe1a17a277f8c84869e5d9192b4b978cb660872aa2b54c3cc8a2fedfc
- PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
- PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
- PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
- FFMPEG_CUSTOM_ENCODERS:= \
- ac3 \
- jpegls \
- mpeg1video \
- mpeg2video \
- mpeg4 \
- pcm_s16be \
- pcm_s16le \
- png \
- vorbis \
- zlib \
- FFMPEG_CUSTOM_DECODERS:= \
- aac \
- ac3 \
- alac \
- amrnb \
- amrwb \
- ape \
- atrac3 \
- flac \
- gif \
- h264 \
- hevc \
- jpegls \
- mp2 \
- mp3 \
- mpeg1video \
- mpeg2video \
- mpeg4 \
- mpegvideo \
- mpc7 \
- mpc8 \
- pcm_s16be \
- pcm_s16le \
- png \
- vc1 \
- vorbis \
- wavpack \
- wmav1 \
- wmav2 \
- zlib \
- FFMPEG_CUSTOM_MUXERS:= \
- ac3 \
- ffm \
- h264 \
- hevc \
- mp3 \
- mp4 \
- mpeg1video \
- mpeg2video \
- mpegts \
- ogg \
- rtp \
- FFMPEG_CUSTOM_DEMUXERS:= \
- aac \
- ac3 \
- amr \
- ape \
- avi \
- flac \
- ffm \
- h264 \
- hevc \
- matroska \
- mov \
- mp3 \
- mpegps \
- mpegts \
- mpegvideo \
- mpc \
- mpc8 \
- ogg \
- rm \
- rtsp \
- rtp \
- sdp \
- v4l2 \
- vc1 \
- wav \
- wv \
- FFMPEG_CUSTOM_PARSERS:= \
- aac \
- flac \
- ac3 \
- h264 \
- hevc \
- mpegaudio \
- mpeg4video \
- mpegvideo \
- vc1 \
- FFMPEG_CUSTOM_PROTOCOLS:= \
- file http icecast pipe rtp tcp udp
- FFMPEG_MINI_DECODERS:= \
- aac \
- ac3 \
- flac \
- h264 \
- hevc \
- jpegls \
- mp3 \
- mpeg1video \
- mpeg2video \
- mpeg4 \
- mpegvideo \
- opus \
- png \
- vc1 \
- vorbis \
- wmav1 \
- wmav2 \
- FFMPEG_MINI_DEMUXERS:= \
- avi \
- flac \
- matroska \
- mov \
- mp3 \
- mpegts \
- mpegvideo \
- ogg \
- FFMPEG_MINI_PROTOCOLS:= \
- file \
- FFMPEG_AUDIO_DECODERS:= \
- aac \
- aac_latm \
- ac3 \
- adpcm_* \
- alac \
- amrnb \
- amrwb \
- ape \
- atrac3 \
- flac \
- mp2 \
- mp3* \
- mpc7 \
- mpc8 \
- opus \
- pcm_* \
- vorbis \
- wavpack \
- wmav1 \
- wmav2 \
- wmalossless \
- wmapro \
- zlib \
- FFMPEG_AUDIO_DEMUXERS:= \
- aac \
- ac3 \
- aiff \
- amr \
- ape \
- avi \
- flac \
- ffm \
- matroska \
- mp3 \
- mov \
- mpc \
- mpc8 \
- mpegts \
- ogg \
- rm \
- rtsp \
- rtp \
- sdp \
- wav \
- wv \
- FFMPEG_AUDIO_PARSERS:= \
- aac \
- aac_latm \
- ac3 \
- flac \
- mpegaudio \
- opus \
- FFMPEG_AUDIO_PROTOCOLS:= \
- file http icecast rtp tcp udp
- PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
- PKG_CONFIG_DEPENDS:= \
- $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
- $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
- $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
- $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
- $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
- $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
- include $(INCLUDE_DIR)/package.mk
- define Package/ffmpeg/Default
- TITLE:=FFmpeg
- URL:=http://ffmpeg.mplayerhq.hu/
- endef
- define Package/ffmpeg/Default/description
- FFmpeg is a a software package that can record, convert and stream digital
- audio and video in numerous formats.
- endef
- define Package/ffmpeg
- $(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= program
- DEPENDS+= +libpthread +libffmpeg-full
- VARIANT:=full
- endef
- define Package/ffmpeg/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains the FFmpeg command line tool.
- endef
- define Package/ffprobe
- $(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= CLI media identifier
- DEPENDS+= +libffmpeg-full
- VARIANT:=full
- endef
- define Package/ffprobe/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains the FFprobe command line tool.
- endef
- define Package/ffserver
- $(call Package/ffserver/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= streaming server
- DEPENDS+= +libpthread +libffmpeg-full
- VARIANT:=full
- endef
- define Package/ffserver/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains the FFmpeg streaming server.
- endef
- define Package/libffmpeg/Default
- $(call Package/ffmpeg/Default)
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE+= libraries
- DEPENDS+= @BUILD_PATENTED +libpthread +zlib +libbz2
- PROVIDES:= libffmpeg
- endef
- define Package/libffmpeg-custom
- $(call Package/libffmpeg/Default)
- TITLE+= (custom)
- DEPENDS+= +FFMPEG_CUSTOM_SELECT_libopus:libopus \
- +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib
- VARIANT:=custom
- MENU:=1
- endef
- define Package/libffmpeg-custom/config
- source "$(SOURCE)/Config.in"
- endef
- define Package/libffmpeg-custom/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains customized FFmpeg shared libraries.
- endef
- define Package/libffmpeg-audio-dec
- $(call Package/libffmpeg/Default)
- TITLE+= (audio)
- VARIANT:=audio-dec
- endef
- define Package/libffmpeg-audio-dec/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains FFmpeg shared libraries for audio decoding
- endef
- define Package/libffmpeg-full
- $(call Package/libffmpeg/Default)
- TITLE+= (full)
- DEPENDS+= +alsa-lib +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib +libopus
- VARIANT:=full
- endef
- define Package/libffmpeg-full/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains full-featured FFmpeg shared libraries.
- endef
- define Package/libffmpeg-mini
- $(call Package/libffmpeg/Default)
- TITLE+= (mini)
- VARIANT:=mini
- endef
- define Package/libffmpeg-mini/description
- $(call Package/ffmpeg/Default/description)
- .
- This package contains minimal-featured FFmpeg shared libraries.
- endef
- FFMPEG_CONFIGURE:= \
- CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- ./configure \
- --enable-cross-compile \
- --cross-prefix="$(TARGET_CROSS)" \
- --arch="$(ARCH)" \
- --target-os=linux \
- --prefix="/usr" \
- --pkg-config="pkg-config" \
- --enable-shared \
- --enable-static \
- --enable-small \
- --enable-pthreads \
- --enable-zlib \
- --disable-doc \
- --disable-debug \
- \
- --enable-gpl \
- --enable-version3 \
- \
- --disable-dxva2 \
- --disable-lzma \
- --disable-vaapi \
- --disable-vda \
- --disable-vdpau \
- --disable-outdevs
- ifeq ($(CONFIG_SOFT_FLOAT),y)
- FFMPEG_CONFIGURE += \
- --disable-altivec \
- --disable-vsx \
- --disable-power8 \
- --disable-amd3dnow \
- --disable-amd3dnowext \
- --disable-mmx \
- --disable-mmxext \
- --disable-sse \
- --disable-sse2 \
- --disable-sse3 \
- --disable-ssse3 \
- --disable-sse4 \
- --disable-sse42 \
- --disable-avx \
- --disable-xop \
- --disable-fma3 \
- --disable-fma4 \
- --disable-avx2 \
- --disable-aesni \
- --disable-armv5te \
- --disable-armv6 \
- --disable-armv6t2 \
- --disable-inline-asm \
- --disable-mipsdsp \
- --disable-mipsdspr2 \
- --disable-mipsfpu \
- --disable-msa \
- --disable-mmi \
- --disable-fast-unaligned \
- --disable-runtime-cpudetect
- else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
- FFMPEG_CONFIGURE += \
- --disable-runtime-cpudetect
- else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
- FFMPEG_CONFIGURE += \
- --disable-altivec
- endif
- ifneq ($(CONFIG_YASM),y)
- FFMPEG_CONFIGURE += \
- --disable-yasm
- endif
- #selectibly disable optimizations according to arch/cpu type
- ifneq ($(findstring arm,$(CONFIG_ARCH)),)
- ifeq (,$(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)))
- FFMPEG_CONFIGURE+= \
- --disable-vfp
- endif
- ifeq (,$(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)))
- FFMPEG_CONFIGURE+= \
- --disable-neon
- endif
- endif
- ifeq ($(BUILD_VARIANT),full)
- FFMPEG_CONFIGURE+= \
- --enable-libopus --enable-decoder=libopus \
- $(if $(CONFIG_PACKAGE_libx264),--enable-libx264) \
- $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
- endif
- ifeq ($(BUILD_VARIANT),custom)
- FFMPEG_ENABLE= \
- $(foreach c, $(2), \
- $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
- )
- FFMPEG_CONFIGURE+= \
- --disable-programs \
- --disable-avfilter \
- --disable-postproc \
- --disable-swresample \
- --disable-swscale \
- --disable-everything \
- $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
- $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
- $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
- $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
- $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
- $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
- ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
- FFMPEG_CONFIGURE+= \
- --enable-decoder=adpcm_ima_wav \
- --enable-decoder=adpcm_ima_qt \
- --enable-decoder=adpcm_ms \
- endif
- ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
- FFMPEG_CONFIGURE+= \
- --enable-libopus --enable-decoder=libopus
- endif
- ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_x264),y)
- FFMPEG_CONFIGURE+= \
- --enable-libx264
- endif
- ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_mp3lame),y)
- FFMPEG_CONFIGURE+= \
- --enable-libmp3lame
- endif
- endif
- ifeq ($(BUILD_VARIANT),audio-dec)
- FFMPEG_ENABLE= \
- $(foreach c, $(2), \
- --enable-$(1)="$(c)" \
- )
- FFMPEG_CONFIGURE+= \
- --disable-programs \
- --disable-avfilter \
- --disable-postproc \
- --disable-swresample \
- --disable-swscale \
- --disable-everything \
- $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
- $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
- $(call FFMPEG_ENABLE,parser,$(FFMPEG_AUDIO_PARSERS)) \
- $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
- --disable-decoder=pcm_bluray,pcm_dvd \
- endif
- ifeq ($(BUILD_VARIANT),mini)
- FFMPEG_ENABLE= \
- $(foreach c, $(2), \
- --enable-$(1)="$(c)" \
- )
- FFMPEG_CONFIGURE+= \
- --disable-programs \
- --disable-avdevice \
- --disable-avfilter \
- --disable-postproc \
- --disable-swresample \
- --disable-swscale \
- --disable-everything \
- $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
- $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
- $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
- endif
- ifneq ($(CONFIG_TARGET_x86),)
- TARGET_CFLAGS += -fomit-frame-pointer
- endif
- define Build/Configure
- ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
- endef
- define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- all install
- endef
- define Build/InstallDev/custom
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
- endef
- define Build/InstallDev/full
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale} $(1)/usr/include/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.{a,so*} $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
- endef
- define Build/InstallDev/mini
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
- endef
- Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
- # XXX: attempt at installing "best" dev files available
- ifeq ($(BUILD_VARIANT),custom)
- # XXX: only install "custom" dev files if -full & -mini are not selected
- ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
- Build/InstallDev = $(Build/InstallDev/custom)
- endif
- endif
- ifeq ($(BUILD_VARIANT),audio-dec)
- # XXX: only install "audio-dec" dev files if -full & -mini are not selected
- ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
- Build/InstallDev = $(Build/InstallDev/audio-dec)
- endif
- endif
- ifeq ($(BUILD_VARIANT),full)
- # XXX: always install "full" dev files if -full is selected
- Build/InstallDev = $(Build/InstallDev/full)
- endif
- ifeq ($(BUILD_VARIANT),mini)
- # XXX: only install "mini" dev files if -full is not selected
- ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
- Build/InstallDev = $(Build/InstallDev/mini)
- endif
- endif
- define Package/ffmpeg/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
- endef
- define Package/ffprobe/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
- endef
- define Package/ffserver/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
- endef
- define Package/libffmpeg-custom/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
- endef
- define Package/libffmpeg-full/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.so.* $(1)/usr/lib/
- endef
- define Package/libffmpeg-mini/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
- endef
- Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
- $(eval $(call BuildPackage,ffmpeg))
- $(eval $(call BuildPackage,ffprobe))
- $(eval $(call BuildPackage,ffserver))
- $(eval $(call BuildPackage,libffmpeg-audio-dec))
- $(eval $(call BuildPackage,libffmpeg-full))
- $(eval $(call BuildPackage,libffmpeg-mini))
- ifneq ($(CONFIG_ALL),y)
- $(eval $(call BuildPackage,libffmpeg-custom))
- endif
|