Live Slicer Audio

Audio ingest, codec selection, normalization, using the PMT instead of individual PIDs, and SDI channel layout.

Audio

Audio Ingest

The Live Slicer's audio ingest behavior varies depending on whether you are streaming over UDP, RTMP, or SDI.

  • UDP/ RTMP / SRT / TCP
    You must specify each audio track that will be ingested via the pids parameter.

    Example

    The following configuration initializes the audio tracks that correspond to the packets with identifiers 308, 256, 257, and 258:
    pids: 308,256,257,258

  • SDI: The Live Slicer automatically ingests the audio tracks that correspond to SDI channels 0 - 15.

Audio Codec

By default, the Live Slicer encodes audio using the Advanced Audio Coding (AAC) audio codec. You may configure it to encode an audio track into Dolby Digital Plus (DD+) and AAC subtracks by passing the audio_dolby_# parameter.

ℹ️

Playback of DD+ audio subtracks requires the ddp playback URL parameter.

Sample Configurations

  • UDP: The following configuration will encode track 257 as DD+ and encode all of the other tracks (i.e., 257, 258, and 308) defined by the pids parameter as AAC:

    pids: 308,256,257,258
    audio_lang_256: eng
    audio_desc_256: primary
    audio_lang_257: eng
    audio_desc_257: secondary
    audio_dolby_257: 1
  • SDI: The following configuration will encode the audio track for SDI channel 7 as DD+ and encode all of the other tracks (i.e., SDI channels 0 - 6 and 8 - 15) as AAC: audio_dolby_7: 1

Audio Normalization

By default, assets are encoded at approximately the same level of loudness. You can adjust this level via the gain setting, which determines the gain or attenuation (in decibels) applied to the live signal as it is encoded.

The Live Slicer logs the calculated gain value every ten seconds. Monitor /var/log/syslog to find the appropriate value for the gain setting.

For real-time audio normalization when encoding, use the enable_loudnorm and target_loudness parameters, which implement loudness normalization (loudnorm) according to EBU (European Broadcasting Union) R 128.

The enable_loudnorm parameter enables loudnorm processing, and target_loudness sets the target loudness in LUFS (Loudness Units Relative to Full Scale). Historical default platform loudness is -20 LUFS. Ads are encoded just-in-time at the same loudness as the content for compliance with the CALM Act.

A less CPU-intensive alternative is the enable_dyn_gain parameter. The enable_loudnorm parameter takes precedence if both enable_loudnorm and enable_dyn_gain are enabled at the same time, which is not recommended.

Using PMT Instead of Specifying Individual Audio PIDs

Starting with the May 2025 Slicer Release (250516.01.01-rc1), the Live Slicer supports the ability to specify audio settings without knowing the individual audio PIDs. The Program Map Table (PMT) is read to determine the audio PIDs used by the input stream.

This is useful for a linear channel where the audio streams may change, such as when one program has a Spanish language audio track for a given audio PID, but then the next one does not and has English on that audio PID.

This functionality is controlled via three Live Slicer parameters, one existing and two new:

  • progID (existing)
  • use_all_audio_tracks (new, enabled by default when progID is used)
  • handle_pmt_changes (new, enabled by default)

The progID parameter specifies the program in a multi-program transport stream to be consumed by the Live Slicer. By default, specifying progID without specifying specific audio PIDs with the pids parameter causes all audio tracks to be consumed by the Slicer (use_all_audio_tracks defaulted to yes).

Audio tracks will be sorted by PID, unless an explicit list of pids: is specified, in which case audio tracks will be ordered according to pids:.

Using optional_pids is not recommended regardless of handle_pmt_changes:

  • Optional SCTE PID does not need to be specified as SCTE will be consumed if the SCTE plugin is enabled, regardless of the PID.
  • Optional SCTE 2038 PID does not need to be specified as it will be consumed if enable_smpte_2038: yes was specified, regardless of the PID.

It must be specified if one or more audio tracks are not there on Slicer startup but expected later:

  • HLS requires definition of all audio tracks on stream start.
  • Therefore, if an audio track is not there upon stream start, it cannot be added later to the HLS stream so it must be specified before it is used.

You can specify expected audio tracks using either the expect_audio_input or expect_audio_inputs parameter in the Slicer configuration file. There can be a sequence of expect_audio_input lines (each one is a JSON object) in the Slicer config file.

Alternatively, there can be one expect_audio_inputs (note the plural) line, containing a list of JSON objects. As well as what audio format to expect on input, the expect_audio_input or expect_audio_inputs reserve outputs in the manifest in the case that Dolby encoding in addition to AAC encoding is desired.

expect_audio_input is intended to replace the audio_lang_<pid>, audio_desc_<pid>, audio_dolby_<pid>, and audio_ac3_pass_through_<pid> options. expect_audio_input also makes the pids: option unnecessary - both are supported, but should not be used together.

The expect_audio_input JSON object schema is:

{"lang": <string>, "desc": <string>, "dolby": <bool>, "ac3_pass_through": <bool>, "pid": <int>}

with schema members:

  • lang: Override for language similar to audio_lang_<pid> usage
  • desc: Override for description similar to audio_desc_<pid> usage
  • dolby: Enable Dolby Digital Plus encoding similar to audio_dolby_<pid> usage
  • ac3_pass_through: Enable original Dolby audio passthrough (AC-3 or EAC-3) similar to audio_ac3_pass_through_<pid>
  • pid: Tie this input to a particular Audio PID

All members are optional with the default values being empty string, false, and -1 for pid.

When expect_audio_inputs is used, it is a comma-separated list of these objects with the list being contained in square brackets ([ and ]). When using "dolby": true in the above, ddp=1 must be specified in the URL to produce both AAC and Dolby audio from the input stream.

Example of expect_audio_input usage:
progID: 3
expect_audio_input: {"ac3_pass_through": true} # first audio PID != 52, output as AAC and original AC3/EC3 passthrough
expect_audio_input: {"dolby": true, "ac3_pass_through": true, "pid": 52} # bind to PID == 52, output as AAC, EC3, and AC3/EC3 passthrough
expect_audio_input: {"lang": "en", "desc": "no-such-track"} # second audio PID != 52, output as AAC, with specified language and description

Example of expect_audio_inputs usage mapping to above:
progID: 3
expect_audio_inputs: [{"ac3_pass_through": true}, {"dolby": true, "ac3_pass_through": true, "pid": 52}, {"lang": "en", "desc": "no-such-track"}]

If some expect_audio_input specifies a PID and others do not, the ones that do not will be mapped to any remaining audio PIDs after the explicitly specified PIDs are excluded.

For example, if you have these PIDs in Program 3: 51, 52, 53, 54, where 51 is video, and 52, 53, 54 are audio, then the above config would produce these output tracks: 53,52,54, because the 2nd expect_audio_input was bound explicitly to PID 52.

The only real use for specifying a PID in expect_audio_input is to reorder tracks.

Example of expect_audio_input usage for :
progID: 3
expect_audio_input: {"lang": "en", "dolby": true} # AAC and Dolby EAC-3 outputs for first audio PID which happens to be English
expect_audio_input: {"lang": "es"} # just AAC output for second audio PID which happens to be Spanish

Example of expect_audio_inputs usage:
progID: 3
expect_audio_inputs:[{"lang": "en", "dolby": true}, {"lang": "es"}]

When using "dolby": true in the above, ddp=1 must be specified in the URL to produce both AAC and Dolby audio from the input stream.

Audio Channel Layout (SDI Signal)

The Live Slicer may be configured to use either Standard or Custom audio channel layouts.

Standard Layout (SDI Signal)

Configure a standard audio channel layout through the use of the audio_layout parameter.

Audio ChannelChannel Layout
stereo 11: Left
2: Right
stereo 23: Left
4: Right
stereo 35: Left
6: Right
stereo 47: Left
8: Right
stereo 59: Left
10: Right
stereo 611: Left
12: Right
stereo 713: Left
14: Right
stereo 815: Left
16: Right
5.11: Center
2: Left
3: Right
4: Rear Left
5: Rear Right
6: LFE (Sub)
CEA1: Left
2: Right
3: Center
4: LFE (Sub)
5: Surround Left
6: Surround Right
7.11: Center
2: Left
3: Right
4: Rear Left
5: Rear Right
6: LFE (Sub)
7: Surround Left
8: Surround Right

Custom Audio Layout (SDI Signal)

A custom audio channel layout allows each audio track to be mapped to one or more channels. Additionally, a custom level may be assigned to each mapped channel.

Terminology

Before defining a custom audio layout, become acquainted with the following terminology:

  • SDI Channel: Identifies a single unit within a representation of an audio stream. For example, the left portion of a stereo feed may consist of one or more SDI channels.
  • Track: Identifies the set of channels required to produce a single representation of an audio stream. For example, an audio track for a stereo feed may consist of two or more SDI channels.
Setup

Setting up a custom audio channel layout requires replacing the audio_layout configuration setting with audio_custom_layout_{Track}. The configuration for this setting varies according to how audio should be mapped.

Use the following syntax to downmix audio to mono:
audio_custom_layout_{Track}: mono|X={SDI_Input_Channel}@{Level}

Use the following syntax to downmix audio to stereo:
audio_custom_layout_{Track}: stereo|L={SDI_Input_Channel}@{Level},R={SDI_Input_Channel}@{Level}

Use the following syntax to downmix audio to 5.1:
audio_custom_layout_{Track}: 5.1|C={SDI_Input_Channel}@{Level},L={SDI_Input_Channel}@{Level},R={SDI_Input_Channel}@{Level},RL={SDI_Input_Channel}@{Level},RR={SDI_Input_Channel}@{Level},LFE={SDI_Input_Channel}@{Level}

Set up a custom audio channel layout

  1. Replace {Track} with the ID of the audio track that will be assigned a custom audio layout.
  2. Set X or L and R (Left and Right) to an ampersand delimited list of SDI channels that will serve as the source for the specified audio track. The valid range for each channel is 0 - 15.

    The following sample mono configuration sets the source for audio track 0 to SDI channels 0, 1, and 3.
    audio_custom_layout_0: mono|X=0&1&3

    The level for each assigned SDI channel may be defined by appending the @ symbol followed by the desired value. Use the following formula to calculate level:
    {Volume %} * 10

    The following sample stereo configuration sets Left to SDI channel 0 at 70.7% and SDI channel 2 at 80%, while Right is set to SDI channel 4 at 20.2%.
    audio_custom_layout_0: stereo|L=0@707&2@800,R=4@202

    If the audio level is missing, then it will be set to 100%. The following sample stereo configuration sets Left to SDI channel 0 at 100% and Right is set to SDI channels 3 and 4 at 100%.
    audio_custom_layout_0: stereo|L=0,R=3&4
Multiple Track Setup

A custom audio layout may be defined for multiple tracks (e.g., language-specific tracks). This type of setup requires informing the Live Slicer as to the number of tracks that will be mapped via the audio_tracks configuration setting.

⚠️

The Live Slicer will only generate audio for a single track when this configuration setting is omitted.

ℹ️

Although we support up to 31 audio tracks, your SDI capture card can only detect up to 16 audio tracks.

Use the following syntax to indicate the number of audio tracks that will be mapped: audio_tracks: {Quantity}

For example, use the following configuration to indicate that a custom audio layout for three audio tracks (e.g., English, French, and Spanish) will be mapped: audio_tracks: 3

Audio Channel Layout

For UDP / RTMP / SRT / TCP

By default, the Live Slicer uses the following channel layout for Dolby: C L R RL RR LFE


Did this page help you?