Browse Source

Merge pull request #7378 from thess/ffmpeg-custom

ffmpeg: Add choices to libffmpeg-custom to select and build CLI programs
lilik-openwrt-22.03
Ted Hess 6 years ago
committed by GitHub
parent
commit
49c4ab36d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 5 deletions
  1. +6
    -0
      multimedia/ffmpeg/Config.in
  2. +60
    -5
      multimedia/ffmpeg/Makefile

+ 6
- 0
multimedia/ffmpeg/Config.in View File

@ -125,6 +125,12 @@ config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
select FFMPEG_CUSTOM_PROTOCOL_tcp select FFMPEG_CUSTOM_PROTOCOL_tcp
select FFMPEG_CUSTOM_PROTOCOL_udp select FFMPEG_CUSTOM_PROTOCOL_udp
config FFMPEG_CUSTOM_PROGRAMS
bool "Include ffmpeg command-line utilities"
select PACKAGE_ffmpeg-custom
select PACKAGE_ffserver-custom
select PACKAGE_ffprobe-custom
comment "External Libraries" comment "External Libraries"
config FFMPEG_CUSTOM_SELECT_libfdk-aac config FFMPEG_CUSTOM_SELECT_libfdk-aac


+ 60
- 5
multimedia/ffmpeg/Makefile View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ffmpeg PKG_NAME:=ffmpeg
PKG_VERSION:=3.2.12 PKG_VERSION:=3.2.12
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://ffmpeg.org/releases/ PKG_SOURCE_URL:=https://ffmpeg.org/releases/
@ -254,12 +254,22 @@ $(call Package/ffmpeg/Default)
VARIANT:=full VARIANT:=full
endef endef
define Package/ffmpeg-custom
$(call Package/ffmpeg/Default)
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE+= program (custom)
DEPENDS+= @!ALL libffmpeg-custom
VARIANT:=custom
endef
define Package/ffmpeg/description define Package/ffmpeg/description
$(call Package/ffmpeg/Default/description) $(call Package/ffmpeg/Default/description)
. .
This package contains the FFmpeg command line tool. This package contains the FFmpeg command line tool.
endef endef
Package/ffmpeg-custom/description = $(Package/ffmpeg/description)
define Package/ffprobe define Package/ffprobe
$(call Package/ffmpeg/Default) $(call Package/ffmpeg/Default)
@ -270,12 +280,22 @@ $(call Package/ffmpeg/Default)
VARIANT:=full VARIANT:=full
endef endef
define Package/ffprobe-custom
$(call Package/ffmpeg/Default)
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE+= CLI media identifier (custom)
DEPENDS+= @!ALL libffmpeg-custom
VARIANT:=custom
endef
define Package/ffprobe/description define Package/ffprobe/description
$(call Package/ffmpeg/Default/description) $(call Package/ffmpeg/Default/description)
. .
This package contains the FFprobe command line tool. This package contains the FFprobe command line tool.
endef endef
Package/ffprobe-custom/description = $(Package/ffprobe/description)
define Package/ffserver define Package/ffserver
$(call Package/ffmpeg/Default) $(call Package/ffmpeg/Default)
@ -286,12 +306,23 @@ $(call Package/ffmpeg/Default)
VARIANT:=full VARIANT:=full
endef endef
define Package/ffserver-custom
$(call Package/ffmpeg/Default)
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE+= streaming server (custom)
DEPENDS+= @!ALL libffmpeg-custom
VARIANT:=custom
endef
define Package/ffserver/description define Package/ffserver/description
$(call Package/ffmpeg/Default/description) $(call Package/ffmpeg/Default/description)
. .
This package contains the FFmpeg streaming server. This package contains the FFmpeg streaming server.
endef endef
Package/ffserver-custom/description = $(Package/ffserver/description)
define Package/libffmpeg/Default define Package/libffmpeg/Default
$(call Package/ffmpeg/Default) $(call Package/ffmpeg/Default)
SECTION:=libs SECTION:=libs
@ -527,11 +558,14 @@ ifeq ($(BUILD_VARIANT),custom)
FFMPEG_CONFIGURE+= --enable-nonfree FFMPEG_CONFIGURE+= --enable-nonfree
endif endif
FFMPEG_CONFIGURE+= \
ifneq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
FFMPEG_CONFIGURE+= \
--disable-programs \ --disable-programs \
--disable-avfilter \ --disable-avfilter \
--disable-postproc \
--disable-swresample \
--disable-swresample
endif
FFMPEG_CONFIGURE+= \
--disable-swscale \ --disable-swscale \
--disable-everything \ --disable-everything \
$(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \ $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
@ -568,9 +602,11 @@ ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
--enable-libshine --enable-encoder=libshine --enable-libshine --enable-encoder=libshine
endif endif
ifneq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),)
ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
FFMPEG_CONFIGURE+= \ FFMPEG_CONFIGURE+= \
--enable-libx264 --enable-encoder=libx264 --enable-libx264 --enable-encoder=libx264
else
FFMPEG_CONFIGURE+= --disable-postproc
endif endif
endif endif
@ -641,8 +677,16 @@ define Build/InstallDev/custom
$(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
ifeq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avfilter,swresample}.{a,so*} $(1)/usr/lib/
endif
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
endif
endef endef
# Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc) # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
@ -700,6 +744,8 @@ define Package/ffmpeg/install
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
endef endef
Package/ffmpeg-custom/install = $(Package/ffmpeg/install)
define Package/ffprobe/install define Package/ffprobe/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
@ -713,6 +759,12 @@ endef
define Package/libffmpeg-custom/install define Package/libffmpeg-custom/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
endif
ifeq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avfilter,swresample}.so.* $(1)/usr/lib/
endif
endef endef
# Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc) # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
@ -734,6 +786,9 @@ Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
$(eval $(call BuildPackage,ffmpeg)) $(eval $(call BuildPackage,ffmpeg))
$(eval $(call BuildPackage,ffprobe)) $(eval $(call BuildPackage,ffprobe))
$(eval $(call BuildPackage,ffserver)) $(eval $(call BuildPackage,ffserver))
$(eval $(call BuildPackage,ffmpeg-custom))
$(eval $(call BuildPackage,ffprobe-custom))
$(eval $(call BuildPackage,ffserver-custom))
$(eval $(call BuildPackage,libffmpeg-audio-dec)) $(eval $(call BuildPackage,libffmpeg-audio-dec))
$(eval $(call BuildPackage,libffmpeg-full)) $(eval $(call BuildPackage,libffmpeg-full))
$(eval $(call BuildPackage,libffmpeg-mini)) $(eval $(call BuildPackage,libffmpeg-mini))


Loading…
Cancel
Save