2017-09-14 1 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をご覧ください。

あなたがアンドロイドまたはjavaのステップの下で行う必要があるビデオをトリミングする場合は、 1. jcodecからユーティリティメソッドからフレームを取得します。 2.ビットマップヘルパークラスを使用してクロップします。 3. jcodec utilty関数を使用してmp4形式でパックします。

あなたがこれを行うことができない場合は、親切に私にメールを書く[email protected]

私はアンドロイドであなたのための作物のビデオアプリケーションを作るのに役立ちます。

ありがとうございます

関連する問題