You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

746 lines
18 KiB

  1. #
  2. # Copyright (C) 2017-2020 Ian Leonard <antonlacon@gmail.com>
  3. # Copyright (C) 2018 Ted Hess <thess@kitschensync.net>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=ffmpeg
  10. PKG_VERSION:=4.2.2
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://ffmpeg.org/releases/
  14. PKG_HASH:=cb754255ab0ee2ea5f66f8850e1bd6ad5cac1cd855d0a2f4990fb8c668b0d29c
  15. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
  16. Ian Leonard <antonlacon@gmail.com>
  17. PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later LGPL-3.0-or-later
  18. PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
  19. PKG_CPE_ID:=cpe:/a:ffmpeg:ffmpeg
  20. FFMPEG_CUSTOM_ENCODERS:= \
  21. ac3 \
  22. jpegls \
  23. mpeg1video \
  24. mpeg2video \
  25. mpeg4 \
  26. pcm_s16be \
  27. pcm_s16le \
  28. png \
  29. vorbis \
  30. zlib \
  31. FFMPEG_CUSTOM_DECODERS:= \
  32. aac \
  33. ac3 \
  34. alac \
  35. amrnb \
  36. amrwb \
  37. ape \
  38. atrac3 \
  39. flac \
  40. gif \
  41. h264 \
  42. hevc \
  43. jpegls \
  44. mp2 \
  45. mp3 \
  46. mpeg1video \
  47. mpeg2video \
  48. mpeg4 \
  49. mpegvideo \
  50. mpc7 \
  51. mpc8 \
  52. pcm_s16be \
  53. pcm_s16le \
  54. png \
  55. vc1 \
  56. vorbis \
  57. wavpack \
  58. wmav1 \
  59. wmav2 \
  60. zlib \
  61. FFMPEG_CUSTOM_MUXERS:= \
  62. ac3 \
  63. ffm \
  64. h264 \
  65. hevc \
  66. mp3 \
  67. mp4 \
  68. mpeg1video \
  69. mpeg2video \
  70. mpegts \
  71. ogg \
  72. rtp \
  73. FFMPEG_CUSTOM_DEMUXERS:= \
  74. aac \
  75. ac3 \
  76. amr \
  77. ape \
  78. avi \
  79. flac \
  80. ffm \
  81. h264 \
  82. hevc \
  83. matroska \
  84. mov \
  85. mp3 \
  86. mpegps \
  87. mpegts \
  88. mpegvideo \
  89. mpc \
  90. mpc8 \
  91. ogg \
  92. rm \
  93. rtsp \
  94. rtp \
  95. sdp \
  96. v4l2 \
  97. vc1 \
  98. wav \
  99. wv \
  100. FFMPEG_CUSTOM_PARSERS:= \
  101. aac \
  102. flac \
  103. ac3 \
  104. h264 \
  105. hevc \
  106. mpegaudio \
  107. mpeg4video \
  108. mpegvideo \
  109. vc1 \
  110. FFMPEG_CUSTOM_PROTOCOLS:= \
  111. file http icecast pipe rtp tcp udp
  112. FFMPEG_MINI_DECODERS:= \
  113. ac3 \
  114. flac \
  115. jpegls \
  116. mp2 \
  117. mp3 \
  118. mpeg1video \
  119. mpeg2video \
  120. mpeg4 \
  121. mpegvideo \
  122. opus \
  123. png \
  124. vorbis \
  125. FFMPEG_PATENTED_MINI_DECODERS:= \
  126. h264 \
  127. hevc \
  128. vc1 \
  129. FFMPEG_MINI_DEMUXERS:= \
  130. avi \
  131. flac \
  132. matroska \
  133. mov \
  134. mp3 \
  135. mpegps \
  136. mpegts \
  137. mpegvideo \
  138. ogg \
  139. FFMPEG_MINI_PROTOCOLS:= \
  140. file
  141. FFMPEG_AUDIO_DECODERS:= \
  142. ac3 \
  143. adpcm_* \
  144. alac \
  145. amrnb \
  146. amrwb \
  147. ape \
  148. atrac3 \
  149. flac \
  150. mp2 \
  151. mp3* \
  152. mpc7 \
  153. mpc8 \
  154. opus \
  155. pcm_* \
  156. vorbis \
  157. wavpack \
  158. zlib \
  159. FFMPEG_AUDIO_DEMUXERS:= \
  160. ac3 \
  161. aiff \
  162. amr \
  163. ape \
  164. avi \
  165. flac \
  166. ffm \
  167. matroska \
  168. mp3 \
  169. mov \
  170. mpc \
  171. mpc8 \
  172. mpegts \
  173. ogg \
  174. rm \
  175. rtsp \
  176. rtp \
  177. sdp \
  178. wav \
  179. wv \
  180. FFMPEG_AUDIO_PROTOCOLS:= \
  181. file http icecast rtp tcp udp
  182. FFMPEG_PATENTED_DECODERS:= \
  183. atrac3 \
  184. h264 \
  185. hevc \
  186. vc1 \
  187. FFMPEG_PATENTED_MUXERS:= \
  188. h264 \
  189. hevc \
  190. vc1 \
  191. FFMPEG_PATENTED_DEMUXERS:=$(FFMPEG_PATENTED_MUXERS)
  192. FFMPEG_PATENTED_PARSERS:= \
  193. h264 \
  194. hevc \
  195. vc1 \
  196. PKG_CONFIG_DEPENDS:= \
  197. $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
  198. $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
  199. $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_MUXERS)) \
  200. $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
  201. $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
  202. $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
  203. include $(INCLUDE_DIR)/package.mk
  204. define Package/ffmpeg/Default
  205. TITLE:=FFmpeg
  206. URL:=https://ffmpeg.org/
  207. DEPENDS+= +libpthread
  208. endef
  209. define Package/ffmpeg/Default/description
  210. FFmpeg is a a software package that can record, convert and stream digital
  211. audio and video in numerous formats.
  212. FFmpeg licensing / patent issues are complex. It is the reponsibility of the
  213. user to understand any requirements in this regard with its usage. See:
  214. https://ffmpeg.org/legal.html for further information.
  215. endef
  216. define Package/ffmpeg
  217. $(call Package/ffmpeg/Default)
  218. SECTION:=multimedia
  219. CATEGORY:=Multimedia
  220. TITLE+= program
  221. DEPENDS+= +libffmpeg-full
  222. VARIANT:=full
  223. endef
  224. define Package/ffmpeg-custom
  225. $(call Package/ffmpeg/Default)
  226. SECTION:=multimedia
  227. CATEGORY:=Multimedia
  228. TITLE+= program (custom)
  229. DEPENDS+= @!ALL libffmpeg-custom
  230. VARIANT:=custom
  231. endef
  232. define Package/ffmpeg/description
  233. $(call Package/ffmpeg/Default/description)
  234. .
  235. This package contains the FFmpeg command line tool.
  236. endef
  237. Package/ffmpeg-custom/description = $(Package/ffmpeg/description)
  238. define Package/ffprobe
  239. $(call Package/ffmpeg/Default)
  240. SECTION:=multimedia
  241. CATEGORY:=Multimedia
  242. TITLE+= CLI media identifier
  243. DEPENDS+= +libffmpeg-full
  244. VARIANT:=full
  245. endef
  246. define Package/ffprobe-custom
  247. $(call Package/ffmpeg/Default)
  248. SECTION:=multimedia
  249. CATEGORY:=Multimedia
  250. TITLE+= CLI media identifier (custom)
  251. DEPENDS+= @!ALL libffmpeg-custom
  252. VARIANT:=custom
  253. endef
  254. define Package/ffprobe/description
  255. $(call Package/ffmpeg/Default/description)
  256. .
  257. This package contains the FFprobe command line tool.
  258. endef
  259. Package/ffprobe-custom/description = $(Package/ffprobe/description)
  260. define Package/libffmpeg/Default
  261. $(call Package/ffmpeg/Default)
  262. SECTION:=libs
  263. CATEGORY:=Libraries
  264. TITLE+= libraries
  265. DEPENDS+= +libpthread +zlib +libbz2
  266. PROVIDES:= libffmpeg
  267. endef
  268. # Package build suppressed when CONFIG_ALL=y
  269. define Package/libffmpeg-custom
  270. $(call Package/libffmpeg/Default)
  271. TITLE+= (custom)
  272. DEPENDS+= @!ALL \
  273. +FFMPEG_CUSTOM_SELECT_libopus:libopus \
  274. +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib \
  275. +FFMPEG_CUSTOM_SELECT_libshine:shine \
  276. +PACKAGE_fdk-aac:fdk-aac
  277. VARIANT:=custom
  278. MENU:=1
  279. endef
  280. define Package/libffmpeg-custom/config
  281. source "$(SOURCE)/Config.in"
  282. endef
  283. define Package/libffmpeg-custom/description
  284. $(call Package/ffmpeg/Default/description)
  285. .
  286. This package contains customized FFmpeg shared libraries.
  287. endef
  288. define Package/libffmpeg-audio-dec
  289. $(call Package/libffmpeg/Default)
  290. TITLE+= (audio)
  291. VARIANT:=audio-dec
  292. endef
  293. define Package/libffmpeg-audio-dec/description
  294. $(call Package/ffmpeg/Default/description)
  295. .
  296. This package contains FFmpeg shared libraries for audio decoding
  297. endef
  298. define Package/libffmpeg-full
  299. $(call Package/libffmpeg/Default)
  300. TITLE+= (full)
  301. DEPENDS+= +alsa-lib +libgnutls +PACKAGE_libopus:libopus \
  302. +SOFT_FLOAT:shine \
  303. +!SOFT_FLOAT:lame-lib \
  304. +PACKAGE_libx264:libx264 \
  305. +!PACKAGE_libx264:fdk-aac
  306. VARIANT:=full
  307. endef
  308. define Package/libffmpeg-full/description
  309. $(call Package/ffmpeg/Default/description)
  310. .
  311. This package contains full-featured FFmpeg shared libraries.
  312. endef
  313. define Package/libffmpeg-mini
  314. $(call Package/libffmpeg/Default)
  315. TITLE+= (mini)
  316. VARIANT:=mini
  317. endef
  318. define Package/libffmpeg-mini/description
  319. $(call Package/ffmpeg/Default/description)
  320. .
  321. This package contains minimal-featured FFmpeg shared libraries.
  322. endef
  323. # Strip off FPU notation
  324. REAL_CPU_TYPE:=$(firstword $(subst +, ,$(CONFIG_CPU_TYPE)))
  325. # Fixup cpu types recogized by ffmpeg configure
  326. REAL_CPU_TYPE:=$(subst octeonplus,octeon+,$(REAL_CPU_TYPE))
  327. FFMPEG_CONFIGURE:= \
  328. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  329. LDFLAGS="$(TARGET_LDFLAGS)" \
  330. ./configure \
  331. --enable-cross-compile \
  332. --cross-prefix="$(TARGET_CROSS)" \
  333. --arch="$(ARCH)" \
  334. $(if $(REAL_CPU_TYPE),--cpu=$(call qstrip,$(REAL_CPU_TYPE)),) \
  335. --target-os=linux \
  336. --prefix="/usr" \
  337. --pkg-config="pkg-config" \
  338. --enable-shared \
  339. --enable-static \
  340. --enable-pthreads \
  341. --enable-zlib \
  342. --disable-doc \
  343. --disable-debug \
  344. \
  345. --disable-lzma \
  346. --disable-vaapi \
  347. --disable-vdpau \
  348. --disable-outdevs
  349. ifeq ($(CONFIG_SOFT_FLOAT),y)
  350. FFMPEG_CONFIGURE+= \
  351. --disable-altivec \
  352. --disable-vsx \
  353. --disable-power8 \
  354. --disable-armv5te \
  355. --disable-armv6 \
  356. --disable-armv6t2 \
  357. --disable-fast-unaligned \
  358. --disable-runtime-cpudetect
  359. else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  360. FFMPEG_CONFIGURE+= \
  361. --disable-runtime-cpudetect
  362. # XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
  363. else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
  364. FFMPEG_CONFIGURE+= \
  365. --disable-altivec
  366. endif
  367. # selectively disable optimizations according to arch/cpu type
  368. ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  369. FFMPEG_CONFIGURE+= --enable-lto
  370. ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
  371. FFMPEG_CONFIGURE+= --enable-vfp
  372. else
  373. FFMPEG_CONFIGURE+= --disable-vfp
  374. endif
  375. ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
  376. FFMPEG_CONFIGURE+= \
  377. --enable-neon \
  378. --enable-vfp
  379. else
  380. FFMPEG_CONFIGURE+= --disable-neon
  381. endif
  382. endif
  383. ifeq ($(ARCH),x86_64)
  384. FFMPEG_CONFIGURE+= --enable-lto
  385. endif
  386. ifeq ($(CONFIG_FFMPEG_X86ASM),y)
  387. FFMPEG_CONFIGURE += --enable-x86asm
  388. else
  389. FFMPEG_CONFIGURE += --disable-x86asm
  390. endif
  391. ifeq ($(BUILD_VARIANT),full)
  392. FFMPEG_DISABLE= \
  393. $(foreach c, $(2), \
  394. --disable-$(1)="$(c)" \
  395. )
  396. FFMPEG_CONFIGURE+= \
  397. --enable-gnutls \
  398. $(if $(CONFIG_BUILD_PATENTED),, \
  399. $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
  400. $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
  401. $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
  402. $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
  403. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  404. ifeq ($(CONFIG_SOFT_FLOAT),y)
  405. FFMPEG_CONFIGURE+= \
  406. --enable-small \
  407. \
  408. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  409. else
  410. ifeq ($(ARCH),x86_64)
  411. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  412. else
  413. FFMPEG_CONFIGURE+= --enable-small
  414. endif
  415. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
  416. endif
  417. # x264 support and fdk-aac support can't coexist and be distributed.
  418. # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
  419. ifneq ($(CONFIG_PACKAGE_libx264),)
  420. FFMPEG_CONFIGURE+= \
  421. --enable-gpl \
  422. --enable-libx264
  423. else
  424. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
  425. endif
  426. endif
  427. ifeq ($(BUILD_VARIANT),custom)
  428. FFMPEG_ENABLE= \
  429. $(foreach c, $(2), \
  430. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  431. )
  432. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  433. FFMPEG_CONFIGURE+= \
  434. --enable-hardcoded-tables
  435. else
  436. FFMPEG_CONFIGURE+= \
  437. --enable-small
  438. endif
  439. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  440. FFMPEG_CONFIGURE+= --enable-gpl
  441. endif
  442. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  443. FFMPEG_CONFIGURE+= --enable-version3
  444. endif
  445. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  446. FFMPEG_CONFIGURE+= --enable-nonfree
  447. endif
  448. ifneq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
  449. FFMPEG_CONFIGURE+= \
  450. --disable-programs \
  451. --disable-avfilter \
  452. --disable-swresample
  453. endif
  454. FFMPEG_CONFIGURE+= \
  455. --disable-swscale \
  456. --disable-everything \
  457. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  458. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  459. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  460. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  461. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  462. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  463. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  464. FFMPEG_CONFIGURE+= \
  465. --enable-decoder=adpcm_ima_wav \
  466. --enable-decoder=adpcm_ima_qt \
  467. --enable-decoder=adpcm_ms
  468. endif
  469. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  470. FFMPEG_CONFIGURE+= \
  471. --enable-libfdk-aac --enable-encoder=libfdk_aac
  472. endif
  473. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  474. FFMPEG_CONFIGURE+= \
  475. --enable-libmp3lame --enable-encoder=libmp3lame
  476. endif
  477. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  478. FFMPEG_CONFIGURE+= \
  479. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  480. endif
  481. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  482. FFMPEG_CONFIGURE+= \
  483. --enable-libshine --enable-encoder=libshine
  484. endif
  485. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  486. FFMPEG_CONFIGURE+= \
  487. --enable-libx264 --enable-encoder=libx264
  488. else
  489. FFMPEG_CONFIGURE+= --disable-postproc
  490. endif
  491. endif
  492. ifeq ($(BUILD_VARIANT),audio-dec)
  493. FFMPEG_ENABLE= \
  494. $(foreach c, $(2), \
  495. --enable-$(1)="$(c)" \
  496. )
  497. FFMPEG_CONFIGURE+= \
  498. --enable-small \
  499. --enable-gpl \
  500. \
  501. --disable-programs \
  502. --disable-avfilter \
  503. --disable-postproc \
  504. --disable-swresample \
  505. --disable-swscale \
  506. --disable-everything \
  507. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  508. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  509. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  510. --disable-decoder=pcm_bluray,pcm_dvd
  511. endif
  512. ifeq ($(BUILD_VARIANT),mini)
  513. FFMPEG_ENABLE= \
  514. $(foreach c, $(2), \
  515. --enable-$(1)="$(c)" \
  516. )
  517. FFMPEG_CONFIGURE+= \
  518. --enable-small \
  519. \
  520. --disable-programs \
  521. --disable-avdevice \
  522. --disable-avfilter \
  523. --disable-postproc \
  524. --disable-swresample \
  525. --disable-swscale \
  526. --disable-everything \
  527. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  528. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  529. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
  530. $(if $(CONFIG_BUILD_PATENTED), \
  531. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_PATENTED_MINI_DECODERS)))
  532. endif
  533. ifneq ($(CONFIG_TARGET_x86),)
  534. TARGET_CFLAGS+= -fomit-frame-pointer
  535. endif
  536. define Build/Configure
  537. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  538. endef
  539. define Build/Compile
  540. $(MAKE) -C $(PKG_BUILD_DIR) \
  541. DESTDIR="$(PKG_INSTALL_DIR)" \
  542. all install
  543. endef
  544. define Build/InstallDev/custom
  545. $(INSTALL_DIR) $(1)/usr/include
  546. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  547. $(INSTALL_DIR) $(1)/usr/lib
  548. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  549. ifeq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
  550. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avfilter,swresample}.{a,so*} $(1)/usr/lib/
  551. endif
  552. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  553. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  554. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  555. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  556. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  557. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  558. endif
  559. endef
  560. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  561. define Build/InstallDev/full
  562. $(INSTALL_DIR) $(1)/usr/include
  563. $(INSTALL_DIR) $(1)/usr/lib
  564. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  565. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale} $(1)/usr/include/
  566. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  567. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  568. ifneq ($(CONFIG_PACKAGE_libx264),)
  569. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  570. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  571. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  572. endif
  573. endef
  574. define Build/InstallDev/mini
  575. $(INSTALL_DIR) $(1)/usr/include
  576. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  577. $(INSTALL_DIR) $(1)/usr/lib
  578. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  579. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  580. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  581. endef
  582. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  583. # XXX: attempt at installing "best" dev files available
  584. ifeq ($(BUILD_VARIANT),custom)
  585. # XXX: only install "custom" dev files if -full & -mini are not selected
  586. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  587. Build/InstallDev = $(Build/InstallDev/custom)
  588. endif
  589. endif
  590. ifeq ($(BUILD_VARIANT),audio-dec)
  591. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  592. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  593. Build/InstallDev = $(Build/InstallDev/audio-dec)
  594. endif
  595. endif
  596. ifeq ($(BUILD_VARIANT),full)
  597. # XXX: always install "full" dev files if -full is selected
  598. Build/InstallDev = $(Build/InstallDev/full)
  599. endif
  600. ifeq ($(BUILD_VARIANT),mini)
  601. # XXX: only install "mini" dev files if -full is not selected
  602. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  603. Build/InstallDev = $(Build/InstallDev/mini)
  604. endif
  605. endif
  606. define Package/ffmpeg/install
  607. $(INSTALL_DIR) $(1)/usr/bin
  608. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  609. endef
  610. Package/ffmpeg-custom/install = $(Package/ffmpeg/install)
  611. define Package/ffprobe/install
  612. $(INSTALL_DIR) $(1)/usr/bin
  613. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  614. endef
  615. Package/ffprobe-custom/install = $(Package/ffprobe/install)
  616. define Package/libffmpeg-custom/install
  617. $(INSTALL_DIR) $(1)/usr/lib
  618. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  619. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  620. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  621. endif
  622. ifeq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
  623. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avfilter,swresample}.so.* $(1)/usr/lib/
  624. endif
  625. endef
  626. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  627. define Package/libffmpeg-full/install
  628. $(INSTALL_DIR) $(1)/usr/lib
  629. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  630. ifneq ($(CONFIG_PACKAGE_libx264),)
  631. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  632. endif
  633. endef
  634. define Package/libffmpeg-mini/install
  635. $(INSTALL_DIR) $(1)/usr/lib
  636. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  637. endef
  638. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  639. $(eval $(call BuildPackage,ffmpeg))
  640. $(eval $(call BuildPackage,ffprobe))
  641. $(eval $(call BuildPackage,ffmpeg-custom))
  642. $(eval $(call BuildPackage,ffprobe-custom))
  643. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  644. $(eval $(call BuildPackage,libffmpeg-full))
  645. $(eval $(call BuildPackage,libffmpeg-mini))
  646. $(eval $(call BuildPackage,libffmpeg-custom))