-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Build FFmpeg with libfreetype (new FFmpegFrameFilter("drawtext=...")) #254
Comments
Hi there, Sorry for my question but have you got any workaround for this stuff? the problem: drawtext filter could not treated by FFmpegFrameFilter. How can i rebuild ffmpeg with --enable-libfreetype ? Thanks in advance |
@pisokelyrya No workaround, but a contribution would be very welcome. :) Add the |
Hi @saudet recorder = new FFmpegFrameRecorder(ffmpeg_link, imageWidth, imageHeight, 1);
recorder.setFormat("mp4");
recorder.setVideoCodec(avcodec.AV_CODEC_ID_MPEG4);
recorder.setFrameRate(n);
recorder.setVideoBitrate(800000);
recorder.setSampleRate(44100); |
Try the AV_CODEC_ID_H264 codec instead. |
it says codec not found! |
Use a build that contains that codec (x264). It is included in the binaries of version 1.1. |
As suggested, I am trying to build but I get an error. I have followed the instructions and added **id-arm/include/vpx/vpx_encoder.h If you think configure made a mistake, make sure you are using the latest I am compiling on Ubuntu 15.10 (64bit) and I am using latest Android NDK (11). I found this post |
You'll need to build libfreetype first |
In the meantime, I tried to compile also for x86 but still get the same error so I am unsure if it really related ARM. |
Check inside the cppbuild.sh script. You're going to see lines for other libraries. Now we need to do something similar for libfreetype, that's all. |
I am bit lost here...you mean I should add a download link for freetype and then in the platform-section of the script add a make-script part for libfreetype (like in the "ffmpeg-$FFMPEG_VERSION" section)? |
Yes, you got that right |
OK, I'm on it... |
Here it's getting tricky...(I have not arrived to the point of running the script yet): OK for creating a libfree-variable, adding the download-link and probably the extraction of the archive. If yes, then I will do that as a separate exercise and when I am successful and understood what I am doing, I will try to adapt it and paste it into the script. |
Yes, that's a good start, but we need it for Android as well, so base your commands on the |
I am wondering if something like this would work (I am afraid to test - lol)
but I think I am missing some variables... |
Edited previous post.. |
No luck: no more error Freetype2 not found but something that I am too tired to analyze now:
The reason is probably my Will try again tomorrow. |
BTW: if someone else would like to join to try to get this done, please let me know and I will paste my test-script on PasteBin.... |
Still trying but no luck although I am not sure what I am doing. This is more like "trial and error".... Tried this:
but now the original error |
Did the last try for now..but still no luck:
and once again the original error It seems like the first attempt was the best one. @saudet |
Well, it's not finding something like it wants it. Check the |
Found this page: [https://mortoray.com/2012/08/21/android-ndk-cross-compile-setup-libpng-and-freetype/]
Anyway in the config.log of freetype, I found errors about not finding input-files so I guess I am not using the right syntax in the configure-line or I am omitting some global enviroment variables from the script. I am pretty stuck. I will have a look at it again later on.... |
Sure! No problem. Thank for looking into this! |
Anyway, this was the last configure I tried:
and this is the Maybe you see something obvious, considering your experience.... |
BTW: it struck me that I had never built the project in its original form (i.e. without adding the freelib option) so I tried it and got this end:
I doubt very much it is related to my problems with compiling freetype but still it seems like I cannot compile the same. This error seems to be this line: Any idea? PS: by the way, when everything works, in which folder are the so-files generated? |
According to the log file, it looks like it wants bzip2. Is this a requirement for libfreetype? This is the kind of investigation that we need to do!
There's 2 sets of .so files, one generated by the cppbuild.sh scripts, and usually under cppbuild/platform/lib, but that depends, and the other set generated by JavaCPP is in the usual target/classes subdirectory. |
I am going to have a look at the following script I found and see if I can modify it for Android to start with: Other various sources mention that you need to create a symlink:
will check this when I have some time. |
just a doubt but when a build fails, can I just modify my cppbuild.sh script in the ffmpeg-folder and then re-run or do I need to do everything from the beginning (importing from git, mvn clean install etc)? |
Some libraries don't need cleaning, while some others do when we change the configuration... Each case is different, in many respects. It takes time to check all these details for each library. I don't have enough time on my own to do everything, so thank you for your help! |
Mine was just a general question since I don't know. I did't ask you to do it for me... |
I am sorry but this is well over my head. To learn this, I have read about configure, make, done numerous attempts etc but I cannot get it right. I can compile freetype using other examples I have seen but I am unable to get it working with the cppbuild.sh script here Sorry @saudet - I tried to do my best but it was in vain. Maybe someone else can get it working? If there was a wishlist for new features, I wish to add this one. |
Yeah, it takes a while to wrap one's head around all that stuff :( That's why I would love to have this project lift off at some point so that more non-C++ developers can easily access all those native libraries without fuss. In any case, could you post your latest modifications, in a fork maybe? And the error that you get and such? It might be something obvious, and I could help out right away, who knows. If it's just about the link, we can use |
@moster67 @saudet I am able to successfully rebuild ffmpeg for android with libfreetype enabled. What i found is that the pkg-config setting is missing in the build script for ffmpeg when the platform is android-arm . This setting is done in ffmpeg/cppbuild.sh for few other platforms, but not for android-arm. After copying pkg-config settings and following these instructions https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments, I am able to finally generate the required target folder with *jar and *.so files. Now can you kindly guide , how to incorporate these updated files into an existing android app based on javacv , javacpp and javacpp-presets. |
@tonymcodes Awesome! Please send a pull request: https://github.com/bytedeco/javacpp-presets/pulls |
@tonymcodes Hi, I am currently trying to build ffmpeg .so files with libfreetype enabled. I am searched 2 days but no result, can you share with me how to do this. I would appreciate it very much. |
Ok, so the main problem seems to be the build under android? I hope I can get the time to take the way @tonymcodes took. I already did this under cygwin (with "raw" ffmpeg and the provided freetype libs), so it should be doable. |
Just send a pull request and it will get built by Travis CI. No need to build anything by yourself! |
If it's not possible to get it working with Android, let's start with the other platforms, that's fine. |
See bytedeco/javacpp-presets#452 (or https://github.com/mifritscher/javacpp-presets/tree/freetype, which is the branch for this) for my first shot. Feel free to improve it :-) |
Builds on all plattforms on travis and on my crude Windows build environment. Feel free to test :-) |
Thanks a lot to @mifritscher we now have SNAPSHOT builds with FreeType, so please let me know if you have any problems with them. Thanks! |
JavaCV 1.4 now comes with a version of FFmpeg built with libfreetype. |
But when i call FFmpegFrameFilter.start(), it fails.
I had discuss with saudet about this problem in issue #164. He said we would need to build FFmpeg with libfreetype.
Thanks
The text was updated successfully, but these errors were encountered: