tree: 8ab0349ccad298278be2a199c2e4ed7a5a229d88 [path history] [tgz]
  1. 1OA_and_stereo_opus.textproto
  2. 1OA_and_stereo_pcm24bit.textproto
  3. 1OA_opus.textproto
  4. 1OA_pcm24bit.textproto
  5. 3OA_and_stereo_opus.textproto
  6. 3OA_and_stereo_pcm24bit.textproto
  7. 3OA_opus.textproto
  8. 3OA_pcm24bit.textproto
  9. 5dot1_opus.textproto
  10. 5dot1_pcm24bit.textproto
  11. 5dot1dot2_opus.textproto
  12. 5dot1dot2_pcm24bit.textproto
  13. 7dot1dot4_opus.textproto
  14. 7dot1dot4_pcm24bit.textproto
  15. BUILD
  16. README.md
  17. stereo_opus.textproto
  18. stereo_pcm24bit.textproto
iamf/cli/textproto_templates/README.md

Textproto templates

The textproto templates correspond to the following audio layouts.

Input layoutCodecFile name
StereoPCMstereo_pcm24bit.textproto
StereoOpusstereo_opus.textproto
5.1PCM5dot1_pcm24bit.textproto
5.1Opus5dot1_opus.textproto
5.1.2PCM5dot1dot2_pcm24bit.textproto
5.1.2Opus5dot1dot2_opus.textproto
7.1.4PCM7dot1dot4_pcm24bit.textproto
7.1.4Opus7dot1dot4_opus.textproto
1st order AmbisonicsPCM1OA_pcm24bit.textproto
1st order AmbisonicsOpus1OA_opus.textproto
3rd order AmbisonicsPCM3OA_pcm24bit.textproto
3rd order AmbisonicsOpus3OA_opus.textproto
1st order Ambisonics + StereoPCM1OA_and_stereo_pcm24bit.textproto
1st order Ambisonics + StereoOpus1OA_and_stereo_opus.textproto
3rd order Ambisonics + StereoPCM3OA_and_stereo_pcm24bit.textproto
3rd order Ambisonics + StereoOpus3OA_and_stereo_opus.textproto

Customizing the templates

Set the following fields in the textproto template.

  • wav_filename

    Set this to the input wav filename, without the path to it. For example, if the wav file is located at /path/to/input.wav, set

    wav_filename: input.wav
    
  • file_name_prefix

    Set this to the desired output filename. The generated .iamf file will be named file_name_prefix.iamf.

  • loudness

    Measure the loudness of the input audio, including the stereo downmix, and store these values in the following loudness fields. IAMF decoders and renderers can use this loudness metadata to normalize the output audio.

    • loudness.integrated_loudness

      This is the ITU-R BS.1770-4 integrated loudness, specified in LKFS. Convert the loudness value to the correct int16 value to use here as integrated_loudness = integrated_loudness_in_lkfs * 256.

    • loudness.digital_peak

      This is the digital (sampled) peak value of the audio signal, specified in dBFS. Convert the peak value to the correct int16 value to use here as digital_peak = digital_peak_in_dBFS * 256.

Optionally, modify other fields in the textproto template as necessary.

  • channel_metadatas

    Use custom channel_ids when the input wav file is in a different order. By default they are configured for wav files using ITU-2051-3 order.

  • headphones_rendering_mode

    Choose one of HEADPHONES_RENDERING_MODE_BINAURAL or HEADPHONES_RENDERING_MODE_STEREO.

    This informs the renderer if the audio element should be binauralized or downmixed to stereo.

  • element_mix_gain.default_mix_gain

    This is the gain that will be applied to an audio element before it is summed with all other audio elements.

    It is denoted in dB and Q7.8 format, and then converted to int16. Convert a desired gain to the correct int16 value to use here as default_mix_gain = gain_in_db * 256.

  • output_mix_gain.default_mix_gain

    This is the gain that will be applied to the summed audio elements.

    It is denoted in dB and Q7.8 format, and then converted to int16. Convert a desired gain to the correct int16 value to use here as default_mix_gain = gain_in_db * 256.

The following are available for PCM textprotos only.

  • decoder_config_lpcm.sample_size

    Input PCM bit-depth. Allowed values are 16, 24, 32.

  • decoder_config_lpcm.sample_rate

    Input and output sample rate. Allowed values are 16000, 32000, 44100, 48000, 96000.

    All parameter_rate values must additionally be updated to match sample_rate.

The following are available for Opus textprotos only.

  • opus_encoder_metadata.target_bitrate_per_channel

    Target bitrate per channel, in bits per second.

  • opus_encoder_metadata.coupling_rate_adjustment

    Some channels are coupled and coded as stereo pairs, e.g., L/R. This field adjusts the total target bitrate of the coupled channels to be target_bitrate_per_channel * 2 * coupling_rate_adjustment. Its default value is 1.0.