Closed Kadanza closed 5 years ago
problem was in my code. I use loop and execute ffmpeg. For decide this problem need use CountDownLatch
```
val latch = CountDownLatch(1)
task = ffmpeg.execute(cmd, object : ExecuteBinaryResponseHandler() {
override fun onStart() {
}
override fun onProgress(msg: String?) {
this@FfmpegExecuter.msg = msg ?: ""
if(onlyComplite){
it.onNext( this@FfmpegExecuter)
}
}
override fun onFailure(msg: String?) {
latch.countDown()
if(msg?.contains("This is wasting memory and prevents security hardening.") != true ){
it.onError( Error("$msg"))
ffmpeg.killRunningProcesses(task)
}
}
override fun onSuccess(message: String?) {
this@FfmpegExecuter.msg = msg ?: ""
loaded = true
it.onNext( this@FfmpegExecuter)
it.onComplete()
}
override fun onFinish() {
latch.countDown()
d()
}
})
latch.await()
Task android.os.AsyncTask$3@ccbb611 rejected from java.util.concurrent.ThreadPoolExecutor@65be376[Running, pool size = 5, active threads = 5, queued tasks = 128, completed tasks = 12]
My command for ffmpeg
val cmd = arrayOf("-ss", "$start", "-t", "${end - start}", "-y", "-i", pathWav , "-safe", "0", "-loglevel", "error", temp.absolutePath)
problem here
"nl.bravobit.ffmpeg.FFmpeg.execute(FFmpeg.java:117)"
StackTrace