bravobit / FFmpeg-Android

FFMpeg/FFprobe compiled for Android
https://bravobit.nl/
MIT License
739 stars 175 forks source link

Error initializing filter 'drawtext' with args in Android #70

Closed totofe closed 5 years ago

totofe commented 5 years ago

Getting error while trying to draw text on video.

Fontconfig error: Cannot load default config file [Parsed_drawtext_0 @ 0xb5391300] impossible to init fontconfig [AVFilterGraph @ 0xb5409040] Error initializing filter 'drawtext' with args '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' 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!

my 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"};
Brianvdb commented 5 years ago

The font file path is wrong.

totofe commented 5 years ago

what is the right file path please?

totofe commented 5 years ago

I am lost. can you explain me the process to make a drawtext?

manishmips commented 4 years ago

Anyone have solution for android .I have tried may ways but never got success

manishmips commented 4 years ago

String cmd="-i "+input+" -vf drawtext=fontfile="+font+":text='Stack OverFlow' -y -c:v libx264 -c:a copy -movflags +faststart "+output+"";