Audio Normalization Workflow Operation

ID: normalize-audio


This operation normalizes the first audio stream of a video or audio track through SoX, it creates a new track with a reference to the original track which can be flavored and tagged. It can be used with audio and/or video files, at least one audio stream must be available otherwise nothing happens. Here are the internal steps done by the different inputs:

Used with Audio only file (forceTranscode is deactivated):

Used with Audio only file and forceTranscode activated:

Used with Video file:

Example result track:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<track ref="track:track-2" type="presenter/normalized" id="70626874-17d2-480d-9d30-c10f0824961c">
  <checksum type="md5">4e30d7d4305b0793f301816e796471db</checksum>
  <audio id="audio-1">
    <encoder type="MPEG Audio"/>
    <peakleveldb>-4.03</peakleveldb> <!-- NEW -->
    <rmsleveldb>-30.54</rmsleveldb> <!-- NEW -->
    <rmspeakdb>-10.85</rmspeakdb> <!-- NEW -->

Parameter Table

configuration keys example description default value
source-flavors "presentation/work,presenter/work" The "flavors" of the track to use as a source input EMPTY
source-flavor "presentation/work" The "flavor" of the track to use as a source input EMPTY
source-tags "engage,atom,rss" The "tag" of the track to use as a source input EMPTY
target-flavor "presentation/normalized" The flavor to apply to the normalized file EMPTY
target-tags "norm" The tags to apply to the normalized file EMPTY
target-decibel* -30.4 The target RMS Level Decibel EMPTY
force-transcode "true" or "false" Whether to force transcoding the audio stream (This is needed when trying to strip an audio stream from an audio only video container, because SoX can not handle video formats, so it must be encoded to an audio format) FALSE

* required keys

Operation Example

    description="Normalize audio stream">
    <configuration key="source-flavor">*/work</configuration>
    <configuration key="target-flavor">*/normalized</configuration>
    <configuration key="target-tags">norm</configuration>
    <configuration key="target-decibel">-30</configuration>
    <configuration key="force-transcode">true</configuration>

Missing Encoding Profiles

Some of the encoding profiles necessary for this operation are not included in Opencast per default, but the operation will not work without them. You need to include the following encoding profiles by copy and pasting them in a .properties file in the etc/encoding folder of your installation.

# SoX Audio only (strip video) = sox audio only = visual = audio = -work.flac = -i #{} -vn -c:a flac #{out.dir}/#{}#{out.suffix}

# SoX replace Audio (replace audio) = sox replace audio = visual = visual = -work.#{} = -i #{} -i #{} -map 1:v -map 0:a -c:v copy #{out.dir}/#{}#{out.suffix}