How to stream to ffserver from android - android

I need to stream from an android camera/ file to a remote ffserver which will broadcast my video. I can do this on the desktop in ubuntu by issuing a command like:
ffmpeg -f video4linux2 -s 640x480 -r 25 -i /dev/video0 http://192.168.0.20:8090/cam1.ffm
or stream a file like this:
ffmpeg -i /home/kev/share/movie.mp4 http://192.168.0.20:8090/cam1.ffm
So basically i want to be able to do the above from android. After several searches this is what i've done so far - i came across this link http://bambuser.com/opensource from which i downloaded the ffmpeg source and built it. The build outputs several things:
1. shared libs [libavcodec, libavcore, libavdevice, libavfilter,libavformat,libavutil,libswscale]
2. executables [ffmpeg,ffprobe]
Not sure how to plug my functionality with these resources this is what i've tried so far:
1. loaded the libs in my Activity using System.loadLibrary() then copied the ffmpeg executable to the assets folder which at runtime i copied to my application's "files" directory i then set permissions for the executable using Runtime.getRuntime().exec(). then the last step was to execute it in java with the following statement:
Runtime.getRuntime().exec("ffmpeg -i file:///android_asset/movie.mp4http://<server>:8090/cam1.ffm");
2. copied ffmpeg.c,the shared libraries and the "include" folder that was generated by the build to my jni folder and added a jni function that wraps around the main() function in ffmpeg.c. With this approach i've found myself having to copy several header files from the ffmpeg source for the ndk-build to succeed and i highly doubt if this is the way to go.
The above two approaches havnt worked for me, i'm not sure where i'm going wrong, so any help on how to do a simple ffmpeg streaming like an mp4 file from android would be highly appreciated.

I got it working by using apporach 2, this is what i did.
1. copied ffmpeg.c,the "include" folder and the shared libraries to my project's jni folder.
modified ffmpeg.c with reference to this blog post http://demo860.blogspot.com/2010/07/android-ffmpeg-dynamic-module-jni.html
there were several errors while building with ndk so i just added the missing dependencies until finally the build succeeded.
At first the app would start and then immediately exit, this was due to a couple of things i forgot to do so make sure you've done the following to save yourself some hours and hair loss:
- set internet permission on manifest(if media file is in sdcard, set write external storage permission and make sure the sdcard is mounted)
- make sure the remote ffserver is running and configured correctly. you can confirm by streaming from a desktop
- make sure you have the correct params passed
Now i can stream from an mp4 file in my sdcard to a remote ffserver, havnt tried streaming from the device camera yet.

It seems to be a bit late to answer this question, but if you need a solution, here's one...
Well, I had devised a workaround to the same problem but through the first approach that is using a compiled FFmpeg Binary rather than JNI...
First, as far as it seems to me, the builds provided by Bambuser are way too old and FFmpeg has a vicious development cycle...
So I'd rather suggest to custom build your own binary from the latest FFmpeg Source...
Here's a script that could be used to generate one :
#!/bin/bash
echo ""
echo " ********** FFmpeg Android Build ********** "
echo ""
NDK=$HOME/android-ndk-r8d
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
PLATFORM=$NDK/platforms/android-14/arch-arm
PREFIX=$HOME/FFmpeg.Binaries.Android
FFMPEG_BASE=$HOME/FFmpeg.Build
if [ -d "$FFMPEG_BASE" ]; then
rm -v -r -f $FFMPEG_BASE
fi
if [ -d "$PREFIX" ]; then
rm -v -r -f $PREFIX
fi
mkdir $FFMPEG_BASE
mkdir $PREFIX
# x264 Installation
echo ""
echo " ********** libx264 Installation ********** "
echo ""
cd $FFMPEG_BASE
git clone --depth 1 git://git.videolan.org/x264
cd $FFMPEG_BASE/x264
./configure --prefix=$PREFIX \
--enable-static \
--enable-pic \
--disable-asm \
--disable-cli \
--host=arm-linux \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--sysroot=$PLATFORM
make
sudo make install
sudo ldconfig
#FFmpeg Installation
echo ""
echo " ********** FFmpeg (Android) Installation ********** "
echo ""
cd $FFMPEG_BASE
# git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd $FFMPEG_BASE/ffmpeg
./configure --target-os=linux --prefix=$PREFIX \
--enable-cross-compile \
--enable-runtime-cpudetect \
--disable-asm \
--arch=arm \
--cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--disable-stripping \
--nm=$PREBUILT/bin/arm-linux-androideabi-nm \
--sysroot=$PLATFORM \
--enable-nonfree \
--enable-version3 \
--enable-gpl \
--disable-doc \
--enable-avresample \
--enable-demuxer=rtsp \
--enable-muxer=rtsp \
--disable-ffserver \
--disable-ffprobe \
--enable-ffmpeg \
--enable-ffplay \
--enable-libx264 \
--enable-encoder=libx264 \
--enable-decoder=h264 \
--enable-protocol=rtp \
--enable-hwaccels \
--enable-zlib \
--extra-cflags="-I$PREFIX/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \
--extra-ldflags="-L$PREFIX/lib"
make -j4 install
$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
# rm -v -r -f $FFMPEG_BASE
clear
echo ""
echo "FFmpeg Android Build Successful..."
echo ""
ls -l -R $PREFIX
exit
For the above script to work, Android NDK is required and could be downloaded from here. Download the NDK and extract to your /home/<username> directory or else customize the script as per your needs...
And also avoid using the file:// protocol in the command line, just specify the absolute path of the input file. And try to log the output from the FFmpeg process by gettin' instances of its stdout and stderr streams...

You don't have to copy shared libraries and include folder. You can use the "PREBUILD_SHARED_LIBRARY" feature of Andriod.mk instead.

Related

Compiling ffmpeg for android on Mac

I tried to compile ffmpeg for android on Mac, but it does not work for me.
#!/bin/bash
NDK=/Users/user/Library/Android/sdk/ndk-bundle
SYSROOT=$NDK/platforms/android-18/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-network \
--disable-filters \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean all
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
I also give execute permission via chmod +x build_script.sh
I tried ffmpeg 4.1 and 4.0.3 but both are not work and same error reason.
I also tried on android-21 and android-18
test_cpp_condition stddef.h defined __ARM_ARCH_4__ || defined __TARGET_ARCH_4
test_cpp
BEGIN /tmp/ffconf.bgSdFwkD/test.c
1 #include <stddef.h>
2 #if !(defined __ARM_ARCH_4__ || defined __TARGET_ARCH_4)
3 #error "unsatisfied condition: defined __ARM_ARCH_4__ || defined __TARGET_ARCH_4"
4 #endif
END /tmp/ffconf.bgSdFwkD/test.c
/Users/user/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/Users/user/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/ -Os -fpic -marm -E -o /tmp/ffconf.bgSdFwkD/test.o /tmp/ffconf.bgSdFwkD/test.c
/tmp/ffconf.bgSdFwkD/test.c:3:2: error: "unsatisfied condition: defined __ARM_ARCH_4__ || defined __TARGET_ARCH_4"
#error "unsatisfied condition: defined __ARM_ARCH_4__ || defined __TARGET_ARCH_4"
^
1 error generated.
test_cpp_condition stddef.h defined __ARM_ARCH_4T__ || defined __TARGET_ARCH_4T
test_cpp
BEGIN /tmp/ffconf.bgSdFwkD/test.c
1 #include <stddef.h>
2 #if !(defined __ARM_ARCH_4T__ || defined __TARGET_ARCH_4T)
3 #error "unsatisfied condition: defined __ARM_ARCH_4T__ || defined __TARGET_ARCH_4T"
4 #endif
END /tmp/ffconf.bgSdFwkD/test.c
/Users/user/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/Users/user/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/ -Os -fpic -marm -E -o /tmp/ffconf.bgSdFwkD/test.o /tmp/ffconf.bgSdFwkD/test.c
test_ld cc
test_cc
BEGIN /tmp/ffconf.bgSdFwkD/test.c
1 int main(void){ return 0; }
END /tmp/ffconf.bgSdFwkD/test.c
/Users/user/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/Users/user/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/ -Os -fpic -marm -march=armv4t -c -o /tmp/ffconf.bgSdFwkD/test.o /tmp/ffconf.bgSdFwkD/test.c
/Users/user/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/Users/user/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/ -march=armv4t -o /tmp/ffconf.bgSdFwkD/test /tmp/ffconf.bgSdFwkD/test.o
ld: unknown option: --sysroot=/Users/user/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/
clang: error: linker command failed with exit code 1 (use -v to see invocation)
C compiler test failed.
Is there any tools/Applications or libraries I have to additionally install for compiling? I'm confused.... (THIS QUESTION IS MAY DUPLICATE BUT NONE OF SOLUTION WAS WORKED FOR ME)
EDIT To clarify my system environment.
Mac OS X High Sierra (10.13.6)
Android NDK (18.1.5063045)
Android SDK Tools and SDK Build-Tools
CMake
EDIT I also tried ffmpeg version 3.3.9 but it does not work either.
I was installed NDK through Android Studio and I think it was the problem, so I downloaded Android NDK manually and now I can configure and run the makefile.
Wait! Not done yet. When I ran makefile with latest stable NDK (r16b), it says:
./libavutil/common.h:33:19: fatal error: errno.h: No such file or directory
According to this document, so I tried using NDK r15c and it finally works for me.
To summarize how I solve this problem: Manually install NDK r15c and DON'T FORGET update your shell script file!
Hope this help!!
You can use wrappers https://github.com/WritingMinds/ffmpeg-android
if you want to use most of the command. It will increase the size of apk.
I also tried to compile it and after several attempts, I compiled my own one. But it is hard to integrate as well. I used below tutorials to compile it.
https://syllogismobile.wordpress.com/2017/02/19/building-ffmpeg-for-android/
https://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/
https://yesimroy.gitbooks.io/android-note/content/compile_ffmpeg_for_android.html
But I just wanted to tell, use FFmpeg wrapper for it if u don't consider the size of apk. There is not the considerable gain of performance in own compiled FFmpeg. Use above mentioned wrapper u want. It works well. If u more enthusiastic about compile and integrate your own FFmpeg, try above tutorials.

Compiling ffmpeg for Android on OSX

I'm trying to compile ffmpeg for Android, on OSX 10.12.4 .
Here are the steps I followed:
1°) Compile pkg-config
Download the sources from here . Extract && cd in the pkg-config folder.
export DST=/a/path/on/my/computer
./configure --with-internal-glib --prefix=$DST --exec-prefix=$DST
make -j2
make install
export PATH=$PATH:$DST/bin
2°) Compile ffmpeg
Download the sources from here. Extract && cd in the ffmpeg folder.
export NDK=/path/to/android-ndk-r15c
export PLATFORM_VERSION=android-26
export ARCH=arm
export PLATFORM=$NDK/platforms/$PLATFORM_VERSION/arch-$ARCH
export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64
export PREFIX=$(pwd)/android/$ARCH
export ADDI_CFLAGS="-Os -fpic -marm"
export ADDI_CONFIGURE_FLAG=""
export ADDI_LDFLAGS=""
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-symver \
--disable-avdevice \
\
--pkg-config=pkg-config \
\
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=$ARCH \
--enable-cross-compile \
--sysroot=$PLATFORM \
--extra-cflags="$ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
\
$ADDI_CONFIGURE_FLAG
make -j2
Make fails with the following error:
AR libavfilter/libavfilter.a
AR libavformat/libavformat.a
CC libavcodec/aaccoder.o
In file included from /Users/Tim/Library/Android/android-ndk-r15c/platforms/android-26/arch-arm/usr/include/asm/termbits.h:19:0,
from /Users/Tim/Library/Android/android-ndk-r15c/platforms/android-26/arch-arm/usr/include/asm-generic/termios.h:21,
from /Users/Tim/Library/Android/android-ndk-r15c/platforms/android-26/arch-arm/usr/include/asm/termios.h:19,
from /Users/Tim/Library/Android/android-ndk-r15c/platforms/android-26/arch-arm/usr/include/linux/termios.h:22,
from /Users/Tim/Library/Android/android-ndk-r15c/platforms/android-26/arch-arm/usr/include/sys/ioctl.h:37,
from ./libavutil/timer.h:36,
from ./libavutil/internal.h:42,
from ./libavutil/common.h:467,
from libavcodec/mathops.h:27,
from libavcodec/aaccoder.c:38:
libavcodec/aaccoder.c: In function 'search_for_ms':
libavcodec/aaccoder.c:803:25: error: expected identifier or '(' before numeric constant
int B0 = 0, B1 = 0;
^
libavcodec/aaccoder.c:865:28: error: lvalue required as left operand of assignment
B0 += b1+b2;
^
libavcodec/aaccoder.c:866:25: error: 'B1' undeclared (first use in this function)
B1 += b3+b4;
^
libavcodec/aaccoder.c:866:25: note: each undeclared identifier is reported only once for each function it appears in
make: *** [libavcodec/aaccoder.o] Error 1
make: *** Waiting for unfinished jobs....
I'm able to fix that error by renaming B0 & B1 variables in the source to A0 & A1 (don't know why it fixes the problem), but then it fails somewhere else. I guess something is wrong in my config, and I'd prefer to avoid having to patch the source.
So the questions are:
does someone know what's wrong here? Do I need to give some args to gcc?
is the --target-os=linux correct, or should it be --target-os=darwin? Is target-os the OS where the compilation is done, or where ffmpeg will be executed? By using darwin, I can compile using --enable-static, but not --enable-shared (which I want).
Note: I need to compile it myself as I want only an arm version, with HTTPS support. Thus I can't use the existing built versions.
I also met this problem when I tried to build the ffmpeg 3.4 the latest version.I wish you could try the 3.3 version.I built it successfully.
I doubt that latest version is unstable and with some bug.
By the way,You can take some answer By this article:
http://alientechlab.com/how-to-build-ffmpeg-for-android/
Issue closed by FFmpeg team
--target-os=android solves it
./configure \
...
--target-os=android

cross compile protobuf 2.5.0 for Android on Centos 7

I would like to run a Qt Console Application written in C++ that includes the use of protobuf on a android phone.
Therefore, I need to crosscompile protobuf for a arm architecture. I have been following this script.
https://gist.github.com/helayzhang/9034454
This is my configure command:
sudo ./configure --prefix=/home/staff/Desktop/proto_arm --build=armv7- android-linux-android --host=armv7-android-linux-android --target=armv7-android-linux-android --enable-cross-compile --with-protoc=/home/staff/Desktop/proto_arm/protoc CXXFLAGS="$(pkg-config --cflags protobuf)" LIBS="$(pkg-config --libs protobuf)"
My problems are cross-compilation option is ignored
checking whether we are cross compiling... no
and I am not sure whether I am building for the right architecture. My phone supports ABIs arm64-v8a, armeabi-v7a and armeabi, the OS is android 6 marshmallow
I am grateful for every advice!
Here is a link to my config.log file
enter link description here
I was able to compile protobuf with this scipt:
#!/bin/bash
export NDK=/media/qt5-qwt6/ndk10/android-ndk-r10e
export SYSROOT=$NDK/platforms/android-21/arch-arm
export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
export PATH=$PATH:$TOOLCHAIN/bin
export CC="$TOOLCHAIN/bin/arm-linux-androideabi-gcc --sysroot $SYSROOT"
export CXX="$TOOLCHAIN/bin/arm-linux-androideabi-g++ --sysroot $SYSROOT"
export CXXSTL=$NDK/sources/cxx-stl/gnu-libstdc++/4.9
function build_one
{
mkdir build
./configure --prefix=$(pwd)/build \
--host=arm-linux-androideabi \
--with-sysroot=$SYSROOT \
--enable-static \
--disable-shared \
--enable-cross-compile \
--with-protoc=protoc \
CFLAGS="-march=armv7-a" \
CXXFLAGS="-march=armv7-a -I$CXXSTL/include -I$CXXSTL/libs/armeabi-v7a/include -L$CXXSTL/libs/armeabi-v7a/ -lgnustl_static"
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
# Inspect the library architecture specific information
# arm-linux-androideabi-readelf -A build/lib/libprotobuf-lite.a

Unable to upload an APK file to hockey app via their API

I am unable to upload an android apk to hockeyapp through the API provided by them.When i use
curl \ -F "status=2" \
-F "notify=1" \
-F "notes=Some new features and fixed bugs." \
-F "notes_type=0" \
-F "apk=#app-release.apk" \
-H "X-HockeyAppToken: MY_TOKEN" \https://rink.hockeyapp.net/api/2/apps/MY_APP_ID/app_versions/upload
i am getting an error : {"status":null}
And when I try
curl \
-F "status=2" \
-F "notify=1" \
-F "notes=Some new features and fixed bugs." \
-F "notes_type=0" \ -F "apk=#app-release.apk" \
-H "X-HockeyAppToken: MY_TOKEN" \ https://rink.hockeyapp.net/api/2/apps/upload
an error occurs : {"status":"error","message":"File not found. Please check that your file is not a directory or bundle."}
Please give me a solution.Drag and drop is working for me.But I need it to be done through their API.I am using Team City as my CI server.
The parameter for the build is called "ipa" on all platforms, i.e. -F "ipa=#app-release.apk" would be correct.

How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c

did someone successfully compile
ffmpeg-2.2.2 on windows with cygwin and android ndkr9c ?
Or can point me to an up to date tutorial ?
(http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ isn't working for me
i get Makefile:2: config.mak: No such file...
cygwin admin devel gnome is completely installed and make -v ok )
I need to convert a video to images(for live-wallpaper)... do you know a better
method or is ffmpeg the best ?
thx
Start with Roman's tutorial.
Following changes apply to Windows: you should use the NDK make.exe, not the one from cygwin. So, I simply wrote d:/dev/Android/ndk/prebuilt/windows-x86_64/bin/make.exe in my build_android.sh. For some weird reason, I could not run make clean - but I simply chose to ignore this problem for now.
Following the tutorial, don't forget to set
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64
Also, use mixed-style paths, i.e. d:/dev/whatever and not cygwin style /cygdrive/d/dev/whatever. Be careful not to use paths with spaces - neither for ndk installation, nor for ffmpeg git clone.
With ffmpeg 2.2, you can use --target-os=android for ./configure, instead of mangling ./configure file as described in step 2.
On my machine, I did not have pr and od commands. I chose simply to fake them, writing
echo 'cat $3' > ./pr
echo 'echo od' > ./od
These do not spoil the build.
So, my build process is as follows:
git clean -d -f -x
./configure --enable-shared --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-doc --disable-symver --cross-prefix=d:/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi- --target-os=android --arch=arm --enable-cross-compile --sysroot=d:/android-ndk-r9c/platforms/android-9/arch-arm/ --extra-cflags="-Os -fpic"
Compilation does display some warnings, but the .so files are all produced.
To enable NEON, I used
--extra-cflags="-Os -fpic -marm -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
--extra-ldflags="-Wl,--fix-cortex-a8"
Now, libavcodec.so could not be built anymore: too many files on the linker list. So, after it crashed, I launched the linker manually:
$ d:/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64//bin/arm-linux-androideabi-gcc -shared -Wl,-Bsymbolic -Wl,--version-script,libavcodec/libavcodec.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--fix-cortex-a8 --sysroot=d:/Dev/Android/ndk/platforms/android-9/arch-arm/ -isysroot d:/Dev/Android/ndk/platforms/android-9/arch-arm/ -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample #libavcodec/libavcodec.list -lswresample -lavutil -lm -lz -pthread -o libavcodec/libavcodec.so.55
I patch the library.mak file as follows: for $(SUBDIR)$(SLIBNAME_WITH_MAJOR), replace
$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
with
$(Q)echo >$(SUBDIR)lib$(NAME).list $(wordlist 1,400,$(filter %.o,$$<))
$(Q)echo >>$(SUBDIR)lib$(NAME).list $(wordlist 401,999,$(filter %.o,$$<))
$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) #$(SUBDIR)lib$(NAME).list $(FFEXTRALIBS)
.. and from there, make proceeded smoothly.
PS: I used make -n libavcodec/libavcodec.so.55 to prepare the response file libavcodec/libavcodec.list.
PPS: Here is another article that helps to build and use ffmpeg for Android.
You can use this as build_android.sh i tested it and it worked with me
#!/bin/bash
NDK=D:/android/ndk/android-ndk-r10d
SYSROOT=$NDK/platforms/android-8/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/windows
function build_one
{
./configure \
--prefix=$PREFIX \
--disable-shared \
--enable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
you need also to run this commands :
dos2unix build_android.sh
chmod +x build_android.sh
./build_android.sh
Use this Tutorial as reference
Build it on Ubuntu(Guest) and copy lib's(sub folder in /andoid-ndk/sources/ffmpeg/android) folder to Windows(Host).I tried it for Window but ended with lot of bugs, finally installed Ubuntu (Free) on virtualbox. also you willl have to download Andoid (SDK, Ndk) and JDK. This may sound weird but it worked for me.

Categories

Resources