Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg extensions, Apache licensing #2561

Closed
dpkirchner opened this issue Mar 15, 2017 · 9 comments
Closed

ffmpeg extensions, Apache licensing #2561

dpkirchner opened this issue Mar 15, 2017 · 9 comments
Labels

Comments

@dpkirchner
Copy link

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+

@ojw28 ojw28 added the question label Mar 15, 2017
@ojw28
Copy link
Contributor

ojw28 commented Mar 15, 2017

  • 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 ojw28 closed this as completed Mar 15, 2017
@needz
Copy link

needz commented Apr 3, 2017

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?

@ojw28
Copy link
Contributor

ojw28 commented Apr 3, 2017

@vigneshvg - Do you have any x86 instructions?

@andrewlewis
Copy link
Collaborator

@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.

@needz
Copy link

needz commented Apr 5, 2017

@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?

@andrewlewis
Copy link
Collaborator

@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.

@needz
Copy link

needz commented Apr 5, 2017

@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.

ojw28 pushed a commit that referenced this issue Apr 6, 2017
Also add instructions for building arm64-v8a and x86.

Issue: #2561

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152141270
@needz
Copy link

needz commented Apr 6, 2017

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

@ojw28
Copy link
Contributor

ojw28 commented Apr 6, 2017

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

@google google locked and limited conversation to collaborators Jul 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants