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
Fontconfig error: Cannot load default config file #18
Comments
@dominicthomas do check the instructions |
@hiteshsondhi88 Thanks for responding. Since posting the question I've double checking what is included in the ffmpeg_build.sh. I can see that all the required font libraries are enabled. However it is unclear to me how to follow the instructions relating to fontconfig. Just to confirm, Is the instruction to set an environment variable before compilation, with a path of a yet to exist fonts.conf file, decided in advance? Any clues on what should be in the fonts.conf file? Many thanks |
@dominicthomas You can check sample fontconfig files here - https://wiki.archlinux.org/index.php/Font_configuration#Example_fontconfig_configurations |
Thanks. Also, given the error I received, I realised I'd forgotten the = after fontfile in the command arguments. Command completes successfully now but haven't been to able to create a playable video yet. |
@hiteshsondhi88 Hi, I'm having a problem with "-vf subtitles" option for android ffmpeg. I have set the FONTCONFIG_FILE variable and indeed ffmpeg does not complain. Nevertheless the produced mp4 does not have any subs. I tried with attached fonts.conf file. Any suggestions? |
@hiteshsondhi88 never mind resolved, it was actually a silly question. attached a android working fonts.conf, pointing to /system/fonts. Only issue is that ffmpeg try to use Arial and falls back to something else, but that's totally ok. Maybe I can put arial.ttf in my app and set a different dir for the font. |
@hiteshsondhi88 Hi! I have compiled ffmpeg with FONTCONFIG_FILE provided, and I successfully run with adb run-as my_package Have any suggestions? |
Removed double quotes in |
How to use this |
I am using one of the prebuilt binaries in my project and am trying to draw text over a video file.
I am executing the process using a complex command in the form of a String[] instead of converting an ArrayList to a one command string. I had to do this to allow for the use of complex filters as having single or double quotes in a single string command doesn't work.
The binaries compiled claim to include libfreetype and libfribidi. The documentation for drawtext (http://ffmpeg.org/ffmpeg-filters.html#drawtext-1) says that libfontconfig also needs to be included to enable the font feature and the default font fallback feature.
This seems like a catch 22 as if you don't want include a font, ffmpeg has no way of falling back to a default.
Can you let me know if libfontconfig should be included and if not, would it be possible to make a prebuilt binary with it enabled? (I'd do it myself but am having trouble compiling)
Here is the complex command I am running:
final String[] complexCommand = {mFfmpegBin, "-i", inClip.path, "-vf", "drawtext=enable='between(t, 0, 3)':fontfile" + fontPath + ":text='Text to write is this, overlaid':fontsize=20:fontcolor=red:x=100:y=100", "-y", mediaOut.path};
Here is the shell output:
I/System.out﹕[Parsed_drawtext_0 @ 0xb5864420] Could not load font "(null)": invalid argument
I/System.out﹕ Fontconfig error: Cannot load default config file
I/System.out﹕ [Parsed_drawtext_0 @ 0xb5864420] Cannot find a valid font for the family Sans
I/System.out﹕ [AVFilterGraph @ 0xb5868080] Error initializing filter 'drawtext' with args 'enable=between(t, 0, 3):text=Text to write is this, overlaid:fontsize=20:fontcolor=red:x=100:y=100'
I/System.out﹕ Error opening filters!
Thanks
The text was updated successfully, but these errors were encountered: