Commit 8ae8bf7b by olly Committed by Oliver Woodman

Split fetching FFmpeg from build_ffmpeg.sh

It makes it harder to work with a different branch. Also make
the FFmpeg instructions consistent with those of the other
extensions (e.g., by removing the "jni" part of the path from
the FFMPEG_EXT_PATH variable.

PiperOrigin-RevId: 310937751
parent 0fb4ba78
...@@ -25,7 +25,7 @@ follows: ...@@ -25,7 +25,7 @@ follows:
``` ```
cd "<path to exoplayer checkout>" cd "<path to exoplayer checkout>"
FFMPEG_EXT_PATH="$(pwd)/extensions/ffmpeg/src/main/jni" FFMPEG_EXT_PATH="$(pwd)/extensions/ffmpeg/src/main"
``` ```
* Download the [Android NDK][] and set its location in a shell variable. * Download the [Android NDK][] and set its location in a shell variable.
...@@ -41,6 +41,21 @@ NDK_PATH="<path to Android NDK>" ...@@ -41,6 +41,21 @@ NDK_PATH="<path to Android NDK>"
HOST_PLATFORM="linux-x86_64" HOST_PLATFORM="linux-x86_64"
``` ```
* Fetch FFmpeg:
```
cd "${FFMPEG_EXT_PATH}/jni" && \
git clone git://source.ffmpeg.org/ffmpeg ffmpeg
```
* Checkout an appropriate branch of FFmpeg. We cannot guarantee compatibility
with all versions of FFmpeg. We currently recommend version 4.2:
```
cd "${FFMPEG_EXT_PATH}/jni/ffmpeg" && \
git checkout release/4.2
```
* Configure the decoders to include. See the [Supported formats][] page for * Configure the decoders to include. See the [Supported formats][] page for
details of the available decoders, and which formats they support. details of the available decoders, and which formats they support.
...@@ -48,12 +63,12 @@ HOST_PLATFORM="linux-x86_64" ...@@ -48,12 +63,12 @@ HOST_PLATFORM="linux-x86_64"
ENABLED_DECODERS=(vorbis opus flac) ENABLED_DECODERS=(vorbis opus flac)
``` ```
* Fetch and build FFmpeg. Executing `build_ffmpeg.sh` will fetch and build * Execute `build_ffmpeg.sh` to build FFmpeg for `armeabi-v7a`, `arm64-v8a`,
FFmpeg 4.2 for `armeabi-v7a`, `arm64-v8a`, `x86` and `x86_64`. The script can `x86` and `x86_64`. The script can be edited if you need to build for
be edited if you need to build for different architectures. different architectures:
``` ```
cd "${FFMPEG_EXT_PATH}" && \ cd "${FFMPEG_EXT_PATH}/jni" && \
./build_ffmpeg.sh \ ./build_ffmpeg.sh \
"${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}" "${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}"
``` ```
...@@ -62,7 +77,7 @@ cd "${FFMPEG_EXT_PATH}" && \ ...@@ -62,7 +77,7 @@ cd "${FFMPEG_EXT_PATH}" && \
built in the previous step. For example: built in the previous step. For example:
``` ```
cd "${FFMPEG_EXT_PATH}" && \ cd "${FFMPEG_EXT_PATH}/jni" && \
${NDK_PATH}/ndk-build APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" -j4 ${NDK_PATH}/ndk-build APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" -j4
``` ```
......
...@@ -41,10 +41,7 @@ for decoder in "${ENABLED_DECODERS[@]}" ...@@ -41,10 +41,7 @@ for decoder in "${ENABLED_DECODERS[@]}"
do do
COMMON_OPTIONS="${COMMON_OPTIONS} --enable-decoder=${decoder}" COMMON_OPTIONS="${COMMON_OPTIONS} --enable-decoder=${decoder}"
done done
cd "${FFMPEG_EXT_PATH}" cd "${FFMPEG_EXT_PATH}/jni/ffmpeg"
(git -C ffmpeg pull || git clone git://source.ffmpeg.org/ffmpeg ffmpeg)
cd ffmpeg
git checkout release/4.2
./configure \ ./configure \
--libdir=android-libs/armeabi-v7a \ --libdir=android-libs/armeabi-v7a \
--arch=arm \ --arch=arm \
......
...@@ -42,9 +42,8 @@ cd "${VP9_EXT_PATH}/jni" && \ ...@@ -42,9 +42,8 @@ cd "${VP9_EXT_PATH}/jni" && \
git clone https://chromium.googlesource.com/webm/libvpx libvpx git clone https://chromium.googlesource.com/webm/libvpx libvpx
``` ```
* Checkout the appropriate branch of libvpx (the scripts and makefiles bundled * Checkout an appropriate branch of libvpx. We cannot guarantee compatibility
in this repo are known to work only at specific versions of the library - we with all versions of libvpx. We currently recommend version 1.8.0:
will update this periodically as newer versions of libvpx are released):
``` ```
cd "${VP9_EXT_PATH}/jni/libvpx" && \ cd "${VP9_EXT_PATH}/jni/libvpx" && \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment