Android full-format multimedia player (1: FFMPEG porting)-reprinted

Source: Internet
Author: User

Good article reproduced, the source of http://blog.csdn.net/fgwf1/archive/2011/01/05/6118686.aspx

 

To play a full-format multimedia file on the Android platform, we need to make a multimedia player by ourselves. Android's opencore system has fewer decoding formats, and only supports
MP4 and Ogg, and the structure is not well understood. It is too difficult to add other decoding methods. After consideration, it is easier to implement a full-featured player based on FFMPEG and the cost is relatively low.
(FFMPEG after transplantation content I have put on the git@github.com: windsome/ffmpeg-android.git, interested can directly under
Upload, edited on android2.1, and cannot be edited on other android versions)
This article discusses the first step of making a full-format multimedia player: FFMPEG porting.

Step 1: Get the FFMPEG on an old Android platform that someone else has transplanted. Address is http://gitorious.org /~ Olvaffe/FFMPEG-android, we will use its *. mk file. I put the source code in a temporary directory.

Step 2: Get the new FFMPEG version. The address is a http://ffmpeg.org/download.html. It is generally obtained by using git clone. I put the source code under the external/directory of the android source code tree.

Step 3: Configure FFMPEG to get the config. Mak and config. H files on the Android platform. Therefore, you only need to successfully configure and do not need to compile it. We will compile it under the android source code tree later.
Export prebuilt =/home/dev/Android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0
./Configure -- target-OS = Linux
-- Arch = armv41
-- Enable-Cross-compile
-- Cc = $ prebuilt/bin/ARM-Eabi-gcc
-- Cross-Prefix = $ prebuilt/bin/ARM-Eabi-
-- Nm = $ prebuilt/bin/ARM-Eabi-nm
-- Extra-cflags = "-FPIC-dandroid"
-- Enable-static
-- Disable-shared
-- Disable-ASM
-- Disable-yasm
-- Prefix = 'pwd'/android_bin
-- Extra-ldflags = "-wl,-T, $ prebuilt/ARM-Eabi/lib/ldscripts/armelf. x
-Wl,-rpath-link =/home/dev/Android/out/target/product/generic/obj/lib
-L/home/dev/Android/out/target/product/generic/obj/lib-nostdlib
$ Prebuilt/lib/GCC/ARM-Eabi/4.4.0/crtbegin. o
$ Prebuilt/lib/GCC/ARM-Eabi/4.4.0/crtend. O-LC-lm-LDL"
To explain, prebuilt is the path of my android compiler. I use tool-Chian under the android source code tree. In the configure command, except the directories may be different, other changes do not need to be made.

Step 4: Copy *. mk under FFMPEG-android in the temporary directory to the external/FFMPEG directory of the android source code tree. This completes the transplantation. (In this step, you may need to modify the file. I have packed the file to be modified and placed it in the attachment)

Step 5: Make libavutil libavcodec libavformat libswscale In the android directory.

Note: I have uploaded based on the latest FFMPEG (version 0.6-git-6157eab) changes. You only need to extract the attachment and replace the corresponding file in the source FFMPEG, you can directly perform Step 5.

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.