2017-09-14 61 views
0

我已經使用下面的命令從默認相機最初捕獲的裁剪視頻。但是當我執行命令時,它會給出下面的錯誤。想使用ffmpeg以1:1的方式裁剪視頻,但它會給出錯誤工作目錄:null環境:null

final String[] cmd={"-i", "/storage/emulated/0/DCIM/ZyfVideo/VID_20170914_153804.mp4","-s", "480x480" ,"-vf" ,"crop=480:480","setdar=1:1","setsar=1:1 ","/storage/emulated/0/Movies/SpoofApp/VDO_20170914_153811.mp4"}; 

錯誤的logcat:

09-14 15:38:11.874 3872-4039/com.spoof.app E/FFmpeg: Exception while trying to run: [Ljava.lang.String;@427ce088 
                java.io.IOException: Error running exec(). Command: [/data/data/com.spoof.app/files/ffmpeg, -i, /storage/emulated/0/DCIM/ZyfVideo/VID_20170914_153804.mp4, -s, 480x480, -vf, crop=480:480, setdar=1:1, setsar=1:1 , /storage/emulated/0/Movies/SpoofApp/VDO_20170914_153811.mp4] Working Directory: null Environment: null 
                 at java.lang.ProcessManager.exec(ProcessManager.java:211) 
                 at java.lang.Runtime.exec(Runtime.java:173) 
                 at java.lang.Runtime.exec(Runtime.java:128) 
                 at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10) 
                 at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38) 
                 at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10) 
                 at android.os.AsyncTask$2.call(AsyncTask.java:288) 
                 at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                 at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
                 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                 at java.lang.Thread.run(Thread.java:841) 
                 Caused by: java.io.IOException: No such file or directory 
                 at java.lang.ProcessManager.exec(Native Method) 
                 at java.lang.ProcessManager.exec(ProcessManager.java:209) 
                 at java.lang.Runtime.exec(Runtime.java:173)  
                 at java.lang.Runtime.exec(Runtime.java:128)  
                 at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10)  
                 at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)  
                 at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)  
                 at android.os.AsyncTask$2.call(AsyncTask.java:288)  
                 at java.util.concurrent.FutureTask.run(FutureTask.java:237)  
                 at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)  
                 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  
                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  
                 at java.lang.Thread.run(Thread.java:841)  
+0

檢查你的路徑是否正確。錯誤說明由於:java.io.IOException:沒有這樣的文件或目錄 –

+0

@KingofMasses輸入視頻和輸出視頻的路徑?但它是正確的。 – Mahesh

+0

@KingofMasses版本4.4.2 samsung標籤 – Mahesh

回答

0

我對ffmpeg的沒有這樣的想法,但我可以告訴你jCodec LIB這是很容易使用。

訪問jcodec.org。

如果你想裁剪的視頻,你將不得不在下面的步驟在Android或Java。 1.從jcodec中獲取實用程序方法的框架。 2.使用位圖幫助器類進行裁剪。 3.使用jcodec實用程序功能打包成mp4格式。

,如果你不能夠做​​到這一點好心寫郵件給我[email protected]

我將有助於使作物視頻應用爲你的機器人。

謝謝

相關問題