1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
9 PKG_HASH
:= 5e3133939a61ef64ac9b47ffd29a5ea6e337a4023ef0ad972094b4da844e3a20
10 PKG_DESCR
:= record
, convert and stream audio
& video
11 PKG_SECTION
:= libs
/video
13 PKG_DEPENDS
:= libncurses libressl
14 PKG_BUILDDEP
:= ncurses libressl
15 PKG_URL
:= http
://www.ffmpeg.org
/
16 PKG_SITES
:= http
://www.ffmpeg.org
/releases
/
17 PKG_LIBNAME
:= libffmpeg
20 PKG_CHOICES_FFMPEG
:= WITH_LIBRESSL WITH_OPENSSL
21 PKGCD_WITH_LIBRESSL
:= use libressl for crypto
22 PKGCS_WITH_LIBRESSL
:= libressl ca-certificates
23 PKGCB_WITH_LIBRESSL
:= libressl
24 PKGCD_WITH_OPENSSL
:= use libopenssl for crypto
25 PKGCS_WITH_OPENSSL
:= libopenssl ca-certificates
26 PKGCB_WITH_OPENSSL
:= openssl
29 PKG_SUBPKGS
:= LIBFFMPEG FFPROBE FFMPEG
30 PKGSD_FFMPEG
:= video converter
31 PKGSC_FFMPEG
:= mm
/video
32 PKGSS_FFMPEG
:= libffmpeg
33 PKGSD_FFPROBE
:= simple multimedia stream analyzer
34 PKGSC_FFPROBE
:= mm
/video
35 PKGSS_FFPROBE
:= libffmpeg
36 PKGSD_LIBFFMPEG
:= video library
37 PKGSC_LIBFFMPEG
:= libs
/video
39 PKG_FLAVOURS_LIBFFMPEG
:= WITH_MP3 WITH_VP8 WITH_THEORA
40 PKG_FLAVOURS_LIBFFMPEG
+= WITH_XVID WITH_VORBIS WITH_X264 WITH_X265
41 PKG_FLAVOURS_LIBFFMPEG
+= WITH_ZLIB WITH_BZIP2
43 PKGFD_WITH_BZIP2
:= with bzip2 compression support
44 PKGFS_WITH_BZIP2
:= bzip2
45 PKGFB_WITH_BZIP2
:= bzip2
47 PKGFD_WITH_ZLIB
:= with zlib compression support
48 PKGFS_WITH_ZLIB
:= zlib
49 PKGFB_WITH_ZLIB
:= zlib
51 PKGFD_WITH_X264
:= with x264 decoding support
52 PKGFS_WITH_X264
:= libx264
53 PKGFB_WITH_X264
:= libx264
54 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264
),y
)
55 PKG_FDEPENDS
+= libx264
58 PKGFD_WITH_X265
:= with x265 decoding support
59 PKGFS_WITH_X265
:= libx265
60 PKGFB_WITH_X265
:= libx265
61 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X265
),y
)
62 PKG_FDEPENDS
+= libx265
65 PKGFD_WITH_MP3
:= with mp3 encoding support
66 PKGFS_WITH_MP3
:= libmp3lame
68 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3
),y
)
69 PKG_FDEPENDS
+= libmp3lame
72 PKGFD_WITH_VP8
:= with vp8 encoding support
73 PKGFS_WITH_VP8
:= libvpx
74 PKGFB_WITH_VP8
:= libvpx
75 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8
),y
)
79 PKGFD_WITH_THEORA
:= with theora encoding support
80 PKGFS_WITH_THEORA
:= libtheora
81 PKGFB_WITH_THEORA
:= libtheora
82 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA
),y
)
83 PKG_FDEPENDS
+= libtheora
86 PKGFD_WITH_XVID
:= with xvid encoding support
87 PKGFS_WITH_XVID
:= libxvid
88 PKGFB_WITH_XVID
:= xvidcore
89 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID
),y
)
90 PKG_FDEPENDS
+= libxvid
93 PKGFD_WITH_VORBIS
:= with vorbis encoding support
94 PKGFS_WITH_VORBIS
:= libvorbisenc
95 PKGFB_WITH_VORBIS
:= libvorbis
96 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS
),y
)
97 PKG_FDEPENDS
+= libvorbisenc
100 DISTFILES
:= $(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
102 include $(ADK_TOPDIR
)/mk
/package.mk
104 $(eval
$(call PKG_template
,LIBFFMPEG
,libffmpeg
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(PKG_FDEPENDS
),$(PKGSD_LIBFFMPEG
),$(PKGSC_LIBFFMPEG
),$(PKG_OPTS
)))
105 $(eval
$(call PKG_template
,FFMPEG
,ffmpeg
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(PKG_DEPENDS
),$(PKGSD_FFMPEG
),$(PKGSC_FFMPEG
)))
106 $(eval
$(call PKG_template
,FFPROBE
,ffprobe
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(PKG_DEPENDS
),$(PKGSD_FFPROBE
),$(PKGSC_FFPROBE
)))
108 ifeq ($(ADK_DEBUG
),y
)
109 TARGET_CFLAGS
:= $(subst O0
,O2
,$(TARGET_CFLAGS
))
111 TARGET_CFLAGS
:= $(subst Os
,O2
,$(TARGET_CFLAGS
))
113 TARGET_CPPFLAGS
+= -D_POSIX_SOURCE
-D_GNU_SOURCE
114 TARGET_LDFLAGS
+= -latomic
116 ifeq ($(ADK_TARGET_CPU_WITH_MMX
),y
)
117 CONFIGURE_CPU_OPTS
+= --enable-mmx
119 CONFIGURE_CPU_OPTS
+= --disable-mmx
121 ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT
),y
)
122 CONFIGURE_CPU_OPTS
+= --enable-mmxext
124 CONFIGURE_CPU_OPTS
+= --disable-mmxext
126 ifeq ($(ADK_TARGET_CPU_WITH_SSE4_2
),y
)
127 CONFIGURE_CPU_OPTS
+= --enable-sse42 \
134 CONFIGURE_CPU_OPTS
+= --disable-sse42
135 ifeq ($(ADK_TARGET_CPU_WITH_SSE4_1
),y
)
136 CONFIGURE_CPU_OPTS
+= --enable-sse4 \
142 CONFIGURE_CPU_OPTS
+= --disable-sse4
143 ifeq ($(ADK_TARGET_CPU_WITH_SSSE3
),y
)
144 CONFIGURE_CPU_OPTS
+= --enable-ssse3 \
149 CONFIGURE_CPU_OPTS
+= --disable-ssse3
150 ifeq ($(ADK_TARGET_CPU_WITH_SSE3
),y
)
151 CONFIGURE_CPU_OPTS
+= --enable-sse3 \
155 CONFIGURE_CPU_OPTS
+= --disable-sse3
156 ifeq ($(ADK_TARGET_CPU_WITH_SSE2
),y
)
157 CONFIGURE_CPU_OPTS
+= --enable-sse2 \
160 CONFIGURE_CPU_OPTS
+= --disable-sse2
161 ifeq ($(ADK_TARGET_CPU_WITH_SSE
),y
)
162 CONFIGURE_CPU_OPTS
+= --enable-sse
164 CONFIGURE_CPU_OPTS
+= --disable-sse
171 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI
),y
)
172 CONFIGURE_CPU_OPTS
:= --enable-armv6
174 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32
),y
)
175 CONFIGURE_CPU_OPTS
+= --disable-mipsdsp
--disable-mipsdspr2
178 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON
),y
)
179 CONFIGURE_CPU_OPTS
+= --enable-neon
180 else ifeq ($(ADK_TARGET_ARCH_AARCH64
),y
)
181 CONFIGURE_CPU_OPTS
+= --enable-neon
183 CONFIGURE_CPU_OPTS
+= --disable-neon
186 CONFIG_STYLE
:= minimal
187 CONFIGURE_ARGS
:= --prefix=/usr \
189 --arch
=$(ADK_TARGET_CPU_ARCH
) \
190 --enable-cross-compile \
191 --sysroot
=$(STAGING_TARGET_DIR
) \
192 --cross-prefix
=$(TARGET_CROSS
) \
193 --cc='$(TARGET_CC)' \
194 --host-cc
='$(HOST_CC)' \
195 --pkg-config
='$(STAGING_HOST_DIR)/usr/bin/pkg-config' \
200 --disable-optimizations \
201 --disable-stripping \
209 $(CONFIGURE_CPU_OPTS
)
211 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_BZIP2
),y
)
212 CONFIGURE_ARGS
+= --enable-bzlib
214 CONFIGURE_ARGS
+= --disable-bzlib
217 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_ZLIB
),y
)
218 CONFIGURE_ARGS
+= --enable-zlib
220 CONFIGURE_ARGS
+= --disable-zlib
223 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264
),y
)
224 CONFIGURE_ARGS
+= --enable-libx264
226 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X265
),y
)
227 CONFIGURE_ARGS
+= --enable-libx265
229 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3
),y
)
230 CONFIGURE_ARGS
+= --enable-libmp3lame
232 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8
),y
)
233 CONFIGURE_ARGS
+= --enable-libvpx
235 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA
),y
)
236 CONFIGURE_ARGS
+= --enable-libtheora
238 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID
),y
)
239 CONFIGURE_ARGS
+= --enable-libxvid
241 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS
),y
)
242 CONFIGURE_ARGS
+= --enable-libvorbis \
244 --enable-encoder
=libvorbis
248 $(INSTALL_DIR
) $(IDIR_LIBFFMPEG
)/usr
/lib
249 $(CP
) $(WRKINST
)/usr
/lib
/libavdevice.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
250 $(CP
) $(WRKINST
)/usr
/lib
/libavformat.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
251 $(CP
) $(WRKINST
)/usr
/lib
/libavfilter.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
252 $(CP
) $(WRKINST
)/usr
/lib
/libavcodec.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
253 $(CP
) $(WRKINST
)/usr
/lib
/libavutil.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
254 $(CP
) $(WRKINST
)/usr
/lib
/libpostproc.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
255 $(CP
) $(WRKINST
)/usr
/lib
/libswscale.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
256 $(CP
) $(WRKINST
)/usr
/lib
/libswresample.so
* $(IDIR_LIBFFMPEG
)/usr
/lib
259 $(INSTALL_DIR
) $(IDIR_FFMPEG
)/usr
/bin
260 $(INSTALL_BIN
) $(WRKINST
)/usr
/bin
/ffmpeg \
261 $(IDIR_FFMPEG
)/usr
/bin
264 $(INSTALL_DIR
) $(IDIR_FFPROBE
)/usr
/bin
265 $(INSTALL_BIN
) $(WRKINST
)/usr
/bin
/ffprobe \
266 $(IDIR_FFPROBE
)/usr
/bin
268 include $(ADK_TOPDIR
)/mk
/pkg-bottom.mk