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.

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