Open ghost opened 2 years ago
change it at your will, organize it, make it cleaner, its all yours
This is great! I can test with this a bit (I have an Android device) and if it works well I can make a pull request to add it (which should give you credit).
This is great! I can test with this a bit (I have an Android device) and if it works well I can make a pull request to add it (which should give you credit).
thats great!, the bad thing is that it looks like we cant use openssl without compiling openssl
just add the ndk llvm toolchain path to NDK_DIR in the script and it should be working
Hows it going?
@Randomxdp I attempted to adapt the script to build to Android from a Linux machine and encountered this error:
~/Documents/Programming/Haxe/extension-ffmpeg/lib.src/ffmpeg ~/Documents/Programming/Haxe/extension-ffmpeg/lib.src
~/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang is unable to create an executable file.
C compiler test failed.
Here is the script I wrote: https://github.com/MasterEric/extension-ffmpeg/blob/build/android/lib.src/build_linux2android64.sh
I'm not sure what the root issue is, but I will note that the documentation for Lime clarifies that NDK r15c (and no later) must be used to compile for Android. Further research indicates the reason being that r16 removes G++ support (and only includes the Clang compiler). Will have to test further, but if you happen to have access to a Linux machine than experimentation from you would be greatly appreciated.
To the best of my knowledge, as long as SOMEONE can successfully generate an NDLL, that NDLL can be redistributed, and only needs to be rebuilt if the code in the project/common
folder is updated (which at this stage in development is sadly going to be frequent), and the NDLL does not need rebuilding if the Haxe code updates.
@Randomxdp I attempted to adapt the script to build to Android from a Linux machine and encountered this error:
~/Documents/Programming/Haxe/extension-ffmpeg/lib.src/ffmpeg ~/Documents/Programming/Haxe/extension-ffmpeg/lib.src ~/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang is unable to create an executable file. C compiler test failed.
Here is the script I wrote: https://github.com/MasterEric/extension-ffmpeg/blob/build/android/lib.src/build_linux2android64.sh
I'm not sure what the root issue is, but I will note that the documentation for Lime clarifies that NDK r15c (and no later) must be used to compile for Android. Further research indicates the reason being that r16 removes G++ support (and only includes the Clang compiler). Will have to test further, but if you happen to have access to a Linux machine than experimentation from you would be greatly appreciated.
To the best of my knowledge, as long as SOMEONE can successfully generate an NDLL, that NDLL can be redistributed, and only needs to be rebuilt if the code in the
project/common
folder is updated (which at this stage in development is sadly going to be frequent), and the NDLL does not need rebuilding if the Haxe code updates.
Hmm thats weird, i tried my script on windows and on termux using the r23c ndk which you should be able to download standalone (for termux i got one with llvm compiled for aarch64) and both worked, you should also look at the build log to find some clues
Also if we wanted to make it use gcc the script would need a rewrite to work with gcc
But since fnf android workflows work just fine with ndk r21e i think it would not be necessary
But since fnf android workflows work just fine with ndk r21e i think it would not be necessary
I don't understand that since the documentation (and forums) say that Lime can't build with r16 or later. Please experiment though.
I will note that getting lime rebuild extension-ffmpeg android
to complete is not an insignificant step. Please try to get that tested if you can.
I don't understand that since the documentation (and forums) say that Lime can't build with r16 or later. Please experiment though.
That isnt on the docs but it looks like it can build with ndk r21e with github actions, take a look at this run for example
I will note that getting lime rebuild extension-ffmpeg android to complete is not an insignificant step. Please try to get that tested if you can.
I know how important it is to test that and i will as soon as i can
after some testing ndk r21e is the latest one that can work with lime without issues and also work with the script correctly, i also tried building the extension, but since i dont know how to mod build.xml it dropped some errors, all i would need is you to add support for android in build.xml in the project folder
after some testing ndk r21e is the latest one that can work with lime without issues and also work with the script correctly, i also tried building the extension, but since i dont know how to mod build.xml it dropped some errors, all i would need is you to add support for android in build.xml in the project folder
Can you report on what errors are occurring? I can't test the Android build because I don't have FFmpeg built yet.
I have made some progress by creating a new build script based of this one, as well as running make clean
before the build step.
https://gist.github.com/begeekmyfriend/6aa63a4d434daa53e7e8a6ff8ab6a00a
Will let you know how things progress and if I can create a build.
the error is: Please set one of the architectures, eg HXCPP_ARM64, HXCPP_X86, ...
after some testing ndk r21e is the latest one that can work with lime without issues and also work with the script correctly, i also tried building the extension, but since i dont know how to mod build.xml it dropped some errors, all i would need is you to add support for android in build.xml in the project folder
the error is: Please set one of the architectures, eg HXCPP_ARM64, HXCPP_X86, ...
One thread I found mentioned they solved it by installing and using NDK15
When I use NDK15, I get the following error that I haven't been able to solve (might have different results on Windows):
../lib.src/ffmpeg/libavutil/timer.h:38:31: fatal error: linux/perf_event.h: No such file or directory
include <linux/perf_event.h>
the error is: Please set one of the architectures, eg HXCPP_ARM64, HXCPP_X86, ...
One thread I found mentioned they solved it by installing and using NDK15
When I use NDK15, I get the following error that I haven't been able to solve (might have different results on Windows):
../lib.src/ffmpeg/libavutil/timer.h:38:31: fatal error: linux/perf_event.h: No such file or directory
include <linux/perf_event.h>
after puting in the r15c ndk the previous error was gone but now we have a new one (on windows)
the error is that it basically cant find any of the .h files in your repo for some reason ( like common/Codec.h, common/Core.h, etc ) , im gonna try seeing whats the issue and i will keep you updated
the error is: Please set one of the architectures, eg HXCPP_ARM64, HXCPP_X86, ...
after some testing ndk r21e is the latest one that can work with lime without issues and also work with the script correctly, i also tried building the extension, but since i dont know how to mod build.xml it dropped some errors, all i would need is you to add support for android in build.xml in the project folder
When you rebuild at the end of android put -DHXCPP_ARM64
To fix that issue
the error is: Please set one of the architectures, eg HXCPP_ARM64, HXCPP_X86, ...
after some testing ndk r21e is the latest one that can work with lime without issues and also work with the script correctly, i also tried building the extension, but since i dont know how to mod build.xml it dropped some errors, all i would need is you to add support for android in build.xml in the project folder
When you rebuild at the end of android put -DHXCPP_ARM64
k
the error is: Please set one of the architectures, eg HXCPP_ARM64, HXCPP_X86, ...
after some testing ndk r21e is the latest one that can work with lime without issues and also work with the script correctly, i also tried building the extension, but since i dont know how to mod build.xml it dropped some errors, all i would need is you to add support for android in build.xml in the project folder
When you rebuild at the end of android put -DHXCPP_ARM64
that made ndk r21e work just fine
Just use r21e then
Just use r21e then
i built ffmpeg and tried to build extension-ffmpeg using ndk r21e but got .h error
Hi , i have been doing a script (using your build_linux64 script as a base) to build the ffmpeg libs for android, here it is if its usefull to you (yes i tested it with ndk r23c)
https://github.com/Randomxdp/extension-ffmpeg/blob/master/lib.src/build_android64.sh
i didnt test building the extension yet but take this script that builds the ffmpeg libs for android