0

I download ffmpeg static from http://ffmpeg.gusari.org/static/ and I run command

./ffmpeg -i inputFile.mp4 -vf drawtext="fontsize=60:fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-ascent" outputFile.mp4 

it work fine on my desktop. I want to use this command to run in android. I copy ffmpeg file to my android app to run command but it not work.

public ProcessRunnable create() { if (inputPath == null || outputPath == null) { throw new IllegalStateException("Need an input and output filepath!"); } final List<String> cmd = new LinkedList<String>(); public ProcessRunnable create() { if (inputPath == null || outputPath == null) { throw new IllegalStateException("Need an input and output filepath!"); } final List<String> cmd = new LinkedList<String>(); cmd.add(mFfmpegPath); cmd.add("-i"); cmd.add(inputPath); cmd.add("-vf"); cmd.add("drawtext=\"fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-a cmd.add(mFfmpegPath); cmd.add("-i"); cmd.add(inputPath); cmd.add("-vf"); cmd.add("drawtext=\"fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-ascent\""); cmd.add(outputPath); Log.w("Command", cmd.toString()); final ProcessBuilder pb = new ProcessBuilder(cmd); return new ProcessRunnable(pb); } 

please tell me know "How can I do that?" thanks so much

0

1 Answer 1

2

Remove \" from your code, like this:

cmd.add("drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-ascent"); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.