Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kvazaar

> 开发工具
Open source

An open-source HEVC encoder

962 stars0 likes1 views
WebsiteGitHub

About

An open-source HEVC encoder

Kvazaar

An open-source HEVC encoder licensed under 3-clause BSD

Join channel #ultravideo in Libera.Chat IRC network to contact us or come to our Discord

Kvazaar is still under development. Speed and RD-quality will continue to improve.

http://ultravideo.fi/#encoder for more information.

  • Linux
  • Windows

Table of Contents

  • Using Kvazaar
    • Example:
    • Parameters
    • LP-GOP syntax
  • Presets
  • Kvazaar library
  • Compiling Kvazaar
    • Required libraries
    • Range extensions (4:2:2 and 4:4:4)
    • Autotools
    • Autotools on MinGW
    • OS X
    • Visual Studio
    • Docker
    • Visualization (Windows only)
  • Paper
  • Contributing to Kvazaar
    • Code documentation
    • For version control we try to follow these conventions:
    • Testing
    • Unit tests
    • Code style

Using Kvazaar

Example:

kvazaar --input BQMall_832x480_60.yuv --output out.hevc

The mandatory parameters are input and output. If the resolution of the input file is not in the filename, or when pipe is used, the input resolution must also be given: --input-res=1920x1080.

The default input format is 8-bit yuv420p for 8-bit and yuv420p10le for 10-bit. Input format and bitdepth can be selected with --input-format and --input-bitdepth.

Speed and compression quality can be selected with --preset, or by setting the options manually.

Parameters

…

LP-GOP syntax

The LP-GOP syntax is "lp-g(num)d(num)t(num)", where

  • g = GOP length.
  • d = Number of GOP layers.
  • t = How many references to skip for temporal scaling, where 4 means only every fourth picture needs to be decoded.
QP
+4  o o o o  
+3   o   o    o o o o
+2     o       o o o    ooooooo
+1 o       o o       o o       o ooooooooo
   g8d4t1    g8d3t1    g8d2t1    g8d1t1

Presets

The names of the presets are the same as with x264: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow and placebo. The effects of the presets are listed in the following table, where the names have been abbreviated to fit the layout in GitHub.

0-uf 1-sf 2-vf 3-fr 4-f 5-m 6-s 7-sr 8-vs 9-p
rd 0 0 0 0 0 0 1 2 3 3
pu-depth-intra 2-3 2-3 2-3 2-3 1-3 1-4 1-4 1-4 1-4 1-4
pu-depth-inter 1-2 1-2 1-3 1-3 1-3 0-3 0-3 0-3 0-3 0-3
me hexbs hexbs hexbs hexbs hexbs hexbs hexbs hexbs tz tz
gop 8 8 8 8 8 16 16 16 16 16
ref 1 1 1 1 2 4 4 4 4 4
bipred 1 1 1 1 1 1 1 1 1 1
deblock 1 1 1 1 1 1 1 1 1 1
signhide 0 0 0 0 0 0 0 1 1 1
subme 0 2 2 4 4 4 4 4 4 4
sao off full full full full full full full full full
rdoq 0 0 0 0 0 1 1 1 1 1
rdoq-skip 0 0 0 0 0 0 0 0 0 0
transform-skip 0 0 0 0 0 0 0 0 1 1
mv-rdo 0 0 0 0 0 0 0 0 0 1
full-intra-search 0 0 0 0 0 0 0 0 0 0
smp 0 0 0 0 0 0 0 0 1 1
amp 0 0 0 0 0 0 0 0 1 1
cu-split-termination zero zero zero zero zero zero zero zero zero off
me-early-termination sens. sens. sens. sens. sens. on on off off off
intra-rdo-et 0 0 0 0 0 0 0 0 0 0
early-skip 1 1 1 1 1 1 1 1 1 0
fast-residual-cost 28 28 28 0 0 0 0 0 0 0
max-merge 5 5 5 5 5 5 5 5 5 5

Kvazaar library

See kvazaar.h for the library API and its documentation.

When using the static Kvazaar library on Windows, macro KVZ_STATIC_LIB must be defined. On other platforms it's not strictly required.

The needed linker and compiler flags can be obtained with pkg-config.

Compiling Kvazaar

If you have trouble regarding compiling the source code, please make an issue about in Github. Others might encounter the same problem and there is probably much to improve in the build process. We want to make this as simple as possible.

Range Extensions

Add -DKVZ_RANGE_EXTENSION to CFLAGS for 4:2:2 and 4:4:4 support, there is some speed penalty to 4:2:0 just by enabling it so it's disabled by default.

With CMake -DUSE_RANGE_EXTENSION=ON can be used.

Autotools

Depending on the platform, some additional tools are required for compiling Kvazaar with autotools. For Ubuntu, the required packages are automake autoconf libtool m4 build-essential.

Run the following commands to compile and install Kvazaar.

bash
./autogen.sh
./configure
make
sudo make install
sudo ldconfig

See ./configure --help for more options. When building shared library with visual studio the tests will fail to link, the main binary will still work

Autotools on MinGW

It is recommended to use Clang instead of GCC in MinGW environments. GCC also works, but AVX2 optimizations will be disabled because of a known GCC issue from 2012, so performance will suffer badly. Instead of ./configure, run

CC=clang ./configure

to build Kvazaar using Clang.

CMake

Depending on the platform, some additional tools are required for compiling Kvazaar with CMake. For Ubuntu, the required packages are build-essential cmake.

OS X

  • Install Homebrew
  • run brew install automake libtool yasm
  • Refer to Autotools instructions

Visual Studio

  • At least VisualStudio 2015.2 is required.
  • Project files can be found under build/.
  • Requires external vsyasm.exe in %PATH%

Docker

This project includes a Dockerfile, which enables building for Docker. Kvazaar is also available in the Docker Hub ultravideo/kvazaar Build using Docker: docker build -t kvazaar . Example usage: docker run -i -a STDIN -a STDOUT kvazaar -i - --input-res=320x240 -o - out.265 For other examples, see Dockerfile

Visualization (Windows only)

Compiling kvazaar_cli project in the visualizer branch results in a Kvazaar executable with visualization enabled.

Additional Requirements: SDL2, SDL2-ttf.

Directory visualizer_extras has to be added into the same directory level as the kvazaar project directory. Inside should be directories include and lib found from the development library zip packages.

SDL2.dll, SDL2_ttf.dll, libfreetype-6.dll, and zlib1.dll should be placed in the working directory (i.e. the folder the kvazaar.exe is in after compiling the kvazaar_cli project/solution) when running the visualizer. The required .dll can be found in the aforementioned lib-folder (lib\x64).

Note: The solution should be compiled on the x64 platform in visual studio.

Optional font file arial.ttf is to be placed in the working directory, if block info tool is used.

Paper

Please cite this paper for Kvazaar:

M. Viitanen, A. Koivula, A. Lemmetti, A. Ylä-Outinen, J. Vanne, and T. D. Hämäläinen, “Kvazaar: open-source HEVC/H.265 encoder,” in Proc. ACM Int. Conf. Multimedia, Amsterdam, The Netherlands, Oct. 2016.

Or in BibTex:

@inproceedings{Kvazaar2016,
 author = {Viitanen, Marko and Koivula, Ari and Lemmetti, Ari and Yl\"{a}-Outinen, Arttu and Vanne, Jarno and H\"{a}m\"{a}l\"{a}inen, Timo D.},
 title = {Kvazaar: Open-Source HEVC/H.265 Encoder},
 booktitle = {Proceedings of the 24th ACM International Conference on Multimedia},
 year = {2016},
 isbn = {978-1-4503-3603-1},
 location = {Amsterdam, The Netherlands},
 url = {http://doi.acm.org/10.1145/2964284.2973796},
}

Contributing to Kvazaar

We are happy to look at pull requests in Github. There is still lots of work to be done.

Code documentation

You can generate Doxygen documentation pages by running the command "doxygen docs.doxy". Here is a rough sketch of the module structure:

For version control we try to follow these conventions:

  • Master branch always produces a working bitstream (can be decoded with HM).
  • Commits for new features and major changes/fixes put to a sensibly named feature branch first and later merged to the master branch.
  • Always merge the feature branch to the master branch, not the other way around, with fast-forwarding disabled if necessary.
  • Every commit should at least compile.

Testing

  • Main automatic way of testing is with Travis CI. Commits, branches and pull requests are tested automatically.
    • Uninitialized variables and such are checked with Valgrind.
    • Bitstream validity is checked with VTM.
    • Compilation is checked on GCC and Clang on Linux, and Clang on OSX.
  • Windows msys2 and msvc builds are checked automatically on Appveyor.
  • If your changes change the bitstream, decode with HM to check that it doesn't throw checksum errors or asserts.
  • If your changes shouldn't alter the bitstream, check that they don't.
  • Automatic compression quality testing is in the works.

Unit tests

  • There are some unit tests located in the tests directory. We would like to have more.

  • The Visual Studio project links the unit tests against the actual .lib file used by the encoder. There is no Makefile as of yet.

  • The unit tests use "greatest" unit testing framework. It is included as a submodule, but getting it requires the following commands to be run in the root directory of kvazaar:

    bash
      git submodule init
      git submodule update
    
  • On Linux, configure kvazaar with ./configure --enable-static, run make check.

Code style

We try to follow the following conventions:

  • C99 without features not supported by Visual Studio 2015 (VLAs).
  • // comments allowed and encouraged.
  • Follow overall conventions already established in the code.
  • Indent by 2 space

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ch265hevcvideo

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具