ffshare icon indicating copy to clipboard operation
ffshare copied to clipboard

FFmpegKit Deprecation Impact on FFShare: Seeking Guidance

Open Caballosanex opened this issue 4 months ago • 3 comments

Hi @caydey 👋 As you are aware, FFmpegKit has been officially retired as of January 6, 2025, with all binaries scheduled for removal by April 1, 2025. This directly impacts FFShare's functionality since the app relies on this library.

I'm a user of FFShare and would like to help ensure it continues working. I have Android development experience, and i am willing to invest time in researching and implementing a solution, but I'd appreciate your guidance on the best path forward. Furthermore, I have some questions for you, if you don't mind:

Are you currently working on a solution to address the FFmpegKit deprecation? If so, could you share your approach or timeline?

If, otherwise, you're not actively working on this, do you have any insights or recommendations about:

  • Alternative libraries that could replace FFmpegKit (That support FFmpeg 7.1 if possible. This is because FFShare could really benefit from newer versions of FFmpeg)
  • Approaches that might work well with FFShare's current architecture
  • Any specific challenges or requirements I should be aware of

I originally was thinking about forking and proposing a PR when i had a working solution, but i find myself working on multiple projects, and it would really help me if you could answer those questions so i can spend less time researching blindly.

Thanks for creating such a useful tool, and I hope we can find a way to keep it alive!

Caballosanex avatar Aug 05 '25 08:08 Caballosanex

I have not been making any contributions to this project due to my work taking priority and the FFmpegKits deprecation has been a huge blow halting all progress. I appreciate your willingness to help, I feel that a good way forward would be to build a custom FFmpeg binary interfaced with through JNI, however with little examples of this being done it will be a challenging task especially since it will also require files to be inputted and outputted.

I'll have a try at this over the weekend and report back any progress

caydey avatar Aug 05 '25 20:08 caydey

Not made much progress, the JNI stuff is along with creating an android compatible build of ffmpeg along with all correct codecs is proving alot more challenging that thought, I've linked below some of the resources used.

Building ffmpeg binaries https://github.com/cropsly/ffmpeg-android-java, https://github.com/Javernaut/ffmpeg-android-maker

Jni stuff https://github.com/Javernaut/ffmpeg-android-maker/issues/106, https://github.com/cropsly/ffmpeg-android-java, https://medium.com/@nguyenhiepav/compiling-ffmpeg-for-android-and-create-jni-wrapper-using-ndk-build-6b6849fa51f5

caydey avatar Aug 10 '25 20:08 caydey

I was actually already thinking about using Javernaut's script for this exact problem and did some research on it. It's definitely the right direction you're going in.

The main issue you're probably running into is trying to wrap the entire FFmpeg API through JNI, which is honestly a nightmare. After looking into this more, there's a much simpler approach that works really well at first glance. Instead of exposing all the FFmpeg functions, you just create a thin JNI wrapper around FFmpeg's main function.

My guess would be to keep using Javernaut's script to build the FFmpeg libraries, then create said minimal JNI function for testing. calls ffmpeg_main with argc and argv, pass your existing FFmpeg command strings from Java to this function, and copy the built .so files to your jniLibs folder. Javernaut actually provides a Docker image that handles all the messy dependencies if you want to test.

I'll try to start with this for testing. If I get basic FFmpeg commands working, we can track progress and figure out any remaining issues.

I'll report back when I give it a shot.

Caballosanex avatar Aug 10 '25 23:08 Caballosanex