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
:= 1b434cff8a327e54fd0f611420996e3419c58b795d51a5b588ace2a674f1060a
10 PKG_DESCR
:= record
, convert and stream audio
& video
11 PKG_SECTION
:= libs
/video
13 PKG_DEPENDS
:= libncurses
14 PKG_BUILDDEP
:= ncurses
15 PKG_URL
:= http
://www.ffmpeg.org
/
16 PKG_SITES
:= http
://www.ffmpeg.org
/releases
/
17 PKG_LIBNAME
:= libffmpeg
20 PKG_SUBPKGS
:= LIBFFMPEG FFSERVER FFPROBE FFMPEG
21 PKGSD_FFMPEG
:= video converter
22 PKGSC_FFMPEG
:= mm
/video
23 PKGSS_FFMPEG
:= libffmpeg
24 PKGSD_FFSERVER
:= streaming server
25 PKGSC_FFSERVER
:= mm
/video
26 PKGSS_FFSERVER
:= libffmpeg
27 PKGSD_FFPROBE
:= simple multimedia stream analyzer
28 PKGSC_FFPROBE
:= mm
/video
29 PKGSS_FFPROBE
:= libffmpeg
30 PKGSD_LIBFFMPEG
:= video library
31 PKGSC_LIBFFMPEG
:= libs
/video
33 PKG_FLAVOURS_LIBFFMPEG
:= WITH_MP3 WITH_VP8 WITH_THEORA
34 PKG_FLAVOURS_LIBFFMPEG
+= WITH_XVID WITH_VORBIS WITH_X264
36 PKGFD_WITH_X264
:= with X264 decoding support
37 PKGFS_WITH_X264
:= libx264
38 PKGFB_WITH_X264
:= libx264
39 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264
),y
)
40 PKG_FDEPENDS
+= libx264
43 PKGFD_WITH_MP3
:= with MP3 encoding support
44 PKGFS_WITH_MP3
:= libmp3lame
46 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3
),y
)
47 PKG_FDEPENDS
+= libmp3lame
50 PKGFD_WITH_VP8
:= with VP8 encoding support
51 PKGFS_WITH_VP8
:= libvpx
52 PKGFB_WITH_VP8
:= libvpx
53 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8
),y
)
57 PKGFD_WITH_THEORA
:= with Theora encoding support
58 PKGFS_WITH_THEORA
:= libtheora
59 PKGFB_WITH_THEORA
:= libtheora
60 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA
),y
)
61 PKG_FDEPENDS
+= libtheora
64 PKGFD_WITH_XVID
:= with Xvid encoding support
65 PKGFS_WITH_XVID
:= libxvid
66 PKGFB_WITH_XVID
:= xvidcore
67 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID
),y
)
68 PKG_FDEPENDS
+= libxvid
71 PKGFD_WITH_VORBIS
:= with Vorbis encoding support
72 PKGFS_WITH_VORBIS
:= libvorbisenc
73 PKGFB_WITH_VORBIS
:= libvorbis
74 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS
),y
)
75 PKG_FDEPENDS
+= libvorbisenc
78 DISTFILES
:= ${PKG_NAME}-${PKG_VERSION}.
tar.bz2
80 include ${ADK_TOPDIR}/mk
/package.mk
82 $(eval
$(call PKG_template
,LIBFFMPEG
,libffmpeg
,${PKG_VERSION}-${PKG_RELEASE},${PKG_FDEPENDS},${PKGSD_LIBFFMPEG},${PKGSC_LIBFFMPEG},${PKG_OPTS}))
83 $(eval
$(call PKG_template
,FFMPEG
,ffmpeg
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFMPEG},${PKGSC_FFMPEG}))
84 $(eval
$(call PKG_template
,FFSERVER
,ffserver
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFSERVER},${PKGSC_FFSERVER}))
85 $(eval
$(call PKG_template
,FFPROBE
,ffprobe
,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFPROBE},${PKGSC_FFPROBE}))
88 TARGET_CFLAGS
:= $(subst O0
,O2
,$(TARGET_CFLAGS
))
90 TARGET_CFLAGS
:= $(subst Os
,O2
,$(TARGET_CFLAGS
))
92 TARGET_CPPFLAGS
+= -D_POSIX_SOURCE
-D_GNU_SOURCE
94 ifeq ($(ADK_TARGET_CPU_WITH_MMX
),y
)
95 CONFIGURE_CPU_OPTS
+= --enable-mmx
97 CONFIGURE_CPU_OPTS
+= --disable-mmx
99 ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT
),y
)
100 CONFIGURE_CPU_OPTS
+= --enable-mmxext
102 CONFIGURE_CPU_OPTS
+= --disable-mmxext
104 ifeq (${ADK_TARGET_CPU_WITH_SSE4_2},y
)
105 CONFIGURE_CPU_OPTS
+= --enable-sse42 \
112 CONFIGURE_CPU_OPTS
+= --disable-sse42
113 ifeq (${ADK_TARGET_CPU_WITH_SSE4_1},y
)
114 CONFIGURE_CPU_OPTS
+= --enable-sse4 \
120 CONFIGURE_CPU_OPTS
+= --disable-sse4
121 ifeq (${ADK_TARGET_CPU_WITH_SSSE3},y
)
122 CONFIGURE_CPU_OPTS
+= --enable-ssse3 \
127 CONFIGURE_CPU_OPTS
+= --disable-ssse3
128 ifeq (${ADK_TARGET_CPU_WITH_SSE3},y
)
129 CONFIGURE_CPU_OPTS
+= --enable-sse3 \
133 CONFIGURE_CPU_OPTS
+= --disable-sse3
134 ifeq (${ADK_TARGET_CPU_WITH_SSE2},y
)
135 CONFIGURE_CPU_OPTS
+= --enable-sse2 \
138 CONFIGURE_CPU_OPTS
+= --disable-sse2
139 ifeq (${ADK_TARGET_CPU_WITH_SSE},y
)
140 CONFIGURE_CPU_OPTS
+= --enable-sse
142 CONFIGURE_CPU_OPTS
+= --disable-sse
149 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI
),y
)
150 CONFIGURE_CPU_OPTS
:= --enable-armv6
152 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32
),y
)
153 CONFIGURE_CPU_OPTS
+= --disable-mipsdsp
--disable-mipsdspr2
156 CONFIG_STYLE
:= minimal
157 CONFIGURE_ARGS
:= --prefix=/usr \
159 --arch
=${ADK_TARGET_CPU_ARCH} \
160 --enable-cross-compile \
161 --sysroot
=${STAGING_TARGET_DIR} \
162 --cross-prefix
=${TARGET_CROSS} \
163 --cc='$(TARGET_CC)' \
164 --host-cc
='$(HOST_CC)' \
170 --disable-optimizations \
171 --disable-stripping \
178 ${CONFIGURE_CPU_OPTS}
180 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264
),y
)
181 CONFIGURE_ARGS
+= --enable-libx264
183 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3
),y
)
184 CONFIGURE_ARGS
+= --enable-libmp3lame
186 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8
),y
)
187 CONFIGURE_ARGS
+= --enable-libvpx
189 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA
),y
)
190 CONFIGURE_ARGS
+= --enable-libtheora
192 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID
),y
)
193 CONFIGURE_ARGS
+= --enable-libxvid
195 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS
),y
)
196 CONFIGURE_ARGS
+= --enable-libvorbis
200 ${INSTALL_DIR} ${IDIR_LIBFFMPEG}/usr
/lib
201 ${CP} ${WRKINST}/usr
/lib
/libavdevice.so
* ${IDIR_LIBFFMPEG}/usr
/lib
202 ${CP} ${WRKINST}/usr
/lib
/libavformat.so
* ${IDIR_LIBFFMPEG}/usr
/lib
203 ${CP} ${WRKINST}/usr
/lib
/libavfilter.so
* ${IDIR_LIBFFMPEG}/usr
/lib
204 ${CP} ${WRKINST}/usr
/lib
/libavcodec.so
* ${IDIR_LIBFFMPEG}/usr
/lib
205 ${CP} ${WRKINST}/usr
/lib
/libavutil.so
* ${IDIR_LIBFFMPEG}/usr
/lib
206 ${CP} ${WRKINST}/usr
/lib
/libpostproc.so
* ${IDIR_LIBFFMPEG}/usr
/lib
207 ${CP} ${WRKINST}/usr
/lib
/libswscale.so
* ${IDIR_LIBFFMPEG}/usr
/lib
208 ${CP} ${WRKINST}/usr
/lib
/libswresample.so
* ${IDIR_LIBFFMPEG}/usr
/lib
211 ${INSTALL_DIR} ${IDIR_FFMPEG}/usr
/bin
212 ${INSTALL_BIN} ${WRKINST}/usr
/bin
/ffmpeg
${IDIR_FFMPEG}/usr
/bin
215 ${INSTALL_DIR} ${IDIR_FFSERVER}/etc
216 $(INSTALL_DATA
) $(WRKBUILD
)/doc
/ffserver.conf
${IDIR_FFSERVER}/etc
217 ${INSTALL_DIR} ${IDIR_FFSERVER}/usr
/bin
218 ${INSTALL_BIN} ${WRKINST}/usr
/bin
/ffserver
${IDIR_FFSERVER}/usr
/bin
221 ${INSTALL_DIR} ${IDIR_FFPROBE}/usr
/bin
222 ${INSTALL_BIN} ${WRKINST}/usr
/bin
/ffprobe
${IDIR_FFPROBE}/usr
/bin
224 include ${ADK_TOPDIR}/mk
/pkg-bottom.mk