Top Related Projects
Quick Overview
libde265 is an open-source implementation of the H.265/HEVC video codec. It provides a fast and efficient decoder for HEVC video streams, supporting both 8-bit and 10-bit video. The library is written in C++ and can be used in various applications for video playback and processing.
Pros
- High performance and efficient decoding of HEVC video streams
- Cross-platform compatibility (Windows, macOS, Linux)
- Supports both 8-bit and 10-bit video
- Actively maintained with regular updates
Cons
- Limited encoding capabilities (primarily focused on decoding)
- May require additional dependencies for optimal performance
- Documentation could be more comprehensive
- Learning curve for developers new to video codec implementations
Code Examples
- Initializing the decoder:
#include <libde265/de265.h>
de265_decoder_context* ctx = de265_new_decoder();
de265_error err = de265_start_worker_threads(ctx, 4); // Start 4 worker threads
- Decoding a frame:
const uint8_t* data = /* ... */; // Input data
int data_size = /* ... */; // Input data size
de265_push_data(ctx, data, data_size, 0, nullptr);
int more = 0;
de265_error err = de265_decode(ctx, &more);
if (err == DE265_OK) {
const de265_image* img = de265_get_next_picture(ctx);
// Process the decoded image
}
- Accessing decoded image data:
const de265_image* img = /* ... */; // Decoded image
int width = de265_get_image_width(img, 0);
int height = de265_get_image_height(img, 0);
const uint8_t* y_plane = de265_get_image_plane(img, 0, &stride);
const uint8_t* cb_plane = de265_get_image_plane(img, 1, &stride);
const uint8_t* cr_plane = de265_get_image_plane(img, 2, &stride);
Getting Started
-
Clone the repository:
git clone https://github.com/strukturag/libde265.git
-
Build the library:
cd libde265 mkdir build && cd build cmake .. make
-
Include the library in your project:
#include <libde265/de265.h>
-
Link against the library when compiling your application:
g++ -o your_app your_app.cpp -lde265
Competitor Comparisons
Mirror of https://git.ffmpeg.org/ffmpeg.git
Pros of FFmpeg
- Comprehensive multimedia framework supporting a wide range of formats and codecs
- Extensive documentation and large community support
- Actively maintained with frequent updates and improvements
Cons of FFmpeg
- Large codebase and complex architecture, potentially steeper learning curve
- Higher resource requirements due to its comprehensive nature
- May be overkill for projects only requiring H.265/HEVC functionality
Code Comparison
FFmpeg (libavcodec/hevc.c):
static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
{
int i, consumed, ret = 0;
s->ref = NULL;
s->eos = 0;
libde265 (libde265/slice.cc):
bool slice_segment_header::read(bitreader* br, class decoder_context* ctx)
{
first_slice_segment_in_pic_flag = get_bits(br,1);
if (ctx->get_RapPicFlag()) {
no_output_of_prior_pics_flag = get_bits(br,1);
}
Both repositories focus on video coding, but FFmpeg is a more comprehensive multimedia framework, while libde265 specifically targets H.265/HEVC decoding. FFmpeg offers broader functionality but may be more complex, while libde265 provides a more focused solution for H.265 decoding.
libavif - Library for encoding and decoding .avif files
Pros of libavif
- Supports the newer AV1 Image File Format (AVIF), which offers better compression and quality than HEVC
- More active development and community support
- Broader compatibility with modern web browsers and platforms
Cons of libavif
- Potentially slower encoding/decoding compared to libde265 due to AV1's complexity
- Higher computational requirements for optimal performance
- Less mature technology, may have more bugs or inconsistencies
Code Comparison
libavif:
avifResult avifEncoderWrite(avifEncoder * encoder, const avifImage * image, avifRWData * output)
{
// Encoding logic for AVIF
}
libde265:
de265_error de265_encode_image(de265_encoder_context* ctx, const struct de265_image* img, int* more_data_to_come)
{
// Encoding logic for HEVC
}
Both libraries provide similar encoding functions, but libavif is specifically designed for AVIF format, while libde265 focuses on HEVC encoding. The function signatures and parameters differ, reflecting the unique requirements of each format.
The fastest and safest AV1 encoder.
Pros of rav1e
- Written in Rust, offering memory safety and performance benefits
- Implements the more modern AV1 video codec, which provides better compression efficiency
- Active development with frequent updates and contributions
Cons of rav1e
- Potentially slower encoding speed compared to libde265's HEVC implementation
- Less mature and may have fewer tools and integrations available
- Larger file size due to the complexity of the AV1 codec
Code Comparison
rav1e (Rust):
let mut ctx: Context<u8> = Config::default()
.with_threads(4)
.with_encoder_config(EncoderConfig::default())
.new_context()
.unwrap();
libde265 (C):
de265_decoder_context* ctx = de265_new_decoder();
de265_error err = de265_start_worker_threads(ctx, 4);
Both examples show initialization of the encoder/decoder context with 4 threads, but rav1e's Rust implementation offers a more fluent and type-safe approach.
Perceptual video quality assessment based on multi-method fusion.
Pros of VMAF
- Focuses on video quality assessment, providing a perceptual quality metric
- Actively maintained by Netflix with regular updates and improvements
- Includes pre-trained models and tools for easy integration
Cons of VMAF
- More specialized, primarily for video quality measurement
- Requires more computational resources for analysis
- Less suitable for general-purpose video encoding/decoding tasks
Code Comparison
VMAF (Python):
import vmaf
model = vmaf.VmafModel()
score = model.compute_score(reference_video, distorted_video)
libde265 (C):
#include <libde265/de265.h>
de265_decoder_context* ctx = de265_new_decoder();
de265_push_data(ctx, data, data_size, 0);
de265_decode(ctx, &more);
Additional Notes
VMAF is tailored for video quality assessment, while libde265 is a HEVC/H.265 decoder library. VMAF provides tools for measuring perceived video quality, whereas libde265 focuses on efficient video decoding. The choice between them depends on the specific use case: VMAF for quality analysis, libde265 for HEVC decoding in applications or media players.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
libde265 - open h.265 codec implementation
libde265 is an open source implementation of the h.265 video codec. It is written from scratch and has a plain C API to enable a simple integration into other software.
libde265 supports WPP and tile-based multithreading and includes SSE optimizations. The decoder includes all features of the Main profile and correctly decodes almost all conformance streams (see [wiki page]).
A list of supported features are available in the wiki.
For latest news check our website at http://www.libde265.org
The library comes with two example programs:
-
dec265, a simple player for raw h.265 bitstreams. It serves nicely as an example program how to use libde265.
-
sherlock265, a Qt-based video player with the additional capability to overlay some graphical representations of the h.265 bitstream (like CU-trees, intra-prediction modes).
Example bitstreams can be found, e.g., at this site: ftp://ftp.kw.bbc.co.uk/hevc/hm-10.1-anchors/bitstreams/ra_main/
Approximate performance for WPP, non-tiles streams (measured using the timehevc
tool from the GStreamer plugin).
The tool plays a Matroska movie to the GStreamer fakesink and measures
the average framerate.
Resolution | avg. fps | CPU usage |
---|---|---|
720p | 284 fps | 39 % |
1080p | 150 fps | 45 % |
4K | 36 fps | 56 % |
Environment:
- Intel(R) Core(TM) i7-2700K CPU @ 3.50GHz (4 physical CPU cores)
- Ubuntu 12.04, 64bit
- GStreamer 0.10.36
Building
If you got libde265 from the git repository, you will first need to run
the included autogen.sh
script to generate the configure
script.
libde265 has no dependencies on other libraries, but both optional example programs have dependencies on:
-
SDL2 (optional for dec265's YUV overlay output),
-
Qt (required for sherlock265),
-
libswscale (required for sherlock265 if libvideogfx is not available).
-
libvideogfx (required for sherlock265 if libswscale is not available, optional for dec265).
Libvideogfx can be obtained from http://www.dirk-farin.net/software/libvideogfx/index.html or http://github.com/farindk/libvideogfx
You can disable building of the example programs by running ./configure
with
--disable-dec265 Do not build the dec265 decoder program. --disable-sherlock265 Do not build the sherlock265 visual inspection program.
Additional logging information can be turned on and off using these ./configure
flags:
--enable-log-error turn on logging at error level (default=yes) --enable-log-info turn on logging at info level (default=no) --enable-log-trace turn on logging at trace level (default=no)
Build using cmake
cmake scripts to build libde265 and the sample scripts dec265
and enc265
are
included and can be compiled using these commands:
mkdir build
cd build
cmake ..
make
See the cmake documentation for further information on using cmake on other platforms.
Building using vcpkg
You can build and install libde265 using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install libde265
The libde265 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
Prebuilt binaries
Binary packages can be obtained from this launchpad site.
Software using libde265
Libde265 has been integrated into these applications:
-
gstreamer plugin, source, binary packages.
-
VLC plugin source, binary packages.
-
Windows DirectShow filters, https://github.com/strukturag/LAVFilters/releases
-
ffmpeg fork, https://github.com/farindk/ffmpeg
-
ffmpeg decoder source
Packaging status
License
The library libde265
is distributed under the terms of the GNU Lesser
General Public License. The sample applications are distributed under
the terms of the MIT license.
See COPYING
for more details.
The short video clip in the 'testdata' directory is from the movie 'Girl Shy', which is in the public domain.
Copyright (c) 2013-2014 Struktur AG Copyright (c) 2013-2023 Dirk Farin Contact: Dirk Farin dirk.farin@gmail.com
Top Related Projects
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot