Skip to main content

YCLS (YouTube Content Loudness Scanner)

YCLS is a Python module for calculating loudness metrics for audio (or video) files, particularly aimed at determining the loudness level suitable for YouTube content. It provides functions to calculate various loudness metrics such as LUFS (Loudness Units Full Scale), peak loudness in dBFS (decibels relative to full scale), and adjusted loudness suitable for YouTube.

Installation

You can install the ycls module using pip:

pip install ycls

Make sure you have ffmpeg installed on your system.

For Windows:

winget install Gyan.FFmpeg.Essentials

Usage

You can import functions from the ycls module using the following syntax:

from ycls import calculate_loudness_lufs, calculate_youtube_content_loudness, calculate_peak_dbfs

Functions

calculate_loudness_lufs(input_file)

This function calculates the loudness level of the input audio (or video) file in LUFS (Loudness Units Full Scale) using the r128gain library.

  • Parameters:

    • input_file (str): The path to the input audio (or video) file.
  • Returns:

    • The loudness level of the input audio (or video) file in LUFS.

calculate_youtube_content_loudness(input_file)

This function calculates the adjusted loudness suitable for YouTube content based on the input audio (or video) file. It adds 14 dB to the loudness level calculated by calculate_loudness_lufs.

  • Parameters:

    • input_file (str): The path to the input audio (or video) file.
  • Returns:

    • The adjusted loudness suitable for YouTube content in dB.

calculate_peak_dbfs(input_file)

This function calculates the peak loudness in dBFS (decibels relative to full scale) of the input audio (or video) file using the r128gain library.

  • Parameters:

    • input_file (str): The path to the input audio (or video) file.
  • Returns:

    • The peak loudness of the input audio (or video) file in dBFS.

Running the Module via CLI

You can also run ycls from the command line interface (CLI). After installing the module, you can use it as follows:

ycls -i <input_file_path>

Replace <input_file_path> with the path to your audio (or video) file.

Example

Suppose you have an audio file named example_audio.mp3. You can calculate its loudness metrics using the CLI:

ycls -i example_audio.mp3

This will print the loudness metrics of the audio file to the console.

File Loudness: -23.6 LUFS
Peak Loudness: -2.3 dBFS
Youtube Content Loudness: -9.6 dB

Requirements

  • Python 3.6+
  • r128gain library
  • typer library
  • ffmpeg

Release files for ycls 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ycls 1.0.7
File Size Uploaded
ycls-1.0.7.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ycls 1.0.7
File Interpreter ABI Platform
ycls-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 5.5 kB

Release files / ycls-1.0.7.tar.gz

Download URL ycls-1.0.7.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
54f1f49e85ad8c13591d9e401c706949065c028fcdb320bbd7c5e7df196e448f
BLAKE2b-256 checksum
How to use checksums
8c60e49cd2b96933324b882d8e6cd50cb3b35a292800da585106526159965fe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.1

Release files / ycls-1.0.7-py3-none-any.whl

Download URL ycls-1.0.7-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c105795e9556e185df4dfecb1f632231195e0f3b1bf1bb18d08ae91bfa9f26a
BLAKE2b-256 checksum
How to use checksums
fc6eacfbca74f481154156e3eca81ad8add03091db0e1ae8a5debe1ee8d234c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.1

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page