summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-09 02:04:27 +0200
committerwm4 <wm4@nowhere>2013-07-09 02:04:27 +0200
commit8e59c9125bc0b1fd2701da8a651a7046806bb8eb (patch)
tree06aa5fe0b58936cbb6687e6e7cdab0d4ed193dc8
parentf0ece66673274f3e42ce3d8237b082b8f09976cd (diff)
downloadmpv-build-8e59c9125bc0b1fd2701da8a651a7046806bb8eb.tar.bz2
mpv-build-8e59c9125bc0b1fd2701da8a651a7046806bb8eb.tar.xz
Slightly better way to allow custom ffmpeg configuration
This read options from a file named ffmpeg_options and passes them to ffmpeg's configure.
-rw-r--r--README.rst23
-rwxr-xr-xscripts/ffmpeg-config10
2 files changed, 29 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index 6c99601..e2039ba 100644
--- a/README.rst
+++ b/README.rst
@@ -63,13 +63,32 @@ Essential dependencies (incomplete list):
- fribidi, freetype, fontconfig development headers (for libass)
- libjpeg
- libquvi if you want to play Youtube videos directly
-- libx264 if you want to use encoding (you have to add --enable-libx264 to
- scripts/ffmpeg-config, because ffmpeg doesn't autodetect this library)
+- libx264/libmp3lame/libfdk-aac if you want to use encoding (you have to
+ add these options explicitly to the ffmpeg options, as ffmpeg won't
+ autodetect these libraries; see next section)
Note: most dependencies are optional and autodetected. If they're missing,
these features will be disabled silently. This includes some dependencies
which could be considered essential.
+Enabling optional ffmpeg dependencies
+=====================================
+
+ffmpeg doesn't autodetect many dependencies. Instead, it requires you to
+enable them explicitly at configuration time. (And it will simply fail
+if the dependencies are not available.)
+
+You can put additional ffmpeg configure flags into ffmpeg_options. For
+example, to enable some dependencies needed for encoding:
+
+echo --enable-libx264 >> ffmpeg_options
+echo --enable-libmp3lame >> ffmpeg_options
+echo --enable-libfdk-aac >> ffmpeg_options
+echo --enable-nonfree >> ffmpeg_options
+
+(Do this in the mpv-build toplevel directory, the same that contains
+the Makefile and this readme file.)
+
Installing dependencies on Debian or Ubuntu
===========================================
diff --git a/scripts/ffmpeg-config b/scripts/ffmpeg-config
index 2e2bfc7..2213171 100755
--- a/scripts/ffmpeg-config
+++ b/scripts/ffmpeg-config
@@ -1,14 +1,20 @@
#!/bin/sh
set -e
-OPTIONS="--enable-gpl --enable-avresample --disable-debug --disable-doc"
+BUILD="$(pwd)"
+
+if test -f "$BUILD"/ffmpeg_options ; then
+ USER_OPTS=$(cat "$BUILD"/ffmpeg_options)
+fi
+OPTIONS="--enable-gpl --enable-avresample --disable-debug --disable-doc $USER_OPTS"
# optional flags for encoding (uncomment if you want to support these encoders)
#OPTIONS="$OPTIONS --enable-libx264"
#OPTIONS="$OPTIONS --enable-libmp3lame"
#OPTIONS="$OPTIONS --enable-nonfree --enable-libfdk-aac"
-BUILD="$(pwd)"
+echo Using ffmpeg options: $OPTIONS
+
mkdir -p "$BUILD"/ffmpeg_build
cd "$BUILD"/ffmpeg_build
"$BUILD"/ffmpeg/configure --prefix="$BUILD"/build_libs --enable-static --disable-shared $OPTIONS