Using ffmpeg libraries in android native project - android

In my native android project I need to reduce a size of video file.
I've already built ffmpeg libraries for android.
How do I init ffmpeg libraries in my project and how to reduce video size without calling to ffmpeg in android command line.
Thanks in advance!

Related

Reduce apk size when using ffmpeg

I am building an app that can trim a video into multiple segments , for that purpose i have used ffmpeg library
This command does all the work
ffmpeg -i testfile.mp4 -c copy -f segment -segment_time 1200 testfile_piece_%02d.mp4
But including this library increased my app size upto ~45 mb
I want to reduce my apk size
I want help in
Deleting non required libs like x86 , x86_64
or Building ffmpeg with required libs only but i dont know which lib is required for segment purpose
and also I dont know how to build ffmpeg from source code
I am using this library 'com.arthenica:mobile-ffmpeg-min-gpl:4.4.LTS'
I found few ways to reduce app size when i was using ffmpeg.
You could use app bundle. so, the unused arms will be ignored. when download from the playstore
I would suggest not deleting x86 cause some low-end devices won't work without it. x86_64 can be deleted though. I have already done it once for min-4.4-lts not for min-gpl-4.4-lts. you can download it and directly use in your project and test it in the low-end devices .aar

How to use latest FFMPEG in Android Studio project?

I have a simple task to make a video from multiple images and an audio file, After searching a lot found that its possible with FFMPEG, Unfortunately there are no updated tutorials for FFMPEG, there are few but outdated and most of them are not working.
As I have compiled FFMPEG for Android using NDK android-ndk-r10e and ffmpeg-2.8.6 on my MAC with Android Studio following the tutorial http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
It makes the .so files as
Now I can't understand what should I do to integrate this in my Android project, I have also checked,
How to use Ffmpeg in android studio?
how to use ffmpeg in android?
FFmpeg on Android
and mainly this,
http://www.roman10.net/how-to-build-android-applications-based-on-ffmpeg-by-an-example/
https://github.com/roman10/android-ffmpeg-tutorial
But its not working and having errors with no way to resolve this. Can anyone please mention some steps that should be followed to use FFMPEG .so files as in image attached.
There's a very easy solution for this, There's a precompiled library for android, as below https://github.com/WritingMinds/ffmpeg-android-java
Simply include this as a gradle project in your code and add few methods as per their documentation and you are done with FFMPEG commands in android.
This library is not very updated and have some missing features but still its good to use for many simple tasks.

How to call ffmpeg from Activity?

I want to use ffmpeg to change the resolution of video.
However, i don't know how can i call ffmpeg executable from activity in android.
I am using eclipse and Windows 7
Any help will be appreciated.
You should follow basically this steps:
Build ffmpeg for android (http://bambuser.com/opensource)
Load the ffmpeg library (*.so) on your app
Use native calls (JNI) to call ffmpeg APIs

Android ndk r7, ffmpeg on Windows

We are developing an android App which should convert the .3GP file to .FLV and upload to the web server.
We completed the overall framework to upload a file to web server. But we are facing problem on converting the .3GP to .FLV.
We searched google and couldn't able to find a working solution.
We are using Windows OS
We managed to install the NDK r7
We managed to install cygwin.
We downloaded the latest ffmpeg
Now we need to compile the FFMPEG using the android NDK and use FFMPEG to convert the video file.
Could someone help me to compile ffmpeg on android (windows)?
Or is there any other way simplest way to convert a video?
you can see https://github.com/havlenapetr/FFMpeg/commits/debug
it works well.
and just google as "android ffpeg",it will be a bazinga

How do I build ffmpeg including x264 library for android?

Lots of question and answer available on the ffmpeg and android. But I did not get thing that directly address ffmpeg building with x264 library.
Actually I want to make a movie from some still images in android.
Still do not get any solution to resolve this problem. Some of the forum told that it can be do using ffmpeg. If I build ffmpeg after downloading from "http://bambuser.com/opensource", it works fine to decode a video file. But it does not get any codec while it try to encode still image into movie.
That's why I try to use x264 as encoding library with ffmpeg. While I try to build it with ffmpeg it returns error.
Could you please provide any detail step by step guide line to build ffmpeg with x264 library in windows or mac for android?
If any one knows anything other that can be used to make movie from still images in android please tell me the way. Your help will be highly appreciated.
Thank you in advance for your kind response.
I made a tutorial on how to build ffmpeg and x264 for android:
http://db.tt/TjMqIF3u
You can also download the zip file containing the files you need to make an application on android and also an executable of lastest ffmpeg to run on android.
PS: you might need Cygwin to compile ffmpeg in Windows.

Categories

Resources