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.

734 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. 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. # Strip off FPU notation
  321. REAL_CPU_TYPE:=$(firstword $(subst +, ,$(CONFIG_CPU_TYPE)))
  322. FFMPEG_CONFIGURE:= \
  323. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  324. LDFLAGS="$(TARGET_LDFLAGS)" \
  325. ./configure \
  326. --enable-cross-compile \
  327. --cross-prefix="$(TARGET_CROSS)" \
  328. --arch="$(ARCH)" \
  329. $(if $(REAL_CPU_TYPE),--cpu=$(call qstrip,$(REAL_CPU_TYPE)),) \
  330. --target-os=linux \
  331. --prefix="/usr" \
  332. --pkg-config="pkg-config" \
  333. --enable-shared \
  334. --enable-static \
  335. --enable-pthreads \
  336. --enable-zlib \
  337. --disable-doc \
  338. --disable-debug \
  339. \
  340. --disable-lzma \
  341. --disable-vaapi \
  342. --disable-vdpau \
  343. --disable-outdevs
  344. ifeq ($(CONFIG_SOFT_FLOAT),y)
  345. FFMPEG_CONFIGURE+= \
  346. --disable-altivec \
  347. --disable-vsx \
  348. --disable-power8 \
  349. --disable-armv5te \
  350. --disable-armv6 \
  351. --disable-armv6t2 \
  352. --disable-inline-asm \
  353. --disable-mipsdsp \
  354. --disable-mipsdspr2 \
  355. --disable-mipsfpu \
  356. --disable-msa \
  357. --disable-mmi \
  358. --disable-fast-unaligned \
  359. --disable-runtime-cpudetect
  360. else ifneq ($(findstring arm,$(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_TARGET_OPTIMIZATION)),)
  372. FFMPEG_CONFIGURE+= --enable-vfp
  373. else
  374. FFMPEG_CONFIGURE+= --disable-vfp
  375. endif
  376. ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
  377. FFMPEG_CONFIGURE+= \
  378. --enable-neon \
  379. --enable-vfp
  380. else
  381. FFMPEG_CONFIGURE+= --disable-neon
  382. endif
  383. endif
  384. ifeq ($(ARCH),x86_64)
  385. FFMPEG_CONFIGURE+= --enable-lto
  386. endif
  387. ifneq ($(CONFIG_TARGET_x86),)
  388. ifeq ($(CONFIG_NASM),y)
  389. FFMPEG_CONFIGURE += --yasmexe=nasm
  390. else
  391. FFMPEG_CONFIGURE += --disable-yasm
  392. endif
  393. endif
  394. ifeq ($(BUILD_VARIANT),full)
  395. FFMPEG_DISABLE= \
  396. $(foreach c, $(2), \
  397. --disable-$(1)="$(c)" \
  398. )
  399. FFMPEG_CONFIGURE+= \
  400. --enable-avresample \
  401. $(if $(CONFIG_BUILD_PATENTED),, \
  402. $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
  403. $(call FFMPEG_DISABLE,encoder,$(FFMPEG_PATENTED_ENCODERS)) \
  404. $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
  405. $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
  406. $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
  407. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  408. ifeq ($(CONFIG_SOFT_FLOAT),y)
  409. FFMPEG_CONFIGURE+= \
  410. --enable-small \
  411. \
  412. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  413. else
  414. ifeq ($(ARCH),x86_64)
  415. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  416. else
  417. FFMPEG_CONFIGURE+= --enable-small
  418. endif
  419. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
  420. # x264 support and fdk-aac support can't coexist and be distributed.
  421. # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
  422. ifneq ($(CONFIG_PACKAGE_libx264),)
  423. FFMPEG_CONFIGURE+= \
  424. --enable-gpl \
  425. --enable-libx264
  426. else
  427. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
  428. endif
  429. endif
  430. endif
  431. ifeq ($(BUILD_VARIANT),custom)
  432. FFMPEG_ENABLE= \
  433. $(foreach c, $(2), \
  434. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  435. )
  436. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  437. FFMPEG_CONFIGURE+= \
  438. --enable-hardcoded-tables
  439. else
  440. FFMPEG_CONFIGURE+= \
  441. --enable-small
  442. endif
  443. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  444. FFMPEG_CONFIGURE+= --enable-gpl
  445. endif
  446. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  447. FFMPEG_CONFIGURE+= --enable-version3
  448. endif
  449. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  450. FFMPEG_CONFIGURE+= --enable-nonfree
  451. endif
  452. FFMPEG_CONFIGURE+= \
  453. --disable-programs \
  454. --disable-avfilter \
  455. --disable-postproc \
  456. --disable-swresample \
  457. --disable-swscale \
  458. --disable-everything \
  459. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  460. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  461. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  462. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  463. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  464. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  465. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  466. FFMPEG_CONFIGURE+= \
  467. --enable-decoder=adpcm_ima_wav \
  468. --enable-decoder=adpcm_ima_qt \
  469. --enable-decoder=adpcm_ms
  470. endif
  471. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  472. FFMPEG_CONFIGURE+= \
  473. --enable-libfdk-aac --enable-encoder=libfdk_aac
  474. endif
  475. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  476. FFMPEG_CONFIGURE+= \
  477. --enable-libmp3lame --enable-encoder=libmp3lame
  478. endif
  479. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  480. FFMPEG_CONFIGURE+= \
  481. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  482. endif
  483. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  484. FFMPEG_CONFIGURE+= \
  485. --enable-libshine --enable-encoder=libshine
  486. endif
  487. ifneq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),)
  488. FFMPEG_CONFIGURE+= \
  489. --enable-libx264 --enable-encoder=libx264
  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. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  550. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  551. endef
  552. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  553. define Build/InstallDev/full
  554. $(INSTALL_DIR) $(1)/usr/include
  555. $(INSTALL_DIR) $(1)/usr/lib
  556. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  557. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
  558. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  559. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  560. ifneq ($(CONFIG_PACKAGE_libx264),)
  561. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  562. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  563. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  564. endif
  565. endef
  566. define Build/InstallDev/mini
  567. $(INSTALL_DIR) $(1)/usr/include
  568. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  569. $(INSTALL_DIR) $(1)/usr/lib
  570. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  571. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  572. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  573. endef
  574. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  575. # XXX: attempt at installing "best" dev files available
  576. ifeq ($(BUILD_VARIANT),custom)
  577. # XXX: only install "custom" dev files if -full & -mini are not selected
  578. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  579. Build/InstallDev = $(Build/InstallDev/custom)
  580. endif
  581. endif
  582. ifeq ($(BUILD_VARIANT),audio-dec)
  583. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  584. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  585. Build/InstallDev = $(Build/InstallDev/audio-dec)
  586. endif
  587. endif
  588. ifeq ($(BUILD_VARIANT),full)
  589. # XXX: always install "full" dev files if -full is selected
  590. Build/InstallDev = $(Build/InstallDev/full)
  591. endif
  592. ifeq ($(BUILD_VARIANT),mini)
  593. # XXX: only install "mini" dev files if -full is not selected
  594. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  595. Build/InstallDev = $(Build/InstallDev/mini)
  596. endif
  597. endif
  598. define Package/ffmpeg/install
  599. $(INSTALL_DIR) $(1)/usr/bin
  600. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  601. endef
  602. define Package/ffprobe/install
  603. $(INSTALL_DIR) $(1)/usr/bin
  604. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  605. endef
  606. define Package/ffserver/install
  607. $(INSTALL_DIR) $(1)/usr/bin
  608. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  609. endef
  610. define Package/libffmpeg-custom/install
  611. $(INSTALL_DIR) $(1)/usr/lib
  612. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  613. endef
  614. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  615. define Package/libffmpeg-full/install
  616. $(INSTALL_DIR) $(1)/usr/lib
  617. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  618. ifneq ($(CONFIG_PACKAGE_libx264),)
  619. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  620. endif
  621. endef
  622. define Package/libffmpeg-mini/install
  623. $(INSTALL_DIR) $(1)/usr/lib
  624. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  625. endef
  626. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  627. $(eval $(call BuildPackage,ffmpeg))
  628. $(eval $(call BuildPackage,ffprobe))
  629. $(eval $(call BuildPackage,ffserver))
  630. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  631. $(eval $(call BuildPackage,libffmpeg-full))
  632. $(eval $(call BuildPackage,libffmpeg-mini))
  633. $(eval $(call BuildPackage,libffmpeg-custom))