ReplayGain tags and volume normalization

A couple of months ago we started using CasparCG at our station, and we have been progressively implementing some standards and best practices for broadcasting. One of those standards is implementation of EBU R128 in all our media and productions.

So far I’ve tried different methods for transcoding our actual footage and media into our broadcasting format (1080p29.97 or 1080i59.94), but most of our converters have no options regarding R128 volume normalization. That’s when bs1770gain comes into play.

bs1770gain analyzes volume data from a media file, using EBU R128 algorithms, which allows for two choices:

  1. Remuxing media into an MKV container which has ReplayGain tags for volume normalization.
  2. Transcoding media into an MKV container which has volume normalization applied to the audio track.

Now, after testing both options, I found out that remuxing is not destructive at all, just adds ReplayGain information into metadata. In the other hand, transcoding only recodes the audio track in FLAC, which adds a considerable amount of data into the final media file, but ensures volume normalization is actually applied.

CasparCG Server allows FLAC audio, at least on 2.1.0 Beta 2, but I have no information about ReplayGain tags compatibility.

Does anyone have a clue about this? Do you have any other method for volume normalization in media, using EBU R128 standard?

I have used the loudnorm filter in ffmpeg plenty of times, you can output to any format ffmpeg supports.

Do you have any example of an ffmpeg command that allows me to do a video copy operation and apply loudnorm? Or loudnorm applies directly on the media file I point it to?

This page explains it well: