Open
Description
When i run a command with ffmpeg.execute() inside the FFmpegExecuteResponseHandler onProgress() method when i call ffmpeg.isFFmpegCommandRunning() it's returning false.
Also killRunningProcesses() is not working, because when i execute and run this method it always return false
Could you please conside a fix please? Thanks
Activity
JayParikh20 commentedon Mar 18, 2016
Hey, you could try using this code.
I have tried this, and it works successfully.
for example - you can make toast in catch block ," that ffmpeg is Already running".
Hope this helps.
FFmpeg ffmpeg = FFmpeg.getInstance(context);
try {
// to execute "ffmpeg -version" command you just need to pass "-version"
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@OverRide
public void onStart() {}
});
} catch (FFmpegCommandAlreadyRunningException e) {
//Do somthing
}
SebSob commentedon Mar 18, 2016
Ok yes, that could be a possible workaround thanks. But what if i want to stop the current process (for example in the onDestroy() method)?
JayParikh20 commentedon Mar 19, 2016
Let's assume the ffmpeg command was executed and was in progress
OnProgress function will be called again and again (try adding toast , to cross check)
So workflow around this can be
you add a if statement inside Onprogress function(to check kill conditions )
Now if condition is true
you call
ffmpeg.killRunningProcesses();
sam7700 commentedon Mar 20, 2016
I'm having the same issue, that workaround will not work, as the issue is in killRunningProcesses() itself (don't work no matter what or where is called)
JayParikh20 commentedon Mar 21, 2016
well,that's weird.let me check!
sam7700 commentedon Mar 21, 2016
I manage to have it work by recompiling the aar from the sources - this means the patch is actually already there but not in the gradle or the public build on the site ( it's actually in this state from quite a while: #3 )
JayParikh20 commentedon Mar 22, 2016
@sam7700 Nice Catch!
How did you manage to get master source in android studio and get same result as Compiling Gradle?
i mean compiling with gradle is easy, how can i download it from Github and then add it in android Studio?
sam7700 commentedon Mar 22, 2016
Just get the source, import in android studio and then run a build, you will find the aar generated under FFmpegAndroid/build/outputs/aar/ - I was prepared to get some some dependency hell but all went smooth
JayParikh20 commentedon Mar 22, 2016
haha, thanks!
ruha9005 commentedon Apr 8, 2016
Version 0.2.5. FFmpeg.java
@Override public boolean isFFmpegCommandRunning() { return ffmpegExecuteAsyncTask != null && ffmpegExecuteAsyncTask.isProcessCompleted(); }
akashpopat commentedon Apr 18, 2016
@sam7700 can you provide the aar ?
vxhviet commentedon May 10, 2016
Is this issue still in 0.3.2? I'm trying to re run my command multiple time but it always end up with FFmpeg already running.
I'm trying to run this command:
I can replicate this with the demo as well. Try running this command:
Then re run with a different output's name:
It behave as expected with 2 different output files. But if you accidentally run any of those command twice then nothing happen for the next run even if you change the output's name.
shubhamvishnoi-kiwi commentedon May 12, 2016
I am also facing the same problem like vxhviet mentioned.
vxhviet commentedon May 12, 2016
Just using sam7700 solution:
And that's the release.aar
For the "accidentally running it twice" just need to pass
-y
to the command (-y means overwriting file, consult ffmpeg document for better example).shubhamvishnoi-kiwi commentedon May 12, 2016
Hi vxhviet,
using -y option solved my problem
Thanks.
mikexing2010 commentedon May 12, 2017
I think still a problem on gradle today. Need to resort to compile from source code option.
Ashutosh-Tiwari commentedon Jan 9, 2018
@sam7700 @JayParikh20 I am having the same issue with
killRunningProcesses()
, and following what you two discussed also didn't help me. Please guide me on this.Whenever I execute a process it ends up moving in the catch block where I have written this:
When
killRunningProcesses()
gets called, my app crashes:@hiteshsondhi88 Can you please help me on this please?
tutysathish commentedon Oct 3, 2018
Is there any workaround is available for this problem?