Aurora1 RTC Sample Encoder

Introduction to the Aurora1 RTC Sample Encoder

wzav1_sample_encoder is a simple example encoder program demonstrating the use of the API that may be built from source code contained within the Aurora1-RTC SDK package.

Parameters may be modified in the code and the application built and linked with the provided Aurora libraries.

Running the wzav1_sample_encoder

The usage of wzav1_sample_encoder shown as below:

Usage: wzav1_sample_encoder.exe <width> <height> <fps-num> <in-yuv> <outfile> <preset> <tune> <rc-type> <target-bitrate/crf> <frames to encode> [debug-log] [extra_cfg]
Sample: 1920 1080 30 in.yuv out.ivf superfast camera cbr 800 100 1 threads=4:keyint_max=250
presets: ultrafast superfast veryfast fast medium
tunes: screen camera adaptive
rc-types: cbr q

You can find more details listed as below for each parameter

  width             <int>        ..... Set frame width (from 0 to 4096)
  height            <int>        ..... Set frame height (from 0 to 4096)
  fps-num           <int>        ..... Set frame per seconds (from 1 to 120)
  in-yuv            <string>     ..... Set path of encoding sequence (only 8bit yuv420p is supported)
  outfile           <string>     ..... Set path of output file (both ivf/obu are supported)
  preset            <string>     ..... Set preset (supported presets listed in wzav1enc.h) parameter
  tune              <string>     ..... Set tune(screen/camera/adaptive) parameter
  rctype            <string>     ..... Set rate control type(cbr/q) parameter
  target-bitrate/crf<int>        ..... Set target-bitrate(kbps) or crf values(from 1 to 63)
  frames to encode  <int>        ..... Set frames to be encoded (from -1 to INT_MAX, -1 means maximal availabe frames)
  debug-log         <int>        ..... Set whether output debug logs or not (1: enable, 0: disable, default is 0), can be skipped
  extra_cfg         <string>     ..... Set extra configurations (use ":" to separate different params), can be skipped

You can use the different tune options for different scenarios, for example,

Tune for desktop sharing videos

LD_LIBRARY_PATH=./lib ./bin/wzav1_sample_encoder 1920 1080 10 $YUV out.ivf ultrafast screen cbr 800 100 0 "summary=1"

Tune for camera videos

LD_LIBRARY_PATH=./lib ./bin/wzav1_sample_encoder 1920 1080 10 $YUV out.ivf ultrafast camera cbr 800 100 0 "summary=1"

Tune for mixed-content videos

LD_LIBRARY_PATH=./lib ./bin/wzav1_sample_encoder 1920 1080 10 $YUV out.ivf ultrafast adaptive cbr 800 100 0 "summary=1"

The executable is build from the file wzav1_sample_encoder.c and header files declaring the API functions and the relevant structures.

The encoder is built from wz_encoder_config_t which exposes the core parameters needed to set up the encoder (see below). Further parameters can be passed in an extra configuration string extra_cfg.

Parameters can be modified before each encode call by updating the configuration, but this may cause the encoder to be reset in some cases.