AVS Device SDK Captions


By default, the SDK disables the use of captions. To enable captions, use the CMake build option CAPTIONS=ON. You must also install the libwebvtt parsing library. Webvtt is a C/C++ library for interpreting and authoring WebVTT content. WebVTT is a caption and subtitle format designed for use with HTML5 audio and video elements.

By default, captions works with the en-US locale. If you want to support another locale, modify the line break logic in the CaptionManager::onParsed() method and use a locale-safe method for determining the break points between words. For example, you can use the ICU BreakIterator to handle the task. You must determine the exact method of this implementation yourself.

To enable captions to your device

  1. Download and install libwebvtt to a directory of your choice. If there are any additional instructions on the libwebvtt page, make sure you follow them.
  2. Build the AVS Device SDK and configure your CMake command with the following flags.

     -DCAPTIONS=ON \
     -DLIBWEBVTT_LIB_PATH=$HOME/captions/webvtt-master/build/src/webvtt/libwebvtt.a \
     -DLIBWEBVTT_INCLUDE_DIR=$HOME/captions/webvtt-master/include
    

Was this page helpful?

Last updated: Apr 21, 2022