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