Saturday, 17 March 2012

Android-ffmpeg

If anybody wanted to integrate the FFmpeg with ICS google,,i.e.. Wen u compile ur ICS ,FFmpeg should also be compiled,,Here are the steps for u to build the FFmpeg along with ur ICS,

1)Download the ffmpeg-ffmpeg-android usig this or if u have downloaded the ffmpeg android it also well and good.
2)Next, go to this path in ur ICS code -->src/frameworks/base/media/libstagefright.
3)Extract the ffmpeg. So, you ll find a folder as ffmpe-ffmpeg-android.Inside that ull find android.mk file and some folders named as libavcodec, libavutils,,.. so on.
4) In ffmpeg's android.mk file,give as call all sudirctives or the the folder which u want. THis is my android.mk in ffmpeg
  LOCAL_PATH := $(call my-dir)

FFMPEG_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

include $(FFMPEG_TOP)/libavutil/Android.mk
include $(FFMPEG_TOP)/libavcodec/Android.mk
or
include $(call all-makefiles-under,$(LOCAL_PATH))

-->after giving ur path in ffmpeg android.mk. this ll call all ur sub folders android.mk inside ffmpeg.So, u can use all those inside the ffmpeg.

5) Next ,you have to  check the module names in those folder's android.mk file.here (libavutil,libavcodec).
            It ll be like LOCAL_MODULE := libavutil
6) So, now u have to open the libstagefright android.mk in thatunde local static libraries copy thos modules name.
I gave example ly for two folder.. if u want acces all the folders of ffmpeg, u must follow as i suggest and use those inside this folder.

LOCAL_STATIC_LIBRARIES := \
        libstagefright_color_conversion \
        libstagefright_aacenc \
        libstagefright_amrnbenc \
        libstagefright_amrwbenc \
        libstagefright_avcenc \
        libstagefright_m4vh263enc \
        libstagefright_matroska \
        libstagefright_timedtext \
        libvpx \
        libstagefright_mpeg2ts \
        libstagefright_httplive \
        libstagefright_rtsp \
        libstagefright_id3 \
        libFLAC \
        libavutil    \
        libavcodec    \


   7)Once done just foll0w the steps for compile the ICS code and move on.after compilation .under this directory
 out/target/product/generic/obj/Static_libraries
 You ll find libavutils and libavcodec intermediates
Nothing but the statice libs are built and u can use it.



No comments:

Post a Comment