Skip to content

Conversation

@grusell
Copy link
Contributor

@grusell grusell commented Oct 30, 2025

This PR adds support for two new modes for audio encoding when using segmented encoding:

  • Encoding audio separately from video without segmentation
  • Encoding audio separately from video with segmentation. This mode is only supported for aac/libfdk_aac codecs.

There are now three modes for audio encoding when using segmented encoding:

  1. ENCODE_WITH_VIDEO (default) - Audio is encoded together with each video segment, ie same behaviour as before.
  2. ENCODE_SEPARATELY_FULL - Audio is encoded separately as complete files, then muxed with the video if necessary.
  3. ENCODE_SEPARATELY_SEGMENTED - Audio is split into segments separately from video and encoded in parallel with video

Audio encoding mode can be selected with the 'encoreJob.audioEncodingMode' property. A default value, used when the property is not specified on the job, can be configured with the 'encore-settings.encoding.segmented-encoding.audio-encoding-mode' property.

For segmented audio encode, audio segment length can be configured with the property 'encoreJob.audioSegmentLength' . Note that the segment length needs to be a multiple of the audio frame duration for proper encoding. If audio segment length is not specified, a suitable segment length close to 256s will be calculated.

To avoid priming samples causing artifacts when stitching the encoded audio segments together, each audio segment will be encoded with a duration slightly longer than the audio segment length. Each segment is extended with a duration of twice the duration of one audio frame is at the beginning and end. This extra 'padding' is removed during the joining of the segments.

Segmented audio encode is only supported for aac and libfdk_aac codecs.

…en using segmented encoding

This feature can be enabled for a job by setting 'segmentedEncodingEnabledForAudio' to 'false' for the job.
If this property is not set for a job, the default value from the configuration property
'encore-settings.encoding.segmentedEncoding.enabledForAudio' will be used.
This property defaults to false, which means the default behaviour is to use segemented encoding also
for audio.

Refs: svt#41

Signed-off-by: Gustav Grusell <gustav.grusell@eyevinn.se>
Signed-off-by: Gustav Grusell <gustav.grusell@eyevinn.se>
Signed-off-by: Gustav Grusell <gustav.grusell@eyevinn.se>
Signed-off-by: Gustav Grusell <gustav.grusell@eyevinn.se>
Introduces support for encoding audio separately from video in segments,
enabling better parallelization and throughput for large files.

There are now three modes for audio encoding when using segmented encoding:

1. ENCODE_WITH_VIDEO (default) -Audio is encoded together with each video segment
2. ENCODE_SEPARATELY_FULL - Audio is encoded once as a complete file,
then muxed with video segments
3. ENCODE_SEPARATELY_SEGMENTED - Audio is split into segments and encoded in parallel with video

Audio encoding mode can be selected with the 'encoreJob.audioEncodingMode' property.
A default value, used when the property is not specified on the job, can be configured
with the 'encore-settings.encoding.segmented-encoding.audio-encoding-mode' property.

For segmented audio encode, audio segment length can be configured with the
property 'encoreJob.audioSegmentLength' . Note that the segment length needs
to be a multiple of the audio frame duration for proper encoding. If audio
segment length is not specified, a suitable segment length close to 256s will
be calculated.

Segmented audio encode is only supported for aac and libfdk_aac codecs.

Signed-off-by: Gustav Grusell <gustav.grusell@eyevinn.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant