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.

727 lines
16 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:=3
  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_YASM),y)
  385. FFMPEG_CONFIGURE+= --disable-yasm
  386. endif
  387. ifeq ($(BUILD_VARIANT),full)
  388. FFMPEG_DISABLE= \
  389. $(foreach c, $(2), \
  390. --disable-$(1)="$(c)" \
  391. )
  392. FFMPEG_CONFIGURE+= \
  393. --enable-avresample \
  394. $(if $(CONFIG_BUILD_PATENTED),, \
  395. $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
  396. $(call FFMPEG_DISABLE,encoder,$(FFMPEG_PATENTED_ENCODERS)) \
  397. $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
  398. $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
  399. $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
  400. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  401. ifeq ($(CONFIG_SOFT_FLOAT),y)
  402. FFMPEG_CONFIGURE+= \
  403. --enable-small \
  404. \
  405. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  406. else
  407. ifeq ($(ARCH),x86_64)
  408. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  409. else
  410. FFMPEG_CONFIGURE+= --enable-small
  411. endif
  412. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
  413. # x264 support and fdk-aac support can't coexist and be distributed.
  414. # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
  415. ifeq ($(CONFIG_PACKAGE_libx264),y)
  416. FFMPEG_CONFIGURE+= \
  417. --enable-gpl \
  418. --enable-libx264
  419. else
  420. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
  421. endif
  422. endif
  423. endif
  424. ifeq ($(BUILD_VARIANT),custom)
  425. FFMPEG_ENABLE= \
  426. $(foreach c, $(2), \
  427. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  428. )
  429. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  430. FFMPEG_CONFIGURE+= \
  431. --enable-hardcoded-tables
  432. else
  433. FFMPEG_CONFIGURE+= \
  434. --enable-small
  435. endif
  436. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  437. FFMPEG_CONFIGURE+= --enable-gpl
  438. endif
  439. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  440. FFMPEG_CONFIGURE+= --enable-version3
  441. endif
  442. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  443. FFMPEG_CONFIGURE+= --enable-nonfree
  444. endif
  445. FFMPEG_CONFIGURE+= \
  446. --disable-programs \
  447. --disable-avfilter \
  448. --disable-postproc \
  449. --disable-swresample \
  450. --disable-swscale \
  451. --disable-everything \
  452. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  453. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  454. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  455. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  456. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  457. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  458. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  459. FFMPEG_CONFIGURE+= \
  460. --enable-decoder=adpcm_ima_wav \
  461. --enable-decoder=adpcm_ima_qt \
  462. --enable-decoder=adpcm_ms
  463. endif
  464. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  465. FFMPEG_CONFIGURE+= \
  466. --enable-libfdk-aac --enable-encoder=libfdk_aac
  467. endif
  468. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  469. FFMPEG_CONFIGURE+= \
  470. --enable-libmp3lame --enable-encoder=libmp3lame
  471. endif
  472. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  473. FFMPEG_CONFIGURE+= \
  474. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  475. endif
  476. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  477. FFMPEG_CONFIGURE+= \
  478. --enable-libshine --enable-encoder=libshine
  479. endif
  480. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  481. FFMPEG_CONFIGURE+= \
  482. --enable-libx264 --enable-encoder=libx264
  483. endif
  484. endif
  485. ifeq ($(BUILD_VARIANT),audio-dec)
  486. FFMPEG_ENABLE= \
  487. $(foreach c, $(2), \
  488. --enable-$(1)="$(c)" \
  489. )
  490. FFMPEG_CONFIGURE+= \
  491. --enable-small \
  492. --enable-gpl \
  493. \
  494. --disable-programs \
  495. --disable-avfilter \
  496. --disable-postproc \
  497. --disable-swresample \
  498. --disable-swscale \
  499. --disable-everything \
  500. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  501. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  502. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  503. --disable-decoder=pcm_bluray,pcm_dvd
  504. endif
  505. ifeq ($(BUILD_VARIANT),mini)
  506. FFMPEG_ENABLE= \
  507. $(foreach c, $(2), \
  508. --enable-$(1)="$(c)" \
  509. )
  510. FFMPEG_CONFIGURE+= \
  511. --enable-small \
  512. \
  513. --disable-programs \
  514. --disable-avdevice \
  515. --disable-avfilter \
  516. --disable-postproc \
  517. --disable-swresample \
  518. --disable-swscale \
  519. --disable-everything \
  520. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  521. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  522. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
  523. $(if $(CONFIG_BUILD_PATENTED), \
  524. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_PATENTED_MINI_DECODERS)))
  525. endif
  526. ifneq ($(CONFIG_TARGET_x86),)
  527. TARGET_CFLAGS+= -fomit-frame-pointer
  528. endif
  529. define Build/Configure
  530. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  531. endef
  532. define Build/Compile
  533. $(MAKE) -C $(PKG_BUILD_DIR) \
  534. DESTDIR="$(PKG_INSTALL_DIR)" \
  535. all install
  536. endef
  537. define Build/InstallDev/custom
  538. $(INSTALL_DIR) $(1)/usr/include
  539. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  540. $(INSTALL_DIR) $(1)/usr/lib
  541. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  542. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  543. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  544. endef
  545. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  546. define Build/InstallDev/full
  547. $(INSTALL_DIR) $(1)/usr/include
  548. $(INSTALL_DIR) $(1)/usr/lib
  549. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  550. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
  551. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  552. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  553. ifeq ($(CONFIG_PACKAGE_libx264),y)
  554. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  555. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  556. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  557. endif
  558. endef
  559. define Build/InstallDev/mini
  560. $(INSTALL_DIR) $(1)/usr/include
  561. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  562. $(INSTALL_DIR) $(1)/usr/lib
  563. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  564. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  565. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  566. endef
  567. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  568. # XXX: attempt at installing "best" dev files available
  569. ifeq ($(BUILD_VARIANT),custom)
  570. # XXX: only install "custom" dev files if -full & -mini are not selected
  571. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  572. Build/InstallDev = $(Build/InstallDev/custom)
  573. endif
  574. endif
  575. ifeq ($(BUILD_VARIANT),audio-dec)
  576. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  577. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  578. Build/InstallDev = $(Build/InstallDev/audio-dec)
  579. endif
  580. endif
  581. ifeq ($(BUILD_VARIANT),full)
  582. # XXX: always install "full" dev files if -full is selected
  583. Build/InstallDev = $(Build/InstallDev/full)
  584. endif
  585. ifeq ($(BUILD_VARIANT),mini)
  586. # XXX: only install "mini" dev files if -full is not selected
  587. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  588. Build/InstallDev = $(Build/InstallDev/mini)
  589. endif
  590. endif
  591. define Package/ffmpeg/install
  592. $(INSTALL_DIR) $(1)/usr/bin
  593. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  594. endef
  595. define Package/ffprobe/install
  596. $(INSTALL_DIR) $(1)/usr/bin
  597. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  598. endef
  599. define Package/ffserver/install
  600. $(INSTALL_DIR) $(1)/usr/bin
  601. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  602. endef
  603. define Package/libffmpeg-custom/install
  604. $(INSTALL_DIR) $(1)/usr/lib
  605. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  606. endef
  607. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  608. define Package/libffmpeg-full/install
  609. $(INSTALL_DIR) $(1)/usr/lib
  610. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  611. ifeq ($(CONFIG_PACKAGE_libx264),y)
  612. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  613. endif
  614. endef
  615. define Package/libffmpeg-mini/install
  616. $(INSTALL_DIR) $(1)/usr/lib
  617. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  618. endef
  619. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  620. $(eval $(call BuildPackage,ffmpeg))
  621. $(eval $(call BuildPackage,ffprobe))
  622. $(eval $(call BuildPackage,ffserver))
  623. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  624. $(eval $(call BuildPackage,libffmpeg-full))
  625. $(eval $(call BuildPackage,libffmpeg-mini))
  626. $(eval $(call BuildPackage,libffmpeg-custom))