1

I would like to preform video processing on android using FFMpeg. I successfull build .so libraries and link it to my NDK project but now I realy dont know what to do next. I cant find any example of how to e.g. crop video or rotate it from NDK. I found many examples of ffmpeg command line tool like:

ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4

but none of them is referencing to C code. Is this possible to do something like example above in NDK C code? Where can I find FFMpeg examples for beginers? Is this possible to invoke ffmpeg command line tool from android app?

Sayaki
  • 769
  • 14
  • 36
  • possible duplicate of [How to run ffmpeg from command line in android](http://stackoverflow.com/questions/12446955/how-to-run-ffmpeg-from-command-line-in-android) – Alex Cohn Jun 15 '14 at 17:39

2 Answers2

1

Install the free "GNURoot" app for Android. It does not require root access to install. Then it has a Debian distro you can install. After you get Debian booted:

apt-get update
apt-get upgrade

From there apt-get install ffmpeg

I'll try this myself and followup here.

Update: GNURoot Debian gave me trouble. But I finally got ffmpeg installed on my Nexus7. Instead of GNURoot Debian you should try the GNURoot Fedora and the rpmfusion repository:

yum localinstall --nogpgcheck \ http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \ yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

After you enable the repo, yum install ffmpeg and you're ready to go! Works on Nexus 7 but not Galaxy Tab 4.

PJ Brunet
  • 3,615
  • 40
  • 37
0

If you want more control over the process, you can build ffmpeg libraries and communicate with them from your C code, or even from Java, using a JNI wrapper.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307