[英]Error while creating video with images using ffmpeg
我正在使用以下命令使用多個圖像創建視頻
String strCommand = "ffmpeg -loop 1 -t 3 -i " + picturePath +
" -loop 1 -t 3 -i " + picturePath1 +
" -loop 1 -t 3 -i " + picturePath2 +
" -loop 1 -t 3 -i " + picturePath3 +
" -filter_complex [0:v]trim=duration=3,
fade=t=out:st=2.5:d=0.5[v0];
[1:v]trim=duration=3,fade=t=in:st=0:d=0.5,fade=t=out:st=2.5:d=0.5[v1];
[2:v]trim=duration=3,fade=t=in:st=0:d=0.5,fade=t=out:st=2.5:d=0.5[v2];
[3:v]trim=duration=3,fade=t=in:st=0:d=0.5,fade=t=out:st=2.5:d=0.5[v3];[v0]
[v1][v2][v3]concat=n=4:v=1:a=0,format=yuv420p[v] -map [v] -preset ultrafast
" + videoPath;
然后我執行qwery
String[] mycommand = strCommand.split(" ");
execFFmpegBinary(mycommand );
但是我在執行時遇到錯誤,我嘗試了很多,但沒有成功。
我寫了一個回復,因為我無法評論。 我認為您使用的是http://writingminds.github.io/ffmpeg-android-java/,因為我遇到了類似的問題。
檢查我們的問題是在您的String strCommand
,哪些參數沒有用空格“”分隔。 您可以像這樣直接嘗試創建String []完整命令
例如:
String [] cmd = {"arg0", "arg1", "arg2", "arg3", ... ... ... }
或您的情況:
String [] cmd = {"-loop", "1", "-t", "3", ... ... ... }
每個arg必須是cmd []中的單個元素。
希望對您有所幫助。
編輯 :也要注意“ ffmpeg”初始標簽。 它可能是隱式的,然后被識別為arg:嘗試將其忽略。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.