I am using this FFMPEG library,
first I am playing the video inside my videoView to make sure that the video path is correct
videoView.setVideoURI(Uri.parse(getExternalFilesDir(null)?.absolutePath + "videoToBeEdit"))
then I am calling the code written below to crop the video then put it inside the videoView again just to see the result
val ff = FFmpeg.getInstance(this@EditVideoActivity)
if (ff.isSupported){
val inFile = File(getExternalFilesDir(null)?.absolutePath ,"videoToBeEdit")
val outFile = File(getExternalFilesDir(null)?.absolutePath , "result")
val command = arrayOf("ffmpeg","-i", inFile.absolutePath , "-filter:v", "crop=100:100:0:0", outFile.absolutePath)
ff.execute(command, object : ExecuteBinaryResponseHandler() {
override fun onSuccess(message: String?) {
super.onSuccess(message)
videoView.setVideoURI(Uri.parse(getExternalFilesDir(null)?.absolutePath + "videoToBeEdit"))
}
override fun onProgress(message: String?) {
super.onProgress(message)
}
override fun onFailure(message: String?) {
super.onFailure(message)
Log.e("error", "failed")
}
override fun onStart() {
super.onStart()
Log.e("start", "started the process")
}
override fun onFinish() {
super.onFinish()
Log.e("finish", "done")
}
})
}
but my code above goes from start to error then finish, it doesn't show any error messages and that's making it really hard to know what's actually wrong :( I tried to write my command in different ways following those tutorials tutorial1 tutorial2 link please help, thank you in advance...
-reportoption to ffmpeg command. Look for log file. If there is no log file then ffmpeg did not execute and the problem is elsewhere.