ffmpeg-android-java icon indicating copy to clipboard operation
ffmpeg-android-java copied to clipboard

Memory leak fixes and proper killing of processes

Open diegoperini opened this issue 8 years ago • 3 comments

I managed to fix some of the common issues on my fork, leaking Context and non working kill command to be specific.

Steps to install if this doesn't get merged:

  1. Edit your project's build.gradle (not app) like this. (important line is jitpack)
allprojects {
    repositories {
        jcenter()
        mavenCentral()

        ...

        maven {
            url 'https://jitpack.io'
        }
    }
}
  1. Add below line to your app's build.gradle dependencies.

compile 'com.github.diegoperini:ffmpeg-android-java:v0.4.6'

Link for the fork: https://github.com/diegoperini/ffmpeg-android-java

Changelog:

  1. Added whenFFmpegIsReady() to properly wait for ffmpeg state.
  2. Fixed killRunningProcesses() to properly kill the execution.
  3. Added a FFmpeg.getInstance() overload to work with a ContextProvider instead of a context. It is a fix for a common memory leak caused by storing the context internally. Old factory method is still supported but marked as deprecated.

diegoperini avatar Jul 20 '17 09:07 diegoperini

nice :)

pedromalta avatar Nov 23 '17 21:11 pedromalta

How do you instantiate correctly the ffmpeg(FFmpeg.getInstance())?

pedromalta avatar Nov 23 '17 22:11 pedromalta

https://github.com/WritingMinds/ffmpeg-android-java/issues/107#issuecomment-324685367

Here is the example.

diegoperini avatar Nov 24 '17 12:11 diegoperini