How to call ffmpeg from Activity? - android

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

Related

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 add ffmpeg to my android project and use them?

I am developing an Android project/app for video compression and that's how I came to know about ffmpeg. I'm using Ubuntu 11.04 OS and Eclipse IDE(ADT-bundle).
I came across many topics dealing with ffmpeg at StackOverflow but i can't clearly figure out where I can get the ffmpeg jar file and how to add it and use in my project.
Any advice from you will be of great help.
If ffmpeg is so tough to handle for a beginner in Android like me, then is there any other way to compress a video in android?
If you're targetting Android 15 or greater version, try MediaCodec class.
May be this helps You.It's java porting of ffmpeg. Though it uses JNI internally,it provides java functions that hides the mess!!

How to call lame executable from Android?

I downloaded LAME for Windows. It have two files, one is lame_enc.dll and another is lame.exe.
I want to convert an MP3 file from 320kbs to 128kbs.
In Windows I use command line: C:\Lame\lame.exe --preset cbr 128 "320.mp3" "128.mp3" - it works good. My question is how can I call lame.exe from my Android project? And what steps must I take to achieve that?
Thank you for your replies!
You can't call Windows executable files in Android, because they have different architecture.
It easy to understand, you can't run apk file on Windows if you don't have any converting or simulation softwares.
You can use extended libraries such as ffmpeg, lame to change bitrate of mp3 files. You can access this link to build shared library in Android:
http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI
You can't just "run lame executable from Android", because Android does not run Windows' executable files. Analogical you are not able to run MacOS applications in Windows without converting them/using emulator/etc.
I advice you to use something different than LAME for this job - I haven't used any of such, so I can't reccomend you anything right now.
EDIT
It seems that you may also easily port LAME for Android - Lame MP3 Encoder compile for Android

Using ffmpeg libraries in android native project

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!

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