# openh264 **Repository Path**: HarmonyOS-tpc/openh264 ## Basic Information - **Project Name**: openh264 - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-2-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-09-17 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README openh264 =============== ## Introduction OpenH264 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. ## Usage Instructions Encoder Features - 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 Decoder Features ---------------- - 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 ## Installation Instructions ``` steps to build native code: a) Copy openh264 folder to linux machine b) To build You need to install sdk and ndk. You also need to export `**SDK**/tools` to PATH. On Linux, this can be done by export PATH=**SDK**/tools:$PATH The codec and demo can be built by make OS=**OS** NDKROOT=**NDK** TARGET=**TARGET** Valid `**TARGET**` can be found in `**SDK**/platforms`. You can also set `ARCH`, `NDKLEVEL` according to your device and NDK version. `ARCH` specifies the architecture of 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.) `NDKLEVEL` specifies api level, the default is 12. Available possibilities can be found in `**NDK**/platforms` By default these commands build for the `armeabi-v7a` ABI. To build for the other ABIs, add `ARCH=arm64`, `ARCH=x86`, `ARCH=x86_64`, `ARCH=mips` or `ARCH=mips64`. To build for the older `armeabi` ABI (which has armv5te as baseline), add `APP_ABI=armeabi` (`ARCH=arm` is implicit). To build for 64-bit ABI, such as `arm64`, explicitly set `NDKLEVEL` to 21 or higher. c) libopenh264.so and libstport.so files will be genrated steps to generate libencoding.so and libdecoding.so file to sample app. a) Create .cpp files for encoding, auto encoding and decoding fetures in src/main/cpp directory of the entry b) place liopenh264.so file in src/main/cpp/lib/arm64-v8a folder b) Create CMakeLists.txt to build native code and create shared library libencoding.so and libdecoding.so. c) Add below native build configuration in build file of entry. externalNativeBuild { path "src/main/cpp/CMakeLists.txt" arguments "-v" abiFilters "arm64-v8a" } steps to build sample app: a) place libencoding.so, libdecoding.so, libopenh264.so, libc++.so and libstlport.so in /entry/libs/arm64-v8a b) load libencoding.so, libdecoding.so, libopenh264.so and libstlport.so in sample app c) check the sample app for implementation d) For using openh264 library from a remote repository in separate application, add the below dependency in entry/build.gradle file. dependencies { implementation 'io.openharmony.tpc.thirdlib:openh264:1.0.0' } ``` ## LICENSE ------- BSD, see `LICENSE` file for details.