OSDN Git Service

change from OMX.ffmpeg.vheuristic.decoder to OMX.ffmpeg.vtrial.decoder and
[android-x86/external-stagefright-plugins.git] / README
1 ================================================================================
2 Stagefright Plugins for Android
3 ================================================================================
4
5 1. Enhance the Android multimedia framework providing additional Plugins for
6    user interaction
7 2. FFmpeg provides demuxers and av codecs;
8 3. NamExtractor is a extractor plugin, it would be loaded by Stagefright when 
9    Stagefright started. NamExtractor will load FFmpegExtractor.FFmpegExtractor
10    is the reference to "ffmpeg/ffplay" to achieve. 
11 4. libstagefright_soft_ffmpegvdec plugin is video decoder
12 5. libstagefright_soft_ffmpegadec plugin is audio decoder
13
14 ================================================================================
15 Why is named nam[NamExtractor]?
16 ================================================================================
17
18 Namtso, or Lake Nam, is one of the three holy lakes in Tibet Autonomous Region
19 and should not be missed by any traveler to Tibet. In Tibetan, Namtso means
20 "Heavenly Lake." It is famous for its high altitude and imposing scenery.
21
22 I used to travel there in 2011 Sep.
23
24 ================================================================================
25 Requirements
26 ================================================================================
27
28 CyanogenMod 9.x (Ice Cream Sandwich)
29 http://wiki.cyanogenmod.com/wiki/Galaxy_Nexus_(GSM):_Compile_CyanogenMod_(Linux)
30
31 FFMPEG-1.0 release
32 http://ffmpeg.org
33 ref: git://android.git.linaro.org/platform/external/ffmpeg.git
34
35 ================================================================================
36 How to build
37 ================================================================================
38
39 1. Get the Source
40    clone cm-9.1.0 source from CyanogenMod git:
41        repo init -u git://github.com/CyanogenMod/android.git -b cm-9.1.0
42    plz ref: http://wiki.cyanogenmod.com/wiki/Galaxy_Nexus_(GSM):_Compile_CyanogenMod_(Linux)
43
44    clone my sources from the omxcodec{github} git!
45    in your "android/external" folder, run:
46    stagefright-plugins:
47        git clone git@github.com:omxcodec/stagefright-plugins.git stagefright-plugins
48    ffmpeg:
49        git clone git@github.com:omxcodec/android_external_ffmpeg.git ffmpeg -b omxcodec-1.0
50
51    in your "android/external" folder, run:
52    cp stagefright-plugins/repo/local_manifest.xml ../.repo
53    cd ..      // go to android folder
54    repo sync  // sync "frameworks_base" code again!
55
56    "repo sync" sync "frameworks_base" code again! of course, you can merge my
57    android_external_ffmpeg code instread of "repo sync" frameworks_base. once you do,
58    so you should pay attention to the "USES_NAM" flag, it is only in the
59    "android/frameworks/base" directory
60  
61 2. Compile
62    add USES_NAM flag to COMMON_GLOBAL_CFLAGS in android build system
63        vi vendor/samsung/maguro/BoardConfigVendor.mk and add these lines to it
64            USES_NAM := true
65            ifdef USES_NAM
66                COMMON_GLOBAL_CFLAGS += -DUSES_NAM
67            endif
68
69    ffmpeg:
70        cd android/external/ffmpeg
71        mm ffmpeg  // NOT "mm", plz FIXME!
72
73        cd android/external/stagefright-plugins
74        mm
75
76 3. Install
77    adb root
78    adb remount
79    adb sync // sync your android build system to your phone or pad
80    reboot   // reboot your phone or pad
81
82 4. Run
83    get test media files:
84        wget http://movies.apple.com/media/us/ipad/2012/tv-spots/apple-ipad-this_good-us-20120307_848x480.mov
85        wget http://movies.apple.com/media/us/ipad/2012/80ba527a-1a34-4f70-aae8-14f87ab76eea/tours/apple-ipad-feature-us-20120307_848x480.mp4
86
87    let us suppose your media files locate at "/sdcard/Movies/" folder.
88    one console window, you should run:
89        adb logcat
90    and other cosole window, you should run:
91    test NamExtractor and FFmpegExtractor plugins:
92        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
93        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
94    test SoftFFmpegVideo decoder plugin:
95        cd android/external/stagefright-plugins/tools folder, run:
96        adb root
97        ./install // install my scripts
98        adb root && adb shell set-vdec-sw1 // let omxcodec choose software decoder
99        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
100        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
101
102    run it and enjoy!
103
104 ================================================================================
105 Features
106 ================================================================================
107 Input formats:
108     MP4 / MOV / 3GP
109     TS / PS
110     AVI
111     ASF / WMV / WMA
112     Matroska (MKV)
113     Real(RM,RMVB)
114     WAV
115     FLV(H.264+AAC)
116
117 Video formats:
118     MPEG-1/2
119     MPEG-4
120     H.263
121     H.264 / MPEG-4 AVC
122     WMV 1/2
123     WMV 3 / WMV-9 / VC-1
124     Real Video
125
126 Audio formats:
127     MPEG Layer 1/2
128     MP3 - MPEG Layer 3
129     AAC - MPEG-4 part3
130     AC3 - A/52 (Dolby Digital)
131     WMA 1/2
132     WMA 3
133     Real Audio
134     AMR (3GPP)
135     APE
136     DTS
137     FLAC
138     
139 ================================================================================
140 Known issues
141 ================================================================================
142 1. some .mov movies do not av resync when seeking
143 2. some video stream ended while seeking
144 3. more video and audio codecs codec to be integrated
145 4. more formats to be integrated
146
147 If you need help with the library, or just want to discuss nam related issues, 
148 you can contact me: Michael Chen (omxcodec@gmail.com)