Opened 5 months ago

Closed 5 months ago

#7616 closed enhancement (fixed)

Add latency compensation option to af_ladspa and af_lv2

Reported by: Thomas Mundt Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Some audio plug-ins need to delay the audio, e.g. for look-ahead processing. It would be great to have a user option in af_ladspa and af_lv2 that allows latency compensation by entering the delay in seconds (floating point) and/or in fixed samples.

Change History (9)

comment:1 Changed 5 months ago by richardpl

This is very unclear, please specify which stuff should be used from ladspa/lv2 to make this ticket valid.

comment:2 Changed 5 months ago by Thomas Mundt

Sorry, I´m not sure I understand you.
As an example: When using the Loudmax ladspa plug-in [loudmax.blogspot.com] within ffmpeg the audio will be delayed by 1.25 ms due to the look-ahead buffer inside the plug-in. This ticket is about a new option in af_ladspa that I can set to 1.25ms and the audio samples supplied to the Loudmax plugin will be time compensated to eleminate this delay.

comment:3 Changed 5 months ago by richardpl

If you just want to delay audio by certain amount use adelay filter before ladspa/lv2 no need to duplicate such functionality into those 2 filters.

comment:4 Changed 5 months ago by Thomas Mundt

I need negative delay for compensating the delay of the plug-in.
adelay doesn´t accept negative numbers. I could change this ticket to: Allow negative delay with af_adelay. Would that be better?

Last edited 5 months ago by Thomas Mundt (previous) (diff)

comment:5 Changed 5 months ago by richardpl

So you actually want atrim filter, to trim extra samples at beginning?

comment:6 Changed 5 months ago by Thomas Mundt

Yes, that might work.
I would put atrim behind ladspa in the filter chain.

The plug-in adds some extra samples at the end due to the internal delay. Will these samples be preserved or are they cut off and replaced by zeroes?

comment:7 Changed 5 months ago by richardpl

For that use also apad filter before ladspa filter. You can not specify duration in seconds but in samples, but I can write patch to fix that.

comment:8 Changed 5 months ago by Thomas Mundt

Works perfect. Thanks a lot!
For my use case I can easily calculate the number of samples, but in general it may be useful to be able to specify the duration in seconds.

comment:9 Changed 5 months ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.