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.

747 lines
17 KiB

  1. #
  2. # Copyright (C) 2017-2018 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:=3.2.12
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://ffmpeg.org/releases/
  14. PKG_HASH:=8985cea7b1b3b2e0e2b2a8ac6187a7fb022fe8aa9d35101760a000205c59c412
  15. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
  16. Ian Leonard <antonlacon@gmail.com>
  17. PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
  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_ENCODERS:=$(FFMPEG_PATENDED_DECODERS)
  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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  198. PKG_CONFIG_DEPENDS:= \
  199. $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
  200. $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
  201. $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_MUXERS)) \
  202. $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
  203. $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
  204. $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
  205. include $(INCLUDE_DIR)/package.mk
  206. define Package/ffmpeg/Default
  207. TITLE:=FFmpeg
  208. URL:=https://ffmpeg.org/
  209. DEPENDS+= +libpthread
  210. endef
  211. define Package/ffmpeg/Default/description
  212. FFmpeg is a a software package that can record, convert and stream digital
  213. audio and video in numerous formats.
  214. FFmpeg licensing / patent issues are complex. It is the reponsibility of the
  215. user to understand any requirements in this regard with its usage. See:
  216. https://ffmpeg.org/legal.html for further information.
  217. endef
  218. define Package/ffmpeg
  219. $(call Package/ffmpeg/Default)
  220. SECTION:=multimedia
  221. CATEGORY:=Multimedia
  222. TITLE+= program
  223. DEPENDS+= +libffmpeg-full
  224. VARIANT:=full
  225. endef
  226. define Package/ffmpeg/description
  227. $(call Package/ffmpeg/Default/description)
  228. .
  229. This package contains the FFmpeg command line tool.
  230. endef
  231. define Package/ffprobe
  232. $(call Package/ffmpeg/Default)
  233. SECTION:=multimedia
  234. CATEGORY:=Multimedia
  235. TITLE+= CLI media identifier
  236. DEPENDS+= +libffmpeg-full
  237. VARIANT:=full
  238. endef
  239. define Package/ffprobe/description
  240. $(call Package/ffmpeg/Default/description)
  241. .
  242. This package contains the FFprobe command line tool.
  243. endef
  244. define Package/ffserver
  245. $(call Package/ffserver/Default)
  246. SECTION:=multimedia
  247. CATEGORY:=Multimedia
  248. TITLE+= streaming server
  249. DEPENDS+= +libffmpeg-full
  250. VARIANT:=full
  251. endef
  252. define Package/ffserver/description
  253. $(call Package/ffmpeg/Default/description)
  254. .
  255. This package contains the FFmpeg streaming server.
  256. endef
  257. define Package/libffmpeg/Default
  258. $(call Package/ffmpeg/Default)
  259. SECTION:=libs
  260. CATEGORY:=Libraries
  261. TITLE+= libraries
  262. DEPENDS+= +libpthread +zlib +libbz2
  263. PROVIDES:= libffmpeg
  264. endef
  265. # Package build suppressed when CONFIG_ALL=y
  266. define Package/libffmpeg-custom
  267. $(call Package/libffmpeg/Default)
  268. TITLE+= (custom)
  269. DEPENDS+= @!ALL \
  270. +FFMPEG_CUSTOM_SELECT_libopus:libopus \
  271. +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib \
  272. +FFMPEG_CUSTOM_SELECT_libshine:shine \
  273. +PACKAGE_fdk-aac:fdk-aac
  274. VARIANT:=custom
  275. MENU:=1
  276. endef
  277. define Package/libffmpeg-custom/config
  278. source "$(SOURCE)/Config.in"
  279. endef
  280. define Package/libffmpeg-custom/description
  281. $(call Package/ffmpeg/Default/description)
  282. .
  283. This package contains customized FFmpeg shared libraries.
  284. endef
  285. define Package/libffmpeg-audio-dec
  286. $(call Package/libffmpeg/Default)
  287. TITLE+= (audio)
  288. VARIANT:=audio-dec
  289. endef
  290. define Package/libffmpeg-audio-dec/description
  291. $(call Package/ffmpeg/Default/description)
  292. .
  293. This package contains FFmpeg shared libraries for audio decoding
  294. endef
  295. define Package/libffmpeg-full
  296. $(call Package/libffmpeg/Default)
  297. TITLE+= (full)
  298. DEPENDS+= +alsa-lib +PACKAGE_libopus:libopus
  299. ifeq ($(CONFIG_SOFT_FLOAT),y)
  300. DEPENDS+= +PACKAGE_shine:shine
  301. else
  302. DEPENDS+= +PACKAGE_lame-lib:lame-lib +PACKAGE_libx264:libx264 +PACKAGE_fdk-aac:fdk-aac
  303. endif
  304. VARIANT:=full
  305. endef
  306. define Package/libffmpeg-full/description
  307. $(call Package/ffmpeg/Default/description)
  308. .
  309. This package contains full-featured FFmpeg shared libraries.
  310. endef
  311. define Package/libffmpeg-mini
  312. $(call Package/libffmpeg/Default)
  313. TITLE+= (mini)
  314. VARIANT:=mini
  315. endef
  316. define Package/libffmpeg-mini/description
  317. $(call Package/ffmpeg/Default/description)
  318. .
  319. This package contains minimal-featured FFmpeg shared libraries.
  320. endef
  321. # Strip off FPU notation
  322. REAL_CPU_TYPE:=$(firstword $(subst +, ,$(CONFIG_CPU_TYPE)))
  323. # Fixup cpu types recogized by ffmpeg configure
  324. REAL_CPU_TYPE:=$(subst octeonplus,octeon+,$(REAL_CPU_TYPE))
  325. FFMPEG_CONFIGURE:= \
  326. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  327. LDFLAGS="$(TARGET_LDFLAGS)" \
  328. ./configure \
  329. --enable-cross-compile \
  330. --cross-prefix="$(TARGET_CROSS)" \
  331. --arch="$(ARCH)" \
  332. $(if $(REAL_CPU_TYPE),--cpu=$(call qstrip,$(REAL_CPU_TYPE)),) \
  333. --target-os=linux \
  334. --prefix="/usr" \
  335. --pkg-config="pkg-config" \
  336. --enable-shared \
  337. --enable-static \
  338. --enable-pthreads \
  339. --enable-zlib \
  340. --disable-doc \
  341. --disable-debug \
  342. \
  343. --disable-lzma \
  344. --disable-vaapi \
  345. --disable-vdpau \
  346. --disable-outdevs
  347. ifeq ($(CONFIG_SOFT_FLOAT),y)
  348. FFMPEG_CONFIGURE+= \
  349. --disable-altivec \
  350. --disable-vsx \
  351. --disable-power8 \
  352. --disable-armv5te \
  353. --disable-armv6 \
  354. --disable-armv6t2 \
  355. --disable-inline-asm \
  356. --disable-mipsdsp \
  357. --disable-mipsdspr2 \
  358. --disable-mipsfpu \
  359. --disable-msa \
  360. --disable-mmi \
  361. --disable-fast-unaligned \
  362. --disable-runtime-cpudetect
  363. else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  364. FFMPEG_CONFIGURE+= \
  365. --disable-runtime-cpudetect
  366. # XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
  367. else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
  368. FFMPEG_CONFIGURE+= \
  369. --disable-altivec
  370. # libavcode/mips/aacdec_mips.c build problem
  371. else ifneq ($(findstring 24kf,$(CONFIG_CPU_TYPE)),)
  372. FFMPEG_CONFIGURE+= \
  373. --disable-inline-asm
  374. endif
  375. # selectively disable optimizations according to arch/cpu type
  376. ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  377. FFMPEG_CONFIGURE+= --enable-lto
  378. ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
  379. FFMPEG_CONFIGURE+= --enable-vfp
  380. else
  381. FFMPEG_CONFIGURE+= --disable-vfp
  382. endif
  383. ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
  384. FFMPEG_CONFIGURE+= \
  385. --enable-neon \
  386. --enable-vfp
  387. else
  388. FFMPEG_CONFIGURE+= --disable-neon
  389. endif
  390. endif
  391. ifeq ($(ARCH),x86_64)
  392. FFMPEG_CONFIGURE+= --enable-lto
  393. endif
  394. ifneq ($(CONFIG_TARGET_x86),)
  395. ifeq ($(CONFIG_NASM),y)
  396. # Set yasmexe to anything but YASM/NASM (ffmpeg configure will then find NASM correctly)
  397. # Newer ffmpeg packages will use --enable-x86asm (with NASM default)
  398. FFMPEG_CONFIGURE += --yasmexe=xyzzy
  399. else
  400. FFMPEG_CONFIGURE += --disable-yasm
  401. endif
  402. endif
  403. ifeq ($(BUILD_VARIANT),full)
  404. FFMPEG_DISABLE= \
  405. $(foreach c, $(2), \
  406. --disable-$(1)="$(c)" \
  407. )
  408. FFMPEG_CONFIGURE+= \
  409. --enable-avresample \
  410. $(if $(CONFIG_BUILD_PATENTED),, \
  411. $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
  412. $(call FFMPEG_DISABLE,encoder,$(FFMPEG_PATENTED_ENCODERS)) \
  413. $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
  414. $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
  415. $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
  416. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  417. ifeq ($(CONFIG_SOFT_FLOAT),y)
  418. FFMPEG_CONFIGURE+= \
  419. --enable-small \
  420. \
  421. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  422. else
  423. ifeq ($(ARCH),x86_64)
  424. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  425. else
  426. FFMPEG_CONFIGURE+= --enable-small
  427. endif
  428. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
  429. # x264 support and fdk-aac support can't coexist and be distributed.
  430. # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
  431. ifneq ($(CONFIG_PACKAGE_libx264),)
  432. FFMPEG_CONFIGURE+= \
  433. --enable-gpl \
  434. --enable-libx264
  435. else
  436. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
  437. endif
  438. endif
  439. endif
  440. ifeq ($(BUILD_VARIANT),custom)
  441. FFMPEG_ENABLE= \
  442. $(foreach c, $(2), \
  443. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  444. )
  445. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  446. FFMPEG_CONFIGURE+= \
  447. --enable-hardcoded-tables
  448. else
  449. FFMPEG_CONFIGURE+= \
  450. --enable-small
  451. endif
  452. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  453. FFMPEG_CONFIGURE+= --enable-gpl
  454. endif
  455. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  456. FFMPEG_CONFIGURE+= --enable-version3
  457. endif
  458. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  459. FFMPEG_CONFIGURE+= --enable-nonfree
  460. endif
  461. FFMPEG_CONFIGURE+= \
  462. --disable-programs \
  463. --disable-avfilter \
  464. --disable-postproc \
  465. --disable-swresample \
  466. --disable-swscale \
  467. --disable-everything \
  468. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  469. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  470. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  471. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  472. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  473. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  474. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  475. FFMPEG_CONFIGURE+= \
  476. --enable-decoder=adpcm_ima_wav \
  477. --enable-decoder=adpcm_ima_qt \
  478. --enable-decoder=adpcm_ms
  479. endif
  480. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  481. FFMPEG_CONFIGURE+= \
  482. --enable-libfdk-aac --enable-encoder=libfdk_aac
  483. endif
  484. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  485. FFMPEG_CONFIGURE+= \
  486. --enable-libmp3lame --enable-encoder=libmp3lame
  487. endif
  488. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  489. FFMPEG_CONFIGURE+= \
  490. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  491. endif
  492. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  493. FFMPEG_CONFIGURE+= \
  494. --enable-libshine --enable-encoder=libshine
  495. endif
  496. ifneq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),)
  497. FFMPEG_CONFIGURE+= \
  498. --enable-libx264 --enable-encoder=libx264
  499. endif
  500. endif
  501. ifeq ($(BUILD_VARIANT),audio-dec)
  502. FFMPEG_ENABLE= \
  503. $(foreach c, $(2), \
  504. --enable-$(1)="$(c)" \
  505. )
  506. FFMPEG_CONFIGURE+= \
  507. --enable-small \
  508. --enable-gpl \
  509. \
  510. --disable-programs \
  511. --disable-avfilter \
  512. --disable-postproc \
  513. --disable-swresample \
  514. --disable-swscale \
  515. --disable-everything \
  516. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  517. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  518. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  519. --disable-decoder=pcm_bluray,pcm_dvd
  520. endif
  521. ifeq ($(BUILD_VARIANT),mini)
  522. FFMPEG_ENABLE= \
  523. $(foreach c, $(2), \
  524. --enable-$(1)="$(c)" \
  525. )
  526. FFMPEG_CONFIGURE+= \
  527. --enable-small \
  528. \
  529. --disable-programs \
  530. --disable-avdevice \
  531. --disable-avfilter \
  532. --disable-postproc \
  533. --disable-swresample \
  534. --disable-swscale \
  535. --disable-everything \
  536. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  537. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  538. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
  539. $(if $(CONFIG_BUILD_PATENTED), \
  540. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_PATENTED_MINI_DECODERS)))
  541. endif
  542. ifneq ($(CONFIG_TARGET_x86),)
  543. TARGET_CFLAGS+= -fomit-frame-pointer
  544. endif
  545. define Build/Configure
  546. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  547. endef
  548. define Build/Compile
  549. $(MAKE) -C $(PKG_BUILD_DIR) \
  550. DESTDIR="$(PKG_INSTALL_DIR)" \
  551. all install
  552. endef
  553. define Build/InstallDev/custom
  554. $(INSTALL_DIR) $(1)/usr/include
  555. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  556. $(INSTALL_DIR) $(1)/usr/lib
  557. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  558. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  559. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  560. endef
  561. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  562. define Build/InstallDev/full
  563. $(INSTALL_DIR) $(1)/usr/include
  564. $(INSTALL_DIR) $(1)/usr/lib
  565. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  566. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
  567. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  568. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  569. ifneq ($(CONFIG_SOFT_FLOAT),y)
  570. ifneq ($(CONFIG_PACKAGE_libx264),)
  571. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  572. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  573. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  574. endif
  575. endif
  576. endef
  577. define Build/InstallDev/mini
  578. $(INSTALL_DIR) $(1)/usr/include
  579. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  580. $(INSTALL_DIR) $(1)/usr/lib
  581. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  582. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  583. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  584. endef
  585. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  586. # XXX: attempt at installing "best" dev files available
  587. ifeq ($(BUILD_VARIANT),custom)
  588. # XXX: only install "custom" dev files if -full & -mini are not selected
  589. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  590. Build/InstallDev = $(Build/InstallDev/custom)
  591. endif
  592. endif
  593. ifeq ($(BUILD_VARIANT),audio-dec)
  594. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  595. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  596. Build/InstallDev = $(Build/InstallDev/audio-dec)
  597. endif
  598. endif
  599. ifeq ($(BUILD_VARIANT),full)
  600. # XXX: always install "full" dev files if -full is selected
  601. Build/InstallDev = $(Build/InstallDev/full)
  602. endif
  603. ifeq ($(BUILD_VARIANT),mini)
  604. # XXX: only install "mini" dev files if -full is not selected
  605. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  606. Build/InstallDev = $(Build/InstallDev/mini)
  607. endif
  608. endif
  609. define Package/ffmpeg/install
  610. $(INSTALL_DIR) $(1)/usr/bin
  611. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  612. endef
  613. define Package/ffprobe/install
  614. $(INSTALL_DIR) $(1)/usr/bin
  615. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  616. endef
  617. define Package/ffserver/install
  618. $(INSTALL_DIR) $(1)/usr/bin
  619. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  620. endef
  621. define Package/libffmpeg-custom/install
  622. $(INSTALL_DIR) $(1)/usr/lib
  623. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  624. endef
  625. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  626. define Package/libffmpeg-full/install
  627. $(INSTALL_DIR) $(1)/usr/lib
  628. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  629. ifneq ($(CONFIG_SOFT_FLOAT),y)
  630. ifneq ($(CONFIG_PACKAGE_libx264),)
  631. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  632. endif
  633. endif
  634. endef
  635. define Package/libffmpeg-mini/install
  636. $(INSTALL_DIR) $(1)/usr/lib
  637. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  638. endef
  639. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  640. $(eval $(call BuildPackage,ffmpeg))
  641. $(eval $(call BuildPackage,ffprobe))
  642. $(eval $(call BuildPackage,ffserver))
  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))