Skip to main content

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.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ycls-1.0.7.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ycls-1.0.7-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file ycls-1.0.7.tar.gz.

File metadata

  • Download URL: ycls-1.0.7.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.1

File hashes

Hashes for ycls-1.0.7.tar.gz
Algorithm Hash digest
SHA256 54f1f49e85ad8c13591d9e401c706949065c028fcdb320bbd7c5e7df196e448f
MD5 60bb37fd2bf7fa730f943602ff143747
BLAKE2b-256 8c60e49cd2b96933324b882d8e6cd50cb3b35a292800da585106526159965fe3

See more details on using hashes here.

File details

Details for the file ycls-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: ycls-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.1

File hashes

Hashes for ycls-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2c105795e9556e185df4dfecb1f632231195e0f3b1bf1bb18d08ae91bfa9f26a
MD5 481a53184e6c42f8e239f18ba65ff42d
BLAKE2b-256 fc6eacfbca74f481154156e3eca81ad8add03091db0e1ae8a5debe1ee8d234c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page