How to use HAP

Converting your videos into HAP

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.

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.

The HAP QuickTime component installs as part of many software packages, or can be downloaded from the GitHub releases page.

The AVF Batch Exporter is a free simple transcoding tool is arranged into three settings panels and can be used to convert multiple files to the specified output codec settings in a single export session.

Batch Exporting on macOS with the AVF Batch Exporter

  1. Files To Convert: Drag movie files to this area from the Finder or click the Import button to select media to be transcoded.
  2. 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.
  3. 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