This repository has been archived by the owner on Oct 31, 2022. It is now read-only.
Hap QuickTime Codec version 12
Change since version 11:
- Fix an issue which prevented some software from correctly encoding Hap Q Alpha.
Hap QuickTime Codec version 11
Change since version 10:
- Fix an issue which could cause slow performance of the encoder for some frame dimensions
Hap QuickTime Codec version 10
Change since version 9:
- Add support for Hap Q Alpha
Hap QuickTime Codec version 9
Change since version 8:
- Fix issue which caused crashes encoding Hap Q on Windows.
Hap QuickTime Codec version 8
Change since version 6:
- Reduce memory usage, increasing the maximum possible frame size.
Hap QuickTime Codec version 7
Improve memory usage, increasing the maximum possible frame size.
Fixes #20
Hap QuickTime Codec version 6
Change since version 5:
- Fix an issue which caused rendering large frames to fail in Adobe After Effects.
Hap QuickTime Codec version 5
Change since version 4:
- Avoid an issue with QuickTime which prevented the codec functioning on Windows when the system language was set to some non-Latin scripts.
Hap QuickTime Codec version 4
Change since version 3:
- Fix a pair of issues which in some circumstances resulted in garbled edge-pixels when encoding movies with dimensions which weren’t a multiple of four.
Hap QuickTime Codec version 3
Changes since version 2:
- Support for Windows
- Improved playback for some Hap movies
Movies that are encoded with the HAP codecs are typically exported into standard .mov or .avi containers just like other video files you are used to working with.
Choosing The Right Codec For The Job: HAP, HAP Alpha, HAP Q and HAP Q Alpha
There are four different flavors of HAP to choose from when encoding your clips.
- HAP has the lowest data-rate and reasonable image quality.
- HAP Alpha has the same image quality as HAP, and supports an Alpha channel.
- HAP Q has improved image quality, at the expense of larger file sizes.
- HAP Q Alpha has improved image quality and an Alpha channel, at the expense of larger file sizes.
Some encoders allow for encoding with an optional specified ‘chunk’ size to optimize for ultra high resolution video on a particular hardware system. This setting should typically only be used if you are reaching a CPU performance bottleneck during playback. As a general guide, for HD footage or smaller you can set the chunk size to 1 and for 4k or larger footage the number of chunks should never exceed the number of CPU cores on the computer used for playback.
For encoding to HAP from Adobe AfterEffects, first export to an intermediate format and use one of the below solutions, or try the 3rd party AfterCodecs plugin.
Additionally some media servers provide their own method for importing media to convert to HAP and can be used as an alternative where available. Consult the documentation for the systems you are working with for more information.
Transcoding to HAP using QuickTime export
Many applications and batch exporters support QuickTime as an export option which includes a standard option panel for codec selection and parameter adjustment. When the HAP QuickTime component is installed, the HAP, HAP Alpha, HAP Q and HAP Q Alpha options will show up in the «Compression Type» menu. When using HAP and HAP Alpha a slider is provided for adjusting the output quality level.
Batch Exporting on macOS with the AVF Batch Exporter
- Files To Convert: Drag movie files to this area from the Finder or click the Import button to select media to be transcoded.
-
Output Format: Click the ‘Settings’ button to open the panel for adjusting the audio and video codec setting options. For audio and video you can specify whether the media should be transcoded or left unchanged.
In addition to specifying a video codec, when using the HAP codecs the following sub options may appear depending on the format.
- Quality: When available adjusts the overall tradeoff between image quality and encoding speed.
- Chunked Encoding/Decoding: For the HAP codecs a chunking size can be set as an optimization for specific hardware. The default is 1 and should never exceed the number of CPU cores in the playback system.
- File Renaming and Destination Folder: Optional settings for removing, appending or prefixing characters to the file name string and adjusting the output folder.
Encoding to HAP from the command line using FFmpeg
For users who prefer working with a command line or need to access advanced encoding settings for HAP, FFmpeg can be used to work with HAP movies.
Installing FFmpeg
If this is your first time using FFmpeg you may need to install it on your system, or compile it from source. In either case be sure that Snappy is enabled as part of the binary. If you already have FFmpeg on your system with Snappy enabled, you can skip this step.
You can check that your version of FFmpeg can encode HAP using
ffmpeg -encoders | grep hap
If the last line of output ends with Vidvox HAP encoder
then you can encode HAP. Otherwise install FFmpeg using one of these methods:
-
On macOS you can use Homebrew to install FFmpeg with the following command:
brew install ffmpeg --with-snappy
- The semi-official Windows FFmpeg downloads have Snappy support enabled.
- Ubuntu Linux and some other distributions have Snappy support enabled
- Visit the FFmpeg wiki for instructions on how to compile FFmpeg for macOS, Windows and Linux. Along with the other options you choose, you must pass
--enable-libsnappy
to the configure script before building.
Invoke FFmpeg to convert your files.
-
For HAP movies use the following command:
ffmpeg -i yourSourceFile.mov -c:v hap outputName.mov
-
For HAP Alpha movies use the following command:
ffmpeg -i yourSourceFile.mov -c:v hap -format hap_alpha outputName.mov
-
For HAP Q movies use the following command:
ffmpeg -i yourSourceFile.mov -c:v hap -format hap_q outputName.mov
In addition you can also specify the following optional flags that can be used to create HAP movies that are highly optimized for specific playback hardware. You should only use these in extreme cases if you have reached a specific bottleneck when using the default settings.
-
-chunks N
(default is 1; N is a number from 1-64 that does not exceed the number of CPU cores in the playback system)ffmpeg -i yourSourceFile.mov -c:v hap -format hap_q -chunks 4 outputName.mov
-
-compressor snappy
or-compressor none
(default is snappy; when set to none may marginally reduce CPU usage in exchange for much larger file sizes that are a fixed bit-rate)ffmpeg -i yourSourceFile.mov -c:v hap -compressor none outputName.mov
Encoding a set of images to HAP using FFmpeg
Hap QuickTime Codec
Hap is a video codec for fast decompression on modern graphics hardware. This is the home of the Hap QuickTime codec. For general information about Hap, see the Hap project.
The Hap QuickTime codec supports encoding and decoding Hap video. Video can be decoded to RGB(A) formats for playback in any existing application, or if an application explicitly requests it, to compressed texture formats for accelerated playback on graphics hardware.
Note that there is no advantage to using Hap over other codecs if the application you will be using for playback does not support accelerated Hap playback.
For information and example code to support accelerated playback via this codec in your application, see the Hap sample code.
Download
An installer for the Hap QuickTime component can be downloaded from the Releases page.
Requires at minimum MacOS 10.6 Snow Leapord, or Windows Vista with QuickTime 7 installed.
Using the Hap QuickTime Codec
After installation, the codec will show up when exporting video in applications which support QuickTime. Four variants of the codec exist:
- Hap — Reasonable image quality
- Hap Alpha — Reasonable image quality with an alpha channel
- Hap Q — Good image quality at a higher data-rate
- Hap Q Alpha — Good image quality with an alpha channel at a higher data-rate
Hap and Hap Alpha have a quality setting. Although QuickTime displays a slider, it has only two effective settings: below «High» a fast low-quality encoder is used, and at «High» or above a slower high-quality encoder is used.
Note that the current QuickTime Player on macOS does not support non-Apple codecs. Use QuickTime Player 7 or a third-party player.
Other software for encoding and decoding Hap
- AfterCodecs
- AVF Batch Converter
- ffmpeg
- Hap for DirectShow
- TouchDesigner
- VLC
Open-Source
The Hap codec project is open-source, licensed under a FreeBSD License, meaning you can use it in your commercial or non-commercial applications free of charge.
This project was originally written by Tom Butterworth and commissioned by VIDVOX, 2012.
Опенсурсовый видеокодек Hap для Windows и Mac
Итак, допустим, у вас есть ноутбук, и вы хотите проиграть несколько видео потоков. Возможно, это не самый быстрый ноутбук или это самый обычный ноутбук, который вы обновили, добавив SSD-диск.
А может быть, вы нашли работу вашей мечты, и вам нужно организовать представление. В вашем распоряжении 52 проектора и 26 слоёв видео. А вы хотите создать эффектное представление, но вот беда, бюджета не хватило на закупку высококлассного медиа-сервера.
В любом случае, Hap — это то, что вам нужно. Это опенсурсовый видеокодек, работающий на графическом процессоре. Основная идея кодека — разгрузить CPU, перенеся вычисления на GPU, и добиться баланса между качеством и размером файла, который бы позволил работать со множеством HD-видео одновременно. Изначально, кодек был разработкой команды Vidvox (создателей VDMX) и Тома Баттерворфа. Но после того, как кодек стал опенсурсовым, множество людей приняло участие в его разработке и портировании под другие платформы.
Сейчас Hap портирован под Windows. Вы можете использовать его с:
- TouchDesigner;
- OpenFrameworks (c ofxHapPlayer [https://github.com/bangnoise/ofxHapPlayer] (в том числе и под Mac);
- Jitter (jit.gl.hap [http://cycling74.com/toolbox/jit-gl-hap/] (в том числе и под Mac);
- DirectShow (для приложений, использующих этот API доступна поддержка, в том числе и для плагина QuickTime в Unity);
- скоро кодек можно будет использовать с D3 Media Servers и Isadora
В Mac можно использовать кодек в Unity Game Engine (одно это уже хорошо), OpenFrameworks, Cinder, Jitter, Modul8, Millumin, CoGe, большинстве виджейских приложений, и (в скором времени) в Isadora.
Сейчас уже существуют проекты с использованием кодека Hap — например, инсталляция “Renaissance” (“Ренессанс”) с 52 проекторами и 26 видеослоями -, показанная на самом верхнем фото. На фото ниже показан патч проекта в TouchDesigner.
Посмотрите, сколько элементов. Можете не пытаться делать подобное с другими кодеками.
Начать знакомство с кодеком можно с блога, посвященного Hap
Код кодека находится на https://github.com/vidvox/hap
Tags:
codecs
, derivative
, game-engine
, gaming
, GPGPU
, GPU
, hap
, installation
, Jitter
, Mac
, openframeworks
, OS-X
, software
, touchdesigner
, Unity
, vdmx
, video
, vidvox
, Windows
Last year in a collaboration Tom Butterworth we had the pleasure of sharing a powerful new set of open source video codecs called Hap with the Mac real-time video community. The goal of Hap was to serve a broad audience with the same need to push more pixels, benefiting everyone from show designers on expensive media servers handling 2k and 4k arrays to weekend VJs now able to playback multiple HD streams off a laptop.
One thing we’ve learned about artists in our time writing video performance software is that in the real world they take advantage of all kinds of tools for different projects and to create their unique visual style. With every new application that adds native support for the Hap suite, now counting at more than a dozen, it makes it easier to get the best performance regardless of what software is used to get a job done.
This mixing and matching of software isn’t limited to a single platform and today we’re extremely excited to announce that the GPU accelerated codec of choice on the Mac is now officially supported on Windows!
As of this announcement, the Hap video codec family can now be natively used on Windows in TouchDesigner, OpenFrameworks (via ofxHapPlayer), Jitter (via jit.gl.hap), DirectShow and Unity (via RenderHeads AVProQuicktime), with support coming very soon to D3 Media Servers and the Isadora programming environment.
To celebrate, we’ve updated the Hap homepage to include our new photo gallery of the various applications and frameworks that have adopted the format on both platforms. The homepage is also the place to check out how Hap compares to other commonly used codecs for live visuals.