0

I'm using the precompiled FFmpeg-Android by Bravobit (via gradle: implementation 'nl.bravobit:android-ffmpeg:1.1.5'; based on WritingMind's) with the intention of drawing the current timestamp/location onto a .mp4 file. I am completely new to FFmpeg and have started with Android Studio a few months ago.

Information:

  • IDE: Android Studio
  • OS: OSX 10.13.5

My problem:

I don't know whether the fontfile needs to be in the Application path on my Phone, in the Android Studio directory or just on a location on my MacBook (so it gets compiled when running the application).

Basic FFmpeg commands (-version, ...) are working, but I can't seem to figure out where I have to place my fontfile.

My current command is as follows:

-i /path/to/video.mp4 -vf drawtext=fontfile=/users/shared/fonts/arial.ttf:text='Hello World' /path/to/output.mp4

I've tried a lot of variations and always received to following errors:

Fontconfig error: Cannot load default config file [Parsed_drawtext_0 @ 0xecbfd420] impossible to init fontconfig [AVFilterGraph @ 0xec9cc140] Error initializing filter 'drawtext' with args 'fontfile=/users/shared/fonts/arial.ttf:text=Hello World' Error reinitializing filters! Failed to inject frame into filter network: Unknown error occurred Error while processing the decoded data for stream #0:0 Conversion failed!

Does anyone have a suggestion on how to get this to work?

jpgerh
  • 1
  • 1
  • 2
  • Change `arial.ttf :text` to `arial.ttf:text`. – llogan Jun 13 '18 at 17:41
  • My bad. That was just a mistake while writing this question. – jpgerh Jun 18 '18 at 07:30
  • 1
    I have the same problem with this command: String[] cmd = {"-y" , "-i","input.mp4, "-vf", "drawtext=fontfile=/usr/share/fonts/TTF/Vera.ttf: text=\'Stack Overflow\': fontcolor=white: fontsize=24: box=1: boxcolor=black: x=(w-text_w)/2: y=(h-text_h-line_h)/2", "-acodec:", "copy", "output.mp4"}; – user3884677 Oct 05 '18 at 08:19

0 Answers0