https://bugs.kde.org/show_bug.cgi?id=525800

            Bug ID: 525800
           Summary: Sidechain audio ducking (autoduck) — working
                    implementation offered
    Classification: Applications
           Product: kdenlive
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: Video Effects & Transitions
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Title: _Sidechain audio ducking (autoduck) — working implementation offered_
Description:
Audio ducking (automatically lowering music volume while a voice track is
speaking) has been on the feature request list for years and is currently
only possible via manual keyframes or external tools (e.g. exporting to
Audacity).

I have a complete, tested working implementation for MLT/Kdenlive:

https://github.com/joseporive/kdenlive-autoduck

It is implemented as a standalone MLT module (libmltautoduck.so, LGPLv2.1)
with two cooperating audio filters:

- autoduck_send — applied to the VOICE track: measures the RMS level of
  every frame and publishes it to a shared registry keyed by timeline
  position.
- autoduck — applied to the MUSIC track: looks up the voice level for the
  current position and slides the gain down to the configured ducking level
  (with adjustable attack/release) when the voice exceeds the threshold.

The design uses MLT's lazy audio evaluation order (tracks are mixed in
track-index order via the mix transitions), so no changes to MLT internals
are required: everything is a standard filter pair communicating through a
mutex-protected ring registry. If maintainers prefer a different sidechain
mechanism (e.g. producer sidechain like the watermark filter), it can be
reworked.

Verified numerically: 12.05 dB measured reduction with a -12 dB target,
correct attack/release recovery, works with the voice track above or below
the music track (1-frame hold fallback), and identical behavior in preview
and render. Tested against MLT 7.39 in the official Kdenlive AppImage
(26.04.1), metadata provided and visible in melt -query.

The repository contains the source, metadata YAML (schema 7.0), an
install script for the AppImage and instructions for system installs.
Build is ABI-compatible with all MLT 7.x.

Please feel free to integrate or adapt this in any way you find suitable —
take it as a working proof of concept. Happy to answer questions about the
implementation.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to