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.

742 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. # Fixup cpu types recogized by ffmpeg configure
  323. REAL_CPU_TYPE:=$(subst octeonplus,octeon+,$(REAL_CPU_TYPE))
  324. FFMPEG_CONFIGURE:= \
  325. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  326. LDFLAGS="$(TARGET_LDFLAGS)" \
  327. ./configure \
  328. --enable-cross-compile \
  329. --cross-prefix="$(TARGET_CROSS)" \
  330. --arch="$(ARCH)" \
  331. $(if $(REAL_CPU_TYPE),--cpu=$(call qstrip,$(REAL_CPU_TYPE)),) \
  332. --target-os=linux \
  333. --prefix="/usr" \
  334. --pkg-config="pkg-config" \
  335. --enable-shared \
  336. --enable-static \
  337. --enable-pthreads \
  338. --enable-zlib \
  339. --disable-doc \
  340. --disable-debug \
  341. \
  342. --disable-lzma \
  343. --disable-vaapi \
  344. --disable-vdpau \
  345. --disable-outdevs
  346. ifeq ($(CONFIG_SOFT_FLOAT),y)
  347. FFMPEG_CONFIGURE+= \
  348. --disable-altivec \
  349. --disable-vsx \
  350. --disable-power8 \
  351. --disable-armv5te \
  352. --disable-armv6 \
  353. --disable-armv6t2 \
  354. --disable-inline-asm \
  355. --disable-mipsdsp \
  356. --disable-mipsdspr2 \
  357. --disable-mipsfpu \
  358. --disable-msa \
  359. --disable-mmi \
  360. --disable-fast-unaligned \
  361. --disable-runtime-cpudetect
  362. else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  363. FFMPEG_CONFIGURE+= \
  364. --disable-runtime-cpudetect
  365. # XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
  366. else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
  367. FFMPEG_CONFIGURE+= \
  368. --disable-altivec
  369. # libavcode/mips/aacdec_mips.c build problem
  370. else ifneq ($(findstring 24kf,$(CONFIG_CPU_TYPE)),)
  371. FFMPEG_CONFIGURE+= \
  372. --disable-inline-asm
  373. endif
  374. # selectively disable optimizations according to arch/cpu type
  375. ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  376. FFMPEG_CONFIGURE+= --enable-lto
  377. ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
  378. FFMPEG_CONFIGURE+= --enable-vfp
  379. else
  380. FFMPEG_CONFIGURE+= --disable-vfp
  381. endif
  382. ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
  383. FFMPEG_CONFIGURE+= \
  384. --enable-neon \
  385. --enable-vfp
  386. else
  387. FFMPEG_CONFIGURE+= --disable-neon
  388. endif
  389. endif
  390. ifeq ($(ARCH),x86_64)
  391. FFMPEG_CONFIGURE+= --enable-lto
  392. endif
  393. ifneq ($(CONFIG_TARGET_x86),)
  394. ifeq ($(CONFIG_NASM),y)
  395. # Set yasmexe to anything but YASM/NASM (ffmpeg configure will then find NASM correctly)
  396. # Newer ffmpeg packages will use --enable-x86asm (with NASM default)
  397. FFMPEG_CONFIGURE += --yasmexe=xyzzy
  398. else
  399. FFMPEG_CONFIGURE += --disable-yasm
  400. endif
  401. endif
  402. ifeq ($(BUILD_VARIANT),full)
  403. FFMPEG_DISABLE= \
  404. $(foreach c, $(2), \
  405. --disable-$(1)="$(c)" \
  406. )
  407. FFMPEG_CONFIGURE+= \
  408. --enable-avresample \
  409. $(if $(CONFIG_BUILD_PATENTED),, \
  410. $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
  411. $(call FFMPEG_DISABLE,encoder,$(FFMPEG_PATENTED_ENCODERS)) \
  412. $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
  413. $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
  414. $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
  415. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  416. ifeq ($(CONFIG_SOFT_FLOAT),y)
  417. FFMPEG_CONFIGURE+= \
  418. --enable-small \
  419. \
  420. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  421. else
  422. ifeq ($(ARCH),x86_64)
  423. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  424. else
  425. FFMPEG_CONFIGURE+= --enable-small
  426. endif
  427. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
  428. # x264 support and fdk-aac support can't coexist and be distributed.
  429. # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
  430. ifneq ($(CONFIG_PACKAGE_libx264),)
  431. FFMPEG_CONFIGURE+= \
  432. --enable-gpl \
  433. --enable-libx264
  434. else
  435. FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
  436. endif
  437. endif
  438. endif
  439. ifeq ($(BUILD_VARIANT),custom)
  440. FFMPEG_ENABLE= \
  441. $(foreach c, $(2), \
  442. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  443. )
  444. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  445. FFMPEG_CONFIGURE+= \
  446. --enable-hardcoded-tables
  447. else
  448. FFMPEG_CONFIGURE+= \
  449. --enable-small
  450. endif
  451. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  452. FFMPEG_CONFIGURE+= --enable-gpl
  453. endif
  454. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  455. FFMPEG_CONFIGURE+= --enable-version3
  456. endif
  457. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  458. FFMPEG_CONFIGURE+= --enable-nonfree
  459. endif
  460. FFMPEG_CONFIGURE+= \
  461. --disable-programs \
  462. --disable-avfilter \
  463. --disable-postproc \
  464. --disable-swresample \
  465. --disable-swscale \
  466. --disable-everything \
  467. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  468. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  469. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  470. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  471. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  472. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  473. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  474. FFMPEG_CONFIGURE+= \
  475. --enable-decoder=adpcm_ima_wav \
  476. --enable-decoder=adpcm_ima_qt \
  477. --enable-decoder=adpcm_ms
  478. endif
  479. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  480. FFMPEG_CONFIGURE+= \
  481. --enable-libfdk-aac --enable-encoder=libfdk_aac
  482. endif
  483. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  484. FFMPEG_CONFIGURE+= \
  485. --enable-libmp3lame --enable-encoder=libmp3lame
  486. endif
  487. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  488. FFMPEG_CONFIGURE+= \
  489. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  490. endif
  491. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  492. FFMPEG_CONFIGURE+= \
  493. --enable-libshine --enable-encoder=libshine
  494. endif
  495. ifneq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),)
  496. FFMPEG_CONFIGURE+= \
  497. --enable-libx264 --enable-encoder=libx264
  498. endif
  499. endif
  500. ifeq ($(BUILD_VARIANT),audio-dec)
  501. FFMPEG_ENABLE= \
  502. $(foreach c, $(2), \
  503. --enable-$(1)="$(c)" \
  504. )
  505. FFMPEG_CONFIGURE+= \
  506. --enable-small \
  507. --enable-gpl \
  508. \
  509. --disable-programs \
  510. --disable-avfilter \
  511. --disable-postproc \
  512. --disable-swresample \
  513. --disable-swscale \
  514. --disable-everything \
  515. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  516. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  517. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  518. --disable-decoder=pcm_bluray,pcm_dvd
  519. endif
  520. ifeq ($(BUILD_VARIANT),mini)
  521. FFMPEG_ENABLE= \
  522. $(foreach c, $(2), \
  523. --enable-$(1)="$(c)" \
  524. )
  525. FFMPEG_CONFIGURE+= \
  526. --enable-small \
  527. \
  528. --disable-programs \
  529. --disable-avdevice \
  530. --disable-avfilter \
  531. --disable-postproc \
  532. --disable-swresample \
  533. --disable-swscale \
  534. --disable-everything \
  535. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  536. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  537. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
  538. $(if $(CONFIG_BUILD_PATENTED), \
  539. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_PATENTED_MINI_DECODERS)))
  540. endif
  541. ifneq ($(CONFIG_TARGET_x86),)
  542. TARGET_CFLAGS+= -fomit-frame-pointer
  543. endif
  544. define Build/Configure
  545. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  546. endef
  547. define Build/Compile
  548. $(MAKE) -C $(PKG_BUILD_DIR) \
  549. DESTDIR="$(PKG_INSTALL_DIR)" \
  550. all install
  551. endef
  552. define Build/InstallDev/custom
  553. $(INSTALL_DIR) $(1)/usr/include
  554. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  555. $(INSTALL_DIR) $(1)/usr/lib
  556. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  557. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  558. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  559. endef
  560. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  561. define Build/InstallDev/full
  562. $(INSTALL_DIR) $(1)/usr/include
  563. $(INSTALL_DIR) $(1)/usr/lib
  564. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  565. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
  566. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  567. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  568. ifneq ($(CONFIG_PACKAGE_libx264),)
  569. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  570. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  571. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  572. endif
  573. endef
  574. define Build/InstallDev/mini
  575. $(INSTALL_DIR) $(1)/usr/include
  576. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  577. $(INSTALL_DIR) $(1)/usr/lib
  578. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  579. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  580. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  581. endef
  582. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  583. # XXX: attempt at installing "best" dev files available
  584. ifeq ($(BUILD_VARIANT),custom)
  585. # XXX: only install "custom" dev files if -full & -mini are not selected
  586. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  587. Build/InstallDev = $(Build/InstallDev/custom)
  588. endif
  589. endif
  590. ifeq ($(BUILD_VARIANT),audio-dec)
  591. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  592. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  593. Build/InstallDev = $(Build/InstallDev/audio-dec)
  594. endif
  595. endif
  596. ifeq ($(BUILD_VARIANT),full)
  597. # XXX: always install "full" dev files if -full is selected
  598. Build/InstallDev = $(Build/InstallDev/full)
  599. endif
  600. ifeq ($(BUILD_VARIANT),mini)
  601. # XXX: only install "mini" dev files if -full is not selected
  602. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  603. Build/InstallDev = $(Build/InstallDev/mini)
  604. endif
  605. endif
  606. define Package/ffmpeg/install
  607. $(INSTALL_DIR) $(1)/usr/bin
  608. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  609. endef
  610. define Package/ffprobe/install
  611. $(INSTALL_DIR) $(1)/usr/bin
  612. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  613. endef
  614. define Package/ffserver/install
  615. $(INSTALL_DIR) $(1)/usr/bin
  616. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  617. endef
  618. define Package/libffmpeg-custom/install
  619. $(INSTALL_DIR) $(1)/usr/lib
  620. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  621. endef
  622. # Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
  623. define Package/libffmpeg-full/install
  624. $(INSTALL_DIR) $(1)/usr/lib
  625. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  626. ifneq ($(CONFIG_PACKAGE_libx264),)
  627. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  628. endif
  629. endef
  630. define Package/libffmpeg-mini/install
  631. $(INSTALL_DIR) $(1)/usr/lib
  632. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  633. endef
  634. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  635. $(eval $(call BuildPackage,ffmpeg))
  636. $(eval $(call BuildPackage,ffprobe))
  637. $(eval $(call BuildPackage,ffserver))
  638. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  639. $(eval $(call BuildPackage,libffmpeg-full))
  640. $(eval $(call BuildPackage,libffmpeg-mini))
  641. $(eval $(call BuildPackage,libffmpeg-custom))