OSDN Git Service

Merge remote-tracking branch 'x86/oreo-x86' into pie-x86
[android-x86/external-stagefright-plugins.git] / README.cn
1 ================================================================================
2 Stagefright插件
3 ================================================================================
4
5 1. 基于Android多媒体框架提供额外的插件给用户集成
6 2. FFmpeg提供demux和音视频解码器
7 3. FFmpegExtractor属于Stagefright的一个demux(extractor)插件
8 4. libstagefright_soft_ffmpegvdec是一个视频解码器插件
9 5. libstagefright_soft_ffmpegadec是一个音频解码器插件
10 6. 任何FFmpegExtractor demux后的视频都优先选用视频硬件解码,充分发挥硬件特性
11
12 ================================================================================
13 为何起名为nam[NamExtractor]?
14 ================================================================================
15
16 纳木措是西藏三大圣湖之一,是每一个去西藏的旅行者不容错过的景点。在藏语中,
17 "纳木措"是“天上之湖”的意思。纳木错以其高海拔和令人窒息的美景而声名远扬。
18
19 我曾经于2011年9月到过此湖,于是便起此名
20
21 ================================================================================
22 需要条件
23 ================================================================================
24
25 1. android_frameworks_native:
26 https://github.com/omxcodec/android_frameworks_native.git
27 branch: cm_maguro-10.1
28
29 2. android_frameworks_av:
30 https://github.com/omxcodec/android_frameworks_av.git
31 branch: cm_maguro-10.1
32
33 3. android_external_ffmpeg
34 git@github.com:omxcodec/android_external_ffmpeg
35 branch: cm_maguro-10.1
36
37 ================================================================================
38 如何编译
39 ================================================================================
40
41 1. 获取源码
42    进入你的Android源码目录 "android/external", 运行如下命令:
43    stagefright-plugins(branch: master):
44        git clone git@github.com:omxcodec/stagefright-plugins.git stagefright-plugins
45    ffmpeg(branch: cm_maguro-10.1):
46        git clone git@github.com:omxcodec/android_external_ffmpeg.git ffmpeg -b cm_maguro-10.1
47
48    android_frameworks_native and android_frameworks_av:
49        显然,你应该合并我的android_frameworks_native(branch: cm_maguro-10.1)和
50    android_frameworks_av(branch: cm_maguro-10.1)的源代码。合并修改部分的代码比较少,
51    而且非常有规律,我修改过的代码使用了"USES_NAM"这个宏,而且我修改过的代码仅仅在
52    "android/frameworks/native"和"android/frameworks/av"两个目录。
53  
54 2. 编译
55    根据你的设备(比如说我的设备: maguro),增加"USES_NAM" flag到Android全局编译参数"COMMON_GLOBAL_CFLAGS"中.
56    编辑 vendor/samsung/maguro/BoardConfigVendor.mk 增加如下一行:
57        COMMON_GLOBAL_CFLAGS += -DUSES_NAM
58    然后请重新编译你的整个Android系统。
59
60 3. 安装
61    adb root
62    adb remount
63    adb sync // 与手机或者平板同步系统,一般系统会选择更改的文件或库进行同步
64    reboot   // 重启你的手机或者平板
65
66 4. 运行
67    获取测试文件:
68        wget http://movies.apple.com/media/us/ipad/2012/tv-spots/apple-ipad-this_good-us-20120307_848x480.mov
69        wget http://movies.apple.com/media/us/ipad/2012/80ba527a-1a34-4f70-aae8-14f87ab76eea/tours/apple-ipad-feature-us-20120307_848x480.mp4
70        wget http://ftp.kw.bbc.co.uk/hevc/hm-10.0-anchors/bitstreams/i_main/BQMall_832x480_60_qp22.bin
71
72    假设你视频测试文件放在目录 "/sdcard/Movies/".
73    开启一个linux终端,运行:
74        adb logcat -c //清空先前所有的log
75        adb logcat
76    开启另外一个linux终端, 分情况运行:
77    测试 FFmpegExtractor 插件:
78        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
79        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
80    测试 SoftFFmpegVideo 视频解码器插件:
81        进入目录android/external/stagefright-plugins/tools, 运行:
82        adb root
83        ./install // 安装测试脚本
84        adb root && adb shell set-vdec-sw1 // 让Stagefright优先选用视频软件解码器
85        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
86        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
87    测试 HEVC(H.265) 视频解码器:
88        进入目录android/external/stagefright-plugins/tools, 运行:
89        adb root
90        ./install // 安装测试脚本
91        adb root && adb shell set-vdec-drop0 // 禁止视频解码速度过慢时Stagefright做丢帧处理
92        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/BQMall_832x480_60_qp22.bin -t video/*
93
94    希望你一切顺利
95
96 ================================================================================
97 功能
98 ================================================================================
99 输入格式:
100     MP4 / MOV / 3GP
101     TS / PS
102     AVI
103     ASF / WMV / WMA
104     Matroska (MKV)
105     Real(RM,RMVB)
106     WAV
107     FLV
108     SWF
109     APE
110     DTS
111     FLAC
112     WAV
113     OGG
114     Raw HEVC(H.265) bitstreams
115
116 视频解码器:
117     MPEG-1/2
118     MPEG-4
119     H.263
120     H.264 / MPEG-4 AVC
121     WMV 1/2
122     WMV 3 / WMV-9 / VC-1
123     RV (Real Video)
124     VP8
125     FLV1
126     DIVX
127     HEVC(H.265)
128
129 音频解码器:
130     MP2 (MPEG Layer 2)
131     MP3 (MPEG Layer 3)
132     AAC (MPEG-4 part3)
133     AC3
134     WMA 1/2
135     WMA 3
136     RA (Real Audio)
137     APE
138     DTS
139     FLAC
140     VORBIS
141     
142 ================================================================================
143 存在问题
144 ================================================================================
145 1. 一些mov文件,当seek后,音视频不能迅速同步
146 2. 一些文件正在seek时,退出程序
147 3. 需要集成更多的音视频编解码器
148 4. 需要集成更多的文件格式解析器
149
150 如果这个项目对您有帮助,或者您想讨论跟此相关相关的话题,请联系本人:
151 Michael Chen (omxcodec@gmail.com)