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.

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