Exoplayer: ffmpeg extensions, Apache licensing

Created on 15 Mar 2017  路  9Comments  路  Source: google/ExoPlayer

Issue description

I noticed in the release notes that the version 2 library includes some "ffmpeg extension" code. Can you explicitly confirm that this new code is Apache licensed? I saw that the headers in the files suggest it is but that could have been a copy/paste thing.

I'm not asking for legal advice, I don't think, just whether or not the extension includes non-Apache code (specifically LGPL, but really any).

Version of ExoPlayer being used

I'm looking at r2.0.0+

question

All 9 comments

  • The ffmpeg extension is not part of the core library. Unless you're explicitly building and using the extension as per the instructions here, its existence isn't relevant to you.
  • The ExoPlayer ffmpeg extension can be thought of as a bridge onto ffmpeg, and is licensed under the Apache License (Version 2.0). However for it to be useful you'd also need to be building and including ffmpeg in your application as per the build instructions. Ffmpeg has its own license(s) that you should be aware of if you do this. Refer to the ffmpeg licensing page to learn more.

ojw28, is there a chance you could add an instruction on how to build a FFMPEG extension for x86 platform, since the readme (https://github.com/google/ExoPlayer/tree/release-v2/extensions/ffmpeg/README.md) for ARM devices was very straightforward and worked really well?

@vigneshvg - Do you have any x86 instructions?

@needz, please try the following:

./configure \
    --libdir=android-libs/x86 \
    --arch=x86 \
    --cpu=i686 \
    --cross-prefix="${NDK_PATH}/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-" \
    --sysroot="${NDK_PATH}/platforms/android-9/arch-x86/" \
    --extra-ldexeflags=-pie \
    --disable-asm \
    --target-os=android \
    --disable-static \
    --enable-shared \
    --disable-doc \
    --disable-programs \
    --disable-everything \
    --disable-avdevice \
    --disable-avformat \
    --disable-swscale \
    --disable-postproc \
    --disable-avfilter \
    --disable-symver \
    --disable-swresample \
    --enable-avresample \
    --enable-decoder=vorbis \
    --enable-decoder=opus \
    --enable-decoder=flac \
    && \
make -j4 && make install-libs

Note: It seems to be necessary to disable using assembly (--disable-asm) for 32-bit x86, due to an issue with text relocations.

Also, include x86 in the APP_ABI when building the JNI code:

cd "${FFMPEG_EXT_PATH}"/jni && \
${NDK_PATH}/ndk-build APP_ABI="armeabi-v7a x86" -j4

I plan to update the extension's README to include these instructions soon.

@andrewlewis thanks! Here's what I get after the last command:

cd "${FFMPEG_EXT_PATH}"/jni && ${NDK_PATH}/ndk-build APP_ABI=x86 -j4

Android NDK: ERROR:/var/tmp/ExoPlayer/extensions/ffmpeg/src/main/jni/Android.mk:swresample: LOCAL_SRC_FILES points to a missing file    
Android NDK: Check that /var/tmp/ExoPlayer/extensions/ffmpeg/src/main/jni/ffmpeg/android-libs/x86/libswresample.so exists  or that its path is correct   
/var/tmp/android-ndk-r13b/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.

Any chance to fix it somehow? the armeabi-v7a build went fine before this. I see the --disable-swresample in x86 config (which is not included in armeabi-v7a config), maybe it influenced this somehow? What is this option for?

@needz, please try removing libswresample from LOCAL_SHARED_LIBRARIES in Android.mk and rerunning the command.

Sorry for the confusion -- while testing the instructions for x86 I removed libswresample as it's not needed when using libavresample. I intended these instructions to be standalone but missed out that part of the change.

@andrewlewis, thanks, I ended up removing the --disable-swresample (since I didn't want to modify Android.mk) and it worked. I can now normally use ExoPlayer in Android Studio emulator.

@andrewlewis, thanks for fixing the FFmpeg extension instructions for several platforms, it worked great out of the box.

Thank @andrewlewis (if you look at the change you'll see I'm not the author, just the one who pushed it :)).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tramnguyen108 picture Tramnguyen108  路  3Comments

eneim picture eneim  路  3Comments

petitTrung picture petitTrung  路  3Comments

orcunkobal picture orcunkobal  路  3Comments

R00We picture R00We  路  3Comments