- Notifications
You must be signed in to change notification settings - Fork1.8k
cisco/openh264
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC. Seehttp://www.openh264.org/ for more details.
- Constrained Baseline Profile up to Level 5.2 (Max frame size is 36864 macro-blocks)
- Arbitrary resolution, not constrained to multiples of 16x16
- Rate control with adaptive quantization, or constant quantization
- Slice options: 1 slice per frame, N slices per frame, N macroblocks per slice, or N bytes per slice
- Multiple threads automatically used for multiple slices
- Temporal scalability up to 4 layers in a dyadic hierarchy
- Simulcast AVC up to 4 resolutions from a single input
- Spatial simulcast up to 4 resolutions from a single input
- Long Term Reference (LTR) frames
- Memory Management Control Operation (MMCO)
- Reference picture list modification
- Single reference frame for inter prediction
- Multiple reference frames when using LTR and/or 3-4 temporal layers
- Periodic and on-demand Instantaneous Decoder Refresh (IDR) frame insertion
- Dynamic changes to bit rate, frame rate, and resolution
- Annex B byte stream output
- YUV 4:2:0 planar input
- Constrained Baseline Profile up to Level 5.2 (Max frame size is 36864 macro-blocks)
- Arbitrary resolution, not constrained to multiples of 16x16
- Single thread for all slices
- Long Term Reference (LTR) frames
- Memory Management Control Operation (MMCO)
- Reference picture list modification
- Multiple reference frames when specified in Sequence Parameter Set (SPS)
- Annex B byte stream input
- YUV 4:2:0 planar output
- Windows 64-bit and 32-bit
- Mac OS X 64-bit and 32-bit
- Mac OS X ARM64
- Linux 64-bit and 32-bit
- Android 64-bit and 32-bit
- iOS 64-bit and 32-bit
- Windows Phone 32-bit
- ppc64el
- Intel x86 optionally with MMX/SSE (no AVX yet, help is welcome)
- ARMv7 optionally with NEON, AArch64 optionally with NEON
- Any architecture using C/C++ fallback functions
NASM needed to be installed for assembly code: workable version 2.10.06 or above, NASM can be downloaded fromhttp://www.nasm.us/.For 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
To build the arm assembly for Windows Phone, gas-preprocessor is required. It can be downloaded from git://git.libav.org/gas-preprocessor.git
To 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
export PATH=**ANDROID_SDK**/tools:$PATH
The codec and demo can be built by
make OS=android NDKROOT=**ANDROID_NDK** TARGET=**ANDROID_TARGET**
Valid**ANDROID_TARGET**
can be found in**ANDROID_SDK**/platforms
, such asandroid-12
.You can also setARCH
,NDKLEVEL
according to your device and NDK version.ARCH
specifies the architecture of android device. Currentlyarm
,arm64
,x86
andx86_64
are supported, the default isarm
. (mips
andmips64
can also be used, but there's no specific optimization for those architectures.)NDKLEVEL
specifies android api level, the default is 12. Available possibilities can be found in**ANDROID_NDK**/platforms
, such asandroid-21
(strip away theandroid-
prefix).
By default these commands build for thearmeabi-v7a
ABI. To build for the other androidABIs, addARCH=arm64
,ARCH=x86
,ARCH=x86_64
,ARCH=mips
orARCH=mips64
.To build for the olderarmeabi
ABI (which has armv5te as baseline), addAPP_ABI=armeabi
(ARCH=arm
is implicit).To build for 64-bit ABI, such asarm64
, explicitly setNDKLEVEL
to 21 or higher.
You can build the libraries and demo applications using xcode project fileslocated incodec/build/iOS/dec
andcodec/build/iOS/enc
.
You can also build the libraries (but not the demo applications) using themake based build system from the command line. Build with
make OS=ios ARCH=**ARCH**
Valid values for**ARCH**
are the normal iOS architecture names such asarmv7
,armv7s
,arm64
, andi386
andx86_64
for the simulator.Another settable iOS specific parameterisSDK_MIN
, specifying the minimum deployment target for the built library.For other details on building using make on the command line, see'For All Platforms' below.
You can build the libraries (but not the demo applications) using themake based build system from the command line. Build with
make OS=linux ARCH=**ARCH**
You can setARCH
according to your linux device .ARCH
specifies the architecture of the device. Currentlyarm
,arm64
,x86
andx86_64
are supported
NOTICE:If your computer is x86 architecture, for build the libnary which be used on arm/aarch64 machine, you may need to use cross-compiler, for example:make OS=linux CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ ARCH=arm64ormake OS=linux CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ ARCH=arm
"make" must be installed. It is recommended to install the Cygwin and "make" must be selected to be included in the installation. After the installation, please add the Cygwin bin path to your PATH.
openh264/build/AutoBuildForWindows.bat is provided to help compile the libraries on Windows platform.
Usage of the .bat script:
`AutoBuildForWindows.bat Win32-Release-ASM` for x86 Release build `AutoBuildForWindows.bat Win64-Release-ASM` for x86_64 Release build `AutoBuildForWindows.bat ARM64-Release-ASM` for arm64 release build
for more usage, please refer to the .bat script help.
From the main project directory:
make
for automatically detecting architecture and building accordinglymake ARCH=i386
for x86 32-bit buildsmake ARCH=x86_64
for x86 64-bit buildsmake ARCH=arm64
for arm64 Mac 64-bit buildsmake V=No
for a silent build (not showing the actual compiler commands)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)
The command line programsh264enc
andh264dec
will appear in the main project directory.
A shell script to run the command-line apps is intestbin/CmdLineExample.sh
Usage information can be found intestbin/CmdLineReadMe
Meson build definitions have been added, and are known to work on Linuxand Windows, for x86 and x86 64-bit.
Seehttp://mesonbuild.com/Installing.html for instructions on how toinstall meson, then:
meson setup builddirninja -C builddir
Run the tests with:
mesontest -C builddir -v
Install with:
ninja -C builddir install
codec
- encoder, decoder, console (test app), build (makefile, vcproj)build
- scripts for Makefile build systemtest
- GTest unittest filestestbin
- autobuild scripts, test app config filesres
- yuv and bitstream test files
See the issue tracker onhttps://github.com/cisco/openh264/issues
- Encoder errors when resolution exceeds 3840x2160
- Encoder errors when compressed frame size exceeds half uncompressed size
- Decoder errors when compressed frame size exceeds 1MB
- Encoder RC requires frame skipping to be enabled to hit the target bitrate,if frame skipping is disabled the target bitrate may be exceeded
BSD, seeLICENSE
file for details.
About
Open Source H.264 Codec