Skip to contentSkip to conversation

Add ffmpeg support

PATCH New Luca Ceresoli 2 participants 6 messages Jun 14, 2010 – Jun 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add ffmpeg support

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library.

This patchset adds support for building ffmpeg in buildroot.

Most high-level options are provided via kconfig options, and there is a hook in the last commit to allow passing .configure any parameters not directly supported (very handy for machine support, for example).

Note that this support is much more complete than the one in bug 401
(https://bugs.busybox.net/show_bug.cgi?id=401).

v2 includes improvements suggested by Peter Korsgaard.

Thanks,
Luca

ffmpeg: add new package
ffmpeg: add commandline programs
ffmpeg: allow customization of codecs, (de)muxers and other components
ffmpeg: add user-defined configure parameters

 package/multimedia/Config.in                       |    1 +
 package/multimedia/ffmpeg/Config.in                |  141 +++++++++++++++++++
 .../ffmpeg-0.5.2-fix-sdl-config-search.patch       |   17 +++
 package/multimedia/ffmpeg/ffmpeg.mk                |  143 ++++++++++++++++++++

Luca

#1 lore raw

PATCH v2 1/4 ffmpeg: add new package

---
 package/multimedia/Config.in        |    1 +
 package/multimedia/ffmpeg/Config.in |   23 +++++++++++
 package/multimedia/ffmpeg/ffmpeg.mk |   72 +++++++++++++++++++++++++++++++++++
 3 files changed, 96 insertions(+), 0 deletions(-)
 create mode 100644 package/multimedia/ffmpeg/Config.in
 create mode 100644 package/multimedia/ffmpeg/ffmpeg.mk
package/multimedia/Config.in +1 -0
index 3305f7b..3b0eec5 100644
@@ -3,6 +3,7 @@ source "package/multimedia/alsa-lib/Config.in"
 source "package/multimedia/alsa-utils/Config.in"
 source "package/multimedia/aumix/Config.in"
 source "package/multimedia/flac/Config.in"
+source "package/multimedia/ffmpeg/Config.in"
 source "package/multimedia/gstreamer/Config.in"
 source "package/multimedia/gst-plugins-base/Config.in"
 source "package/multimedia/gst-plugins-good/Config.in"
package/multimedia/ffmpeg/Config.in new file +23 -0
new file mode 100644
index 0000000..7004a11
@@ -0,0 +1,23 @@
+menuconfig BR2_PACKAGE_FFMPEG
+	bool "ffmpeg"
+	help
+         FFmpeg is a complete, cross-platform solution to record, convert
+         and stream audio and video.
+
+	 http://www.ffmpeg.org
+
+if BR2_PACKAGE_FFMPEG
+
+config BR2_PACKAGE_FFMPEG_GPL
+	bool "Enable GPL code"
+	help
+         allow use of GPL code, the resulting libs and binaries will
+         be under GPL
+
+config BR2_PACKAGE_FFMPEG_NONFREE
+	bool "Enable nonfree code"
+	help
+         allow use of nonfree code, the resulting libs and binaries
+         will be unredistributable
+
+endif
package/multimedia/ffmpeg/ffmpeg.mk new file +72 -0

72 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 2/4 ffmpeg: add commandline programs

In reply to Luca Ceresoli
---
 package/multimedia/ffmpeg/Config.in                |   23 ++++++++++++++++++++
 .../ffmpeg-0.5.2-fix-sdl-config-search.patch       |   17 ++++++++++++++
 package/multimedia/ffmpeg/ffmpeg.mk                |   23 +++++++++++++++++--
 3 files changed, 60 insertions(+), 3 deletions(-)
 create mode 100644 package/multimedia/ffmpeg/ffmpeg-0.5.2-fix-sdl-config-search.patch
package/multimedia/ffmpeg/Config.in +23 -0
index 7004a11..fe6814f 100644
@@ -20,4 +20,27 @@ config BR2_PACKAGE_FFMPEG_NONFREE
          allow use of nonfree code, the resulting libs and binaries
          will be unredistributable
 
+config BR2_PACKAGE_FFMPEG_FFMPEG
+	bool "Build ffmpeg (the command line application)"
+	default y
+	help
+         FFmpeg is a very fast video and audio converter.
+         It can also grab from a live audio/video source.
+
+         It is not needed if you want to link the FFmpeg libraries
+         to your application.
+
+config BR2_PACKAGE_FFMPEG_FFPLAY
+	bool "Build ffplay"
+	select BR2_PACKAGE_SDL
+	help
+         FFplay is a very simple and portable media player using the
+         FFmpeg libraries and the SDL library.
+         It is mostly used as a testbed for the various FFmpeg APIs.
+
+config BR2_PACKAGE_FFMPEG_FFSERVER
+	bool "Build ffserver"
+	help
+         FFserver is a streaming server for both audio and video.
+
 endif
package/multimedia/ffmpeg/ffmpeg-0.5.2-fix-sdl-config-search.patch new file +17 -0
new file mode 100644
index 0000000..58d08aa
@@ -0,0 +1,17 @@
+Allow FFmpeg's ./configure script to use a custom sdl-config command.
+
+Inspired from:
+http://www.mail-archive.com/uclinux-dist-commits at blackfin.uclinux.org/msg01099.html
+
+diff -u ffmpeg-0.5.2-orig/configure ffmpeg-0.5.2/configure
+--- a/configure
++++ b/configure
+@@ -2066,7 +2066,7 @@
+ 
+ disable sdl_too_old
+ disable sdl
+-SDL_CONFIG="${cross_prefix}sdl-config"
++SDL_CONFIG="${SDL_CONFIG-${cross_prefix}sdl-config}"
+ if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
+     sdl_cflags=`"${SDL_CONFIG}" --cflags`
+     temp_cflags $sdl_cflags
package/multimedia/ffmpeg/ffmpeg.mk +20 -3
index 5385937..c38f7c3 100644
@@ -12,9 +12,6 @@ FFMPEG_INSTALL_TARGET = YES
 FFMPEG_CONF_OPT = \
 	--prefix=/usr		\
 	--enable-shared 	\
-	--disable-ffmpeg	\
-	--disable-ffplay	\
-	--disable-ffserver	\
 	--disable-avfilter	\
 	--disable-postproc	\
 	--disable-swscale	\
@@ -32,6 +29,26 @@ else
 FFMPEG_CONF_OPT += --disable-nonfree
 endif
 
+ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
+FFMPEG_CONF_OPT += --enable-ffmpeg
+else
+FFMPEG_CONF_OPT += --disable-ffmpeg
+endif
+
+ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
+FFMPEG_DEPENDENCIES += sdl
+FFMPEG_CONF_OPT += --enable-ffplay
+FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config
+else
+FFMPEG_CONF_OPT += --disable-ffplay
+endif
+
+ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
+FFMPEG_CONF_OPT += --enable-ffserver
+else
+FFMPEG_CONF_OPT += --disable-ffserver
+endif
+
 ifeq ($(BR2_PTHREADS_NONE),y)
 FFMPEG_CONF_OPT += --disable-pthreads
 else
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH v2 3/4 ffmpeg: allow customization of codecs, (de)muxers and other components

In reply to Luca Ceresoli

Add the option to customize the list of decoders, encoders, muxers, demuxers, parsers, protocols, bsfs and filters to be built into ffmpeg, and to compile or exclude input and output devices.

---
 package/multimedia/ffmpeg/Config.in |   88 +++++++++++++++++++++++++++++++++++
 package/multimedia/ffmpeg/ffmpeg.mk |   52 ++++++++++++++++++++
 2 files changed, 140 insertions(+), 0 deletions(-)
package/multimedia/ffmpeg/Config.in +88 -0
index fe6814f..d8661e9 100644
@@ -43,4 +43,92 @@ config BR2_PACKAGE_FFMPEG_FFSERVER
 	help
          FFserver is a streaming server for both audio and video.
 
+config BR2_PACKAGE_FFMPEG_ENCODERS
+	string "Enabled encoders"
+	default "all"
+	help
+	 Space-separated list of encoders to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-encoders in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_DECODERS
+	string "Enabled decoders"
+	default "all"
+	help
+	 Space-separated list of decoders to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-decoders in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_MUXERS
+	string "Enabled muxers"
+	default "all"
+	help
+	 Space-separated list of muxers to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-muxers in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_DEMUXERS
+	string "Enabled demuxers"
+	default "all"
+	help
+	 Space-separated list of demuxers to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-demuxers in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_PARSERS
+	string "Enabled parsers"
+	default "all"
+	help
+	 Space-separated list of parsers to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-parsers in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_BSFS
+	string "Enabled bitstreams"
+	default "all"
+	help
+	 Space-separated list of bitstream filters to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-bsfs in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_PROTOCOLS
+	string "Enabled protocols"
+	default "all"
+	help
+	 Space-separated list of protocols to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-protocols in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_FILTERS
+	string "Enabled filters"
+	default "all"
+	help
+	 Space-separated list of filters to build in FFmpeg,
+	 or "all" to build all of them.
+
+	 Run ./configure --list-filters in the ffmpeg sources
+	 directory to know the available options.
+
+config BR2_PACKAGE_FFMPEG_INDEVS
+	bool "Enable input devices"
+	default y
+
+config BR2_PACKAGE_FFMPEG_OUTDEVS
+	bool "Enable output devices"
+	default y
+
 endif
package/multimedia/ffmpeg/ffmpeg.mk +52 -0

58 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#4 lore raw

PATCH v2 4/4 ffmpeg: add user-defined configure parameters

In reply to Luca Ceresoli
---
 package/multimedia/ffmpeg/Config.in |    7 +++++++
 package/multimedia/ffmpeg/ffmpeg.mk |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)
package/multimedia/ffmpeg/Config.in +7 -0
index d8661e9..0691858 100644
@@ -131,4 +131,11 @@ config BR2_PACKAGE_FFMPEG_OUTDEVS
 	bool "Enable output devices"
 	default y
 
+config BR2_PACKAGE_FFMPEG_EXTRACONF
+	string "Additional parameters for ./configure"
+	default ""
+	help
+	 Extra parameters that will be appended to FFmpeg's
+	 ./configure commandline.
+
 endif
package/multimedia/ffmpeg/ffmpeg.mk +2 -0
index 7cb9cdf..9d28ab3 100644
@@ -114,6 +114,8 @@ else
 FFMPEG_CONF_OPT += --disable-zlib
 endif
 
+FFMPEG_CONF_OPT += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
+
 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
 define FFMPEG_CONFIGURE_CMDS
 	(cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH v2 1/1 Add ffmpeg support

In reply to Luca Ceresoli
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

Luca> FFmpeg is a complete, cross-platform solution to record, convert Luca> and stream audio and video. It includes libavcodec - the leading Luca> audio/video codec library.

Luca> This patchset adds support for building ffmpeg in buildroot.

Luca> Most high-level options are provided via kconfig options, and Luca> there is a hook in the last commit to allow passing .configure Luca> any parameters not directly supported (very handy for machine Luca> support, for example).

Luca> Note that this support is much more complete than the one in bug 401 Luca> (https://bugs.busybox.net/show_bug.cgi?id=401).

Luca> v2 includes improvements suggested by Peter Korsgaard.

Thanks, committed. I had to fix up a few things though:

- Missing ')' in qstrip calls
- configure doesn't handle --disable-nls / --disable-largefile
- ffmpeg doesn't build if the toolchain doesn't have largefile support

Signature · 1 line
Bye, Peter Korsgaard