1 ================================================================================
3 ================================================================================
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后的视频都优先选用视频硬件解码,充分发挥硬件特性
12 ================================================================================
13 为何起名为nam[NamExtractor]?
14 ================================================================================
16 纳木措是西藏三大圣湖之一,是每一个去西藏的旅行者不容错过的景点。在藏语中,
17 "纳木措"是“天上之湖”的意思。纳木错以其高海拔和令人窒息的美景而声名远扬。
19 我曾经于2011年9月到过此湖,于是便起此名
21 ================================================================================
23 ================================================================================
25 1. android_frameworks_native:
26 https://github.com/omxcodec/android_frameworks_native.git
27 branch: cm_maguro-10.1
29 2. android_frameworks_av:
30 https://github.com/omxcodec/android_frameworks_av.git
31 branch: cm_maguro-10.1
33 3. android_external_ffmpeg
34 git@github.com:omxcodec/android_external_ffmpeg
35 branch: cm_maguro-10.1
37 ================================================================================
39 ================================================================================
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
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"两个目录。
60 adb sync // 与手机或者平板同步系统,一般系统会选择更改的文件或库进行同步
65 wget http://movies.apple.com/media/us/ipad/2012/tv-spots/apple-ipad-this_good-us-20120307_848x480.mov
66 wget http://movies.apple.com/media/us/ipad/2012/80ba527a-1a34-4f70-aae8-14f87ab76eea/tours/apple-ipad-feature-us-20120307_848x480.mp4
67 wget http://ftp.kw.bbc.co.uk/hevc/hm-10.0-anchors/bitstreams/i_main/BQMall_832x480_60_qp22.bin
69 假设你视频测试文件放在目录 "/sdcard/Movies/".
71 adb logcat -c //清空先前所有的log
74 测试 FFmpegExtractor 插件:
75 adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
76 adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
77 测试 SoftFFmpegVideo 视频解码器插件:
78 进入目录android/external/stagefright-plugins/tools, 运行:
81 adb root && adb shell set-vdec-sw1 // 让Stagefright优先选用视频软件解码器
82 adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
83 adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
85 进入目录android/external/stagefright-plugins/tools, 运行:
88 adb root && adb shell set-vdec-drop0 // 禁止视频解码速度过慢时Stagefright做丢帧处理
89 adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/BQMall_832x480_60_qp22.bin -t video/*
93 ================================================================================
95 ================================================================================
111 Raw HEVC(H.265) bitstreams
139 ================================================================================
141 ================================================================================
142 1. 一些mov文件,当seek后,音视频不能迅速同步
147 如果这个项目对您有帮助,或者您想讨论跟此相关相关的话题,请联系本人:
148 Michael Chen (omxcodec@gmail.com)