|
HVD
HVD Hardware Video Decoder library
|
This library wraps hardware video decoding in a simple interface. There are no performance loses (at the cost of library flexibility).
Currently it supports VAAPI, VDPAU (tested) and a few other hardware decoders (not tested). Various codecs are supported (e.g. H.264, HEVC, VP8, VP9)
See library documentation.
See also twin HVE Hardware Video Encoder library.
See hardware-video-streaming for other related projects.
Raw H.264 (and other codecs) decoding:
Complex pipelines (demuxing, scaling, color conversions, filtering) are beyond the scope of this library.
Cross-platform but tested only on Linux (Ubuntu 18.04).
Tested with:
Also implemented (but not tested):
Library depends on:
avcodec and avutil (at least 3.4 version)Works with system FFmpeg on Ubuntu 18.04 and doesn't on 16.04 (outdated FFmpeg and VAAPI ecosystem).
Tested on Ubuntu 18.04.
Follow with printed usage examples.
See examples directory for a more complete and commented examples with error handling.
There are just 4 functions and 3 user-visible data types:
hvd_inithvd_send_packet (sends compressed data to hardware)hvd_receive_frame (retrieves uncompressed data from hardware)hvd_closeThat's it! You have just seen all the functions and data types in the library.
You have several options.
For static linking of HVD and dynamic linking of FFmpeg libraries (easiest):
hvd.h and hvd.c to your project and add them in your favourite IDEavcodec and avutil to linked libraries in IDE project configurationFor dynamic linking of HVD and FFmpeg libraries:
hvd.h where compiler can find it (e.g. make install for /usr/local/include/hvd.h)libhvd.so where linker can find it (e.g. make install for /usr/local/lib/libhvd.so)/usr/local/... is considered for librarieshvd, avcodec and avutil to linked libraries in IDE project configurationlibhvd.so is reachable to you program at runtime (e.g. set LD_LIBRARIES_PATH)Assuming directory structure with HVD as hardware-video-decoder subdirectory (or git submodule) of your project.
You may use the following top level CMakeLists.txt
Assuming your main.c/main.cpp and hvd.h, hvd.c are all in the same directory:
C
C++
Library is licensed under Mozilla Public License, v. 2.0
This is similiar to LGPL but more permissive:
Like in LGPL, if you modify this library, you have to make your changes available. Making a github fork of the library with your changes satisfies those requirements perfectly.
You are linking to FFmpeg libraries. Consider also avcodec and avutil and the codec licensing.