Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaygain backend ffmpeg #3056

Merged
merged 6 commits into from Jul 21, 2019
Merged

Commits on Jul 19, 2019

  1. Allow other ReplayGain backends to support R128.

    Previously using EBU R128 forced the use of the bs1770gain backend.
    This change adds a whitelist of backends supporting R128. When the configured
    backend is in that list it will also be used for R128 calculations. Otherwise
    bs1770gain is still used as a default.
    
    This should not change the overall behaviour of the program at all, but allow
    for further R128-supporting backends to be added.
    zsinskri committed Jul 19, 2019
    Copy the full SHA
    7a7314e View commit details
    Browse the repository at this point in the history
  2. replaygain: add ffmpeg backend

    Add replaygain backend using ffmpeg's ebur128 filter.
    
    The album gain is calculated as the mean of all BS.1770 gating block powers.
    Besides differences in gating block offset, this should be equivalent to a
    BS.1770 analysis of a proper concatenation of all tracks.
    
    Just calculating the mean of all track gains (as implemented by the bs1770gain
    backend) yields incorrect results as that would:
    - completely ignore track lengths
      - just using length in seconds won't work either (e.g. BS.1770 ignores
        passages below a threshold)
    - take the mean of track loudness, not power
    
    When using the ffmpeg replaygain backend to create R128_*_GAIN tags, the
    targetlevel will be set to -23 LUFS. GitHub PullRequest beetbox#3065 will make this
    configurable.
    It will also skip peak calculation, as there is no R128_*_PEAK tag.
    
    It is checked if the libavfilter library supports replaygain calculation. Before
    version 6.67.100 that did require the `--enable-libebur128` compile-time-option,
    after that the ebur128 library is included in libavfilter itself. Thus we
    require either a recent enough libavfilter version or the `--enable-libebur128`
    option.
    zsinskri committed Jul 19, 2019
    Copy the full SHA
    c3af5b3 View commit details
    Browse the repository at this point in the history
  3. changelog entry: ffmpeg replaygain backend

    Add changelog entry for the new ffmpeg replaygain backend.
    zsinskri committed Jul 19, 2019
    Copy the full SHA
    b589521 View commit details
    Browse the repository at this point in the history
  4. replaygain: ffmpeg: increase parser readability

    Use keyword arguments to make the ffmpeg parser more readable.
    zsinskri committed Jul 19, 2019
    Copy the full SHA
    271a3c9 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2019

  1. improve wording in the ffmpeg replaygain backend

    This commit mostly addresses feedback:
    - remove some unused parenthesis
    - fix a typo
    - expand some docstrings
    - document that ffmpeg is usually easy to install
    zsinskri committed Jul 20, 2019
    Copy the full SHA
    f9ff56f View commit details
    Browse the repository at this point in the history
  2. avoid test failure

    Use the POSIX character class instead of `\s` to match all whitespace in a
    regular expression describing the language of valid inputs, in order to avoid a
    test failure for the invalid escape sequence `\s` in Python strings.
    zsinskri committed Jul 20, 2019
    Copy the full SHA
    e5f2fe6 View commit details
    Browse the repository at this point in the history