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

Issues with ffmpeg silence detection thresholds #2629

Open
rjhelms opened this issue Jul 14, 2023 · 2 comments
Open

Issues with ffmpeg silence detection thresholds #2629

rjhelms opened this issue Jul 14, 2023 · 2 comments
Labels
good first issue Good for newcomers is: bug status: pinned This issue or pull request won't stale

Comments

@rjhelms
Copy link
Contributor

rjhelms commented Jul 14, 2023

Describe the bug

The call to run ffmpeg for detect silences is as follows:

cmd = _ffmpeg(
*("-i", filepath),
"-vn",
*("-filter", "highpass=frequency=1000"),
*("-filter", "silencedetect=noise=0.15:duration=1"),
)

There are two issues with this call:

  • ffmpeg does not support multiple filter arguments, so the highpass filter is not applied. To be effective, need to be chained eg highpass=frequency=1000,silencedetect=noise=0.15:duration=1
  • more importantly, these settings are very different from what the old silan-based detection used.
    • Silan used a threshhold of 0.001 (equivalent to -60dB), 0.15 as used now is equivalent to -16dB. This is very aggressive, which is especially noticeable with spoken-word programming as final syllables or words can get detected as silence.
    • 1000Hz for a cutoff seems incredibly high (although this has no impact as it's not currently being applied) I'm not certain how silan's high pass coefficient maps to a frequency, but the 0.99 value Libretime used seems to be equivalent to about 80Hz which is a reasonable value.

To be consistent with the silence detection before the change to ffmpeg was implented, the filter should be something like: highpass=frequency=80,silencedetect=noise=0.001:duration=1

To reproduce

  1. Upload a file, and review cue points
  2. In audio editing software, confirm that cue points are at logical place

Expected behavior

As silence detection, cue in and out points should not trim off any of the content of the track.

For example, here is the results for the cue-out point identified for a track in our music library:
image

  • The yellow marker is the current behaviour of libretime_analyzer, which trims off a bit of the end of the track.
  • The red marker marker is the cue point ffmpeg reports if the highpass filter at 1000Hz is applied, trimming things even more aggressively.
  • The green marker is the cue point ffmpeg reports with the values suggested to be consistent with the old silan behaviour, which does not trim off any actual audio in the track.

Relevant log output or error messages

No response

LibreTime version

3.0.1

Installation method and OS / Environment

Operating system: Ubuntu 20.04.5 LTS
Method: install script

Installation details

No response

Client Environment

No response

Screenshots

No response

@jooola
Copy link
Contributor

jooola commented Jul 14, 2023

Hey @rjhelms,
Haha, indeed, I might have been a bit aggressive on the settings here.

And I didn't know we couldn't chain -filter arguments, thanks for brigging this up.

It was my intention to make this configurable from the UI, but the analyzer doesn't support passing configuration from the UI/legacy app yet, we might be able to use the configuration file, but I think this would be a bad idea.

I have some branches working on this locally, never had the chance to push it. I'll see if I can push some change to make this happen.

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 5 months. It will be closed if no activity occurs in the next month.
Please chat to us on the forum or ask for help on #libretime:matrix.org if you have any questions or need further support with getting this issue resolved.
You may also label an issue as pinned if you would like to make sure that it does not get closed by this bot.

@github-actions github-actions bot added the status: stalled This issue or pull request is stalled label Dec 12, 2023
@paddatrapper paddatrapper added good first issue Good for newcomers status: pinned This issue or pull request won't stale and removed status: stalled This issue or pull request is stalled labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers is: bug status: pinned This issue or pull request won't stale
Projects
None yet
Development

No branches or pull requests

3 participants