Skip to content

Instantly share code, notes, and snippets.

@milleniumbug
Last active April 14, 2024 22:29
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save milleniumbug/6aae4cc5b77303d73be07cc74923fa6f to your computer and use it in GitHub Desktop.
Save milleniumbug/6aae4cc5b77303d73be07cc74923fa6f to your computer and use it in GitHub Desktop.
download video from YouTube, extract music and normalize volume
param(
[string]$url
)
yt-dlp `
$url `
--quiet `
--extract-audio `
--audio-format mp3 `
--audio-quality 3 `
--embed-thumbnail `
--embed-metadata `
--exec 'mp3gain -q -r -c "{}"'
#!/bin/bash
yt-dlp \
--quiet \
--extract-audio \
--audio-format mp3 \
--audio-quality 3 \
--embed-thumbnail \
--embed-metadata \
"$@" \
--exec 'mp3gain -q -r -c {} > /dev/null && echo {}'
@jazz-it
Copy link

jazz-it commented Jun 8, 2020

FYI

  • mp3gain is no longer available in repositories, does not compile and has been replaced with r128gain.
  • ReplayGain 2.0 targets the same loudness as ReplayGain 1.0 specification, but utilizes the improved ITU BS.1770 algorithm for measuring original tracks.
  • mp3gain is based on ReplayGain 1.0 specification.

Improved script: https://gist.github.com/madjoe/b981fa7f3f81089a37257e366c1ef581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment