Compile FFmpeg 0.8.1 using Android NDK r6 in 64-bit Ubuntu 10.10

Source: Internet
Author: User

 

1. Download NDK r6 and FFmpeg 0.8.1

Android NDK r6

FFmpeg 0.8.1

2. Extract

Extract the android-ndk-r6-linux-x86.tar.bz2 to the/home/pekall/opt directory and add the ndk path to the path environment variable

Decompress the ffmpeg-0.8.1.tar.gz to the/home/pekall/Projects_private/FFmpegPlayer/lib directory

Rename the directory/home/pekall/Projects_private/FFmpegPlayer/lib/ffmpeg-0.8.1 to/home/pekall/Projects_private/FFmpegPlayer/lib/jni

3. Compile the FFmpeg configuration script

Create the script file config. sh in the/home/pekall/Projects_private/FFmpegPlayer/lib/jni directory and add the executable permission.

 

./Configure \

-- Disable-static \

-- Enable-shared \

-- Enable-gpl \

Enable-version3 \

-- Enable-nonfree \

-- Disable-doc \

-- Disable-ffmpeg \

-- Disable-ffplay \

-- Disable-ffprobe \

-- Disable-ffserver \

-- Disable-avdevice \

-- Disable-avfilter \

-- Disable-postproc \

-- Enable-small \

-- Cross-prefix =/home/pekall/opt/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi -\

-- Enable-cross-compile \

-- Target-OS = linux \

-- Extra-cflags = '-I/home/pekall/opt/android-ndk-r6/platforms/android-9/arch-arm/usr/include '\

-- Extra-ldflags = '-L/home/pekall/opt/android-ndk-r6/platforms/android-9/arch-arm/usr/lib-nostdlib '\

-- Arch = arm \

-- Disable-symver \

-- Disable-debug \

-- Disable-stripping \

Sed-I's/HAVE_LRINT 0/HAVE_LRINT 1/G' config. h

Sed-I's/HAVE_LRINTF 0/HAVE_LRINTF 1/G' config. h

Sed-I's/HAVE_ROUND 0/HAVE_ROUND 1/G' config. h

Sed-I's/HAVE_ROUNDF 0/HAVE_ROUNDF 1/G' config. h

Sed-I's/HAVE_TRUNC 0/HAVE_TRUNC 1/G' config. h

Sed-I's/HAVE_TRUNCF 0/HAVE_TRUNCF 1/G' config. h

The following attributes must be modified based on the location where the ndk is installed:

 

Cross-prefix

Extra-cflags

Extra-ldflags

4. Compile the Android. mk File

You can use this link to obtain the same content as the reference file.

 

5. Generate the FFmpeg configuration file

Open the terminal and run config. sh in the/home/pekall/Projects_private/FFmpegPlayer/lib/jni directory.

 

6. Compile FFmpeg

Open the terminal and run ndk-build in the/home/pekall/Projects_private/FFmpegPlayer/lib directory, after compilation, the libffmpeg file about MB is generated in the/home/pekall/Projects_private/FFmpegPlayer/lib/libs/armeabi directory. so

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.