• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

autotest/H21-May-2020-1,5081,203

build/H21-May-2020-1,2501,083

codec/H21-May-2020-153,663118,656

docs/H21-May-2020-2,5721,949

include/H21-May-2020-118

module/H21-May-2020-3,4482,632

res/H03-May-2022-3,8738

subprojects/H21-May-2020-118

test/H21-May-2020-31,75926,880

testbin/H21-May-2020-601493

.gitignoreH A D21-May-2020688 6046

.reviewboardrcH A D21-May-202079 42

.travis.ymlH A D21-May-20201.4 KiB4640

CODING_STYLEH A D21-May-2020257 94

CONTRIBUTORSH A D21-May-2020598 5650

LICENSEH A D21-May-20201.3 KiB2319

MakefileH A D03-May-202212.9 KiB384307

README.mdH A D21-May-20208.3 KiB194146

RELEASESH A D21-May-202017.4 KiB372335

code-coverage.shH A D21-May-2020167 75

gmpopenh264.infoH A D21-May-2020116 54

meson.buildH A D21-May-20204.1 KiB156127

openh264.defH A D21-May-2020154 87

openh264.pc.inH A D21-May-2020335 119

openh264.rcH A D21-May-20201.7 KiB6254

openh264.rc.templateH A D21-May-20201.7 KiB6254

run_Test.shH A D21-May-20202.8 KiB9570

ut.defH A D21-May-202024 32

README.md

1OpenH264
2========
3OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC. See http://www.openh264.org/ for more details.
4
5Encoder Features
6----------------
7- Constrained Baseline Profile up to Level 5.2 (Max frame size is 36864 macro-blocks)
8- Arbitrary resolution, not constrained to multiples of 16x16
9- Rate control with adaptive quantization, or constant quantization
10- Slice options: 1 slice per frame, N slices per frame, N macroblocks per slice, or N bytes per slice
11- Multiple threads automatically used for multiple slices
12- Temporal scalability up to 4 layers in a dyadic hierarchy
13- Simulcast AVC up to 4 resolutions from a single input
14- Spatial simulcast up to 4 resolutions from a single input
15- Long Term Reference (LTR) frames
16- Memory Management Control Operation (MMCO)
17- Reference picture list modification
18- Single reference frame for inter prediction
19- Multiple reference frames when using LTR and/or 3-4 temporal layers
20- Periodic and on-demand Instantaneous Decoder Refresh (IDR) frame insertion
21- Dynamic changes to bit rate, frame rate, and resolution
22- Annex B byte stream output
23- YUV 4:2:0 planar input
24
25Decoder Features
26----------------
27- Constrained Baseline Profile up to Level 5.2 (Max frame size is 36864 macro-blocks)
28- Arbitrary resolution, not constrained to multiples of 16x16
29- Single thread for all slices
30- Long Term Reference (LTR) frames
31- Memory Management Control Operation (MMCO)
32- Reference picture list modification
33- Multiple reference frames when specified in Sequence Parameter Set (SPS)
34- Annex B byte stream input
35- YUV 4:2:0 planar output
36
37OS Support
38----------
39- Windows 64-bit and 32-bit
40- Mac OS X 64-bit and 32-bit
41- Linux 64-bit and 32-bit
42- Android 64-bit and 32-bit
43- iOS 64-bit and 32-bit
44- Windows Phone 32-bit
45
46Processor Support
47-----------------
48- Intel x86 optionally with MMX/SSE (no AVX yet, help is welcome)
49- ARMv7 optionally with NEON, AArch64 optionally with NEON
50- Any architecture using C/C++ fallback functions
51
52Building the Library
53--------------------
54NASM needed to be installed for assembly code: workable version 2.10.06 or above, NASM can downloaded from http://www.nasm.us/.
55For Mac OSX 64-bit NASM needed to be below version 2.11.08 as NASM 2.11.08 will introduce error when using RIP-relative addresses in Mac OSX 64-bit
56
57To build the arm assembly for Windows Phone, gas-preprocessor is required. It can be downloaded from git://git.libav.org/gas-preprocessor.git
58
59For Android Builds
60------------------
61To build for android platform, You need to install android sdk and ndk. You also need to export `**ANDROID_SDK**/tools` to PATH. On Linux, this can be done by
62
63    export PATH=**ANDROID_SDK**/tools:$PATH
64
65The codec and demo can be built by
66
67    make OS=android NDKROOT=**ANDROID_NDK** TARGET=**ANDROID_TARGET**
68
69Valid `**ANDROID_TARGET**` can be found in `**ANDROID_SDK**/platforms`, such as `android-12`.
70You can also set `ARCH`, `NDKLEVEL` according to your device and NDK version.
71`ARCH` specifies the architecture of android device. Currently `arm`, `arm64`, `x86` and `x86_64` are supported, the default is `arm`. (`mips` and `mips64` can also be used, but there's no specific optimization for those architectures.)
72`NDKLEVEL` specifies android api level, the default is 12. Available possibilities can be found in `**ANDROID_NDK**/platforms`, such as `android-21` (strip away the `android-` prefix).
73
74By default these commands build for the `armeabi-v7a` ABI. To build for the other android
75ABIs, add `ARCH=arm64`, `ARCH=x86`, `ARCH=x86_64`, `ARCH=mips` or `ARCH=mips64`.
76To build for the older `armeabi` ABI (which has armv5te as baseline), add `APP_ABI=armeabi` (`ARCH=arm` is implicit).
77To build for 64-bit ABI, such as `arm64`, explicitly set `NDKLEVEL` to 21 or higher.
78
79For iOS Builds
80--------------
81You can build the libraries and demo applications using xcode project files
82located in `codec/build/iOS/dec` and `codec/build/iOS/enc`.
83
84You can also build the libraries (but not the demo applications) using the
85make based build system from the command line. Build with
86
87    make OS=ios ARCH=**ARCH**
88
89Valid values for `**ARCH**` are the normal iOS architecture names such as
90`armv7`, `armv7s`, `arm64`, and `i386` and `x86_64` for the simulator.
91Another settable iOS specific parameter
92is `SDK_MIN`, specifying the minimum deployment target for the built library.
93For other details on building using make on the command line, see
94'For All Platforms' below.
95
96For Windows Builds
97------------------
98
99Our Windows builds use MinGW which can be downloaded from http://www.mingw.org/
100
101To build with gcc, add the MinGW bin directory (e.g. `/c/MinGW/bin`) to your path and follow the 'For All Platforms' instructions below.
102
103To build with Visual Studio you will need to set up your path to run cl.exe.  The easiest way is to start MSYS from a developer command line session.  Instructions can be found at http://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx.  If you need to do it by hand here is an example from a Windows 64bit install of VS2012:
104
105    export PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin:/c/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE"
106
107You will also need to set your INCLUDE and LIB paths to point to your VS and SDK installs.  Something like this, again from Win64 with VS2012 (note the use of Windows-style paths here).
108
109    export INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include;C:\Program Files (x86)\Windows Kits\8.0\Include\um;C:\Program Files (x86)\Windows Kits\8.0\Include\shared"
110    export LIB="C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x86;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib"
111
112Then add `OS=msvc` to the make line of the 'For All Platforms' instructions.
113
114For Windows Phone Builds
115------------------------
116
117Follow the instructions above for normal Windows builds, but use `OS=msvc-wp`
118instead of `OS=msvc`. You will also need gas-preprocessor (as mentioned below
119"Building the Library").
120
121If building for Windows Phone with MSVC 2013, there's no included bat file that sets the lib paths to the Windows Phone kit, but that can be done with a command like this:
122
123    export LIB="c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\store\arm;c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\arm;c:\Program Files (x86)\Windows Phone Kits\8.1\lib\arm"
124
125This is only necessary for building the DLL; the static library can be built without setting this.
126
127Note, only Windows Phone 8.1 or newer is supported, 8.0 is no longer supported.
128
129For All Platforms
130-------------------
131
132Using make
133----------
134
135From the main project directory:
136- `make` for automatically detecting architecture and building accordingly
137- `make ARCH=i386` for x86 32-bit builds
138- `make ARCH=x86_64` for x86 64-bit builds
139- `make V=No` for a silent build (not showing the actual compiler commands)
140- `make DEBUGSYMBOLS=True` for two libraries, one is normal libraries, another one is removed the debugging symbol table entries (those created by the -g option)
141
142The command line programs `h264enc` and `h264dec` will appear in the main project directory.
143
144A shell script to run the command-line apps is in `testbin/CmdLineExample.sh`
145
146Usage information can be found in `testbin/CmdLineReadMe`
147
148Using meson
149-----------
150
151Meson build definitions have been added, and are known to work on Linux
152and Windows, for x86 and x86 64-bit.
153
154See <http://mesonbuild.com/Installing.html> for instructions on how to
155install meson, then:
156
157``` shell
158meson builddir
159ninja -C builddir
160```
161
162Run the tests with:
163
164``` shell
165meson test -C builddir -v
166```
167
168Install with:
169
170``` shell
171ninja -C builddir install
172```
173
174Using the Source
175----------------
176- `codec` - encoder, decoder, console (test app), build (makefile, vcproj)
177- `build` - scripts for Makefile build system
178- `test` - GTest unittest files
179- `testbin` - autobuild scripts, test app config files
180- `res` - yuv and bitstream test files
181
182Known Issues
183------------
184See the issue tracker on https://github.com/cisco/openh264/issues
185- Encoder errors when resolution exceeds 3840x2160
186- Encoder errors when compressed frame size exceeds half uncompressed size
187- Decoder errors when compressed frame size exceeds 1MB
188- Encoder RC requires frame skipping to be enabled to hit the target bitrate,
189  if frame skipping is disabled the target bitrate may be exceeded
190
191License
192-------
193BSD, see `LICENSE` file for details.
194