Stop/cancel execution of FFmpeg command

2019-03-06 14:45发布

问题:

There is FFmpeg Static (binary) available for Android and we can stop/cancel some FFmpeg execution (command) while it's doing something https://github.com/WritingMinds/ffmpeg-android-java/issues/33

But I want to use FFmpeg shared libraries and JNI, I found next library https://github.com/IljaKosynkin/FFmpeg-Development-Kit (it works ok)

But there is no option to stop execution of FFmpeg command (or killing the process)

We use Java native run method there to start execute some command:

Java: https://github.com/IljaKosynkin/FFmpeg-Development-Kit/blob/master/JNI/app/src/main/java/com/example/ilja/jni/VideoKit.java#L57

and then in C we call FFmpeg's main method:

C: https://github.com/IljaKosynkin/FFmpeg-Development-Kit/blob/master/JNI/app/jni/videokit.c#L41

How can I stop/cancel some FFmpeg executing after I called Java run and C main methods?

回答1:

the solution is to edit ffmmpeg class (add some variables to check if it should execute farther or not)