2016-06-02 17 views
0

Ich habe https://github.com/WritingMinds/ffmpeg-android-java auf meinem Android-Studio zusammengestellt und es funktioniert gut, habe ich diese drei Befehle erfolgreich ausgeführt:mehrere Befehle auf FFMPEG mit Android Studio

Hinzufügen von Text:

new String[]={"-i",file1.toString(), "-i", water,"-filter_complex","drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-tw)/2:y=(50-th)/2", final_output} 

Wasserzeichen hinzufügen:

new String[]{"-i",inputVideoFilePath, "-i",overlayImagePath,"-preset", "ultrafast","-filter_complex", "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2", "-codec:a", "copy", outputVideoFilePath 

Add Padding:

new String[]{"-i",file1.toString(), "-i", water,"-filter_complex","[0:v]pad=iw:ih+100:0:(oh-ih)/2:color=white", final_output2}; 

Jetzt möchte ich diese drei kombinieren, wie mache ich das? Bisher habe ich versucht, Polsterung mit dem Text:

new String[]{"-i",file1.toString(), "-i", water,"-filter_complex","[0:v]pad=iw:ih+100:0:(oh-ih)/2:color=white","drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-tw)/2:y=(50-th)/2", final_output2}; 

Aber ich bekomme diese Fehlermeldung:

Input #1, png_pipe, from '/storage/emulated/0/watermark.png': 
Duration: N/A, bitrate: N/A 
Stream #1:0: Video: png, rgb24(pc), 200x125, 25 tbr, 25 tbn, 25 tbc 
[NULL @ 0xb5c9fc00] Unable to find a suitable output format for 
'drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text AAAA:x=(w-tw)/2:y=(50-th)/2' 
drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-tw)/2:y=(50-th)/2: Invalid argument 

Jede Art von Hilfe wäre toll!

Antwort

0

Ich konnte es selbst lösen, für die Menschen, um die gleiche Frage fragen, wie es komplex war, hier geht:

new String[]{"-i",file1.toString(),"-filter_complex", "[0:v]pad=iw:ih+200:0:(oh-ih)/2:color=white[v0];[v0]drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=black:text=THIS IS:x=(w-tw)/2:y=(50-th)/2[v1];[v1]drawtext=fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=black:text=SPARTA!:x=(w-tw)/2:y=h-25-(th/2)", 
           "-acodec", "copy", final_output2}; 
0

Sie können Text, Wasserzeichen und padding Befehl folgende für das Hinzufügen von: -

   " -i "+VideoPathonSdCard+" -i "+ImagePath+" -metadata:s:v rotate=0 -filter_complex vflip,transpose=0,overlay=(W-w)/2:(H-h)/2,pad=iw:ih+100:0:(oh-ih)/2:color=white,drawtext=fontsize="+TextSize+":fontfile=/system/fonts/DroidSans.ttf:fontcolor="+hexColor+":text="+ Text+":x="+x+":y="+y+"+40 -y -preset ultrafast -strict -2 "+VideoAfterEdit_Path; 
+0

Danke für die Antwort, lassen Sie mich diese –

+0

versuchen es nicht funktioniert, Eigentlich möchte ich ein Code auf android laufen .. können Sie einen einfachen Befehl geben ein laufen zwei Filter zusammen wie zwei Bild-Overlay auf Video? –