Coder Social home page Coder Social logo

rsgain's People

Contributors

alex3305 avatar attsupidupis avatar azertyfun avatar bsdkaffee avatar complexlogic avatar ctem avatar diizzyy avatar hughmcmaster avatar jeffbyrnes avatar madscientist16 avatar mavit avatar mihawk90 avatar pozhiloy-enotik avatar tomkranenburg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rsgain's Issues

A problem about redirecting output of rsgain

First of all, thank you for bringing wonderful loudgain to Windows. I have downloaded version 2.0.1 it from the release page.
I am trying to save output result of rsgain to a .txt file, but I could not manage to do it.
I run

C:/rsgain-2.0.1-win64/rsgain.exe -v 1>out.txt 2>err.txt

for example. However, the result is still output to the Windows PowerShell window, and both out.txt and err.txt remain empty.
Could you please tell me that is there something wrong with my command line, or how to solve this problem.
I guess this post https://stackoverflow.com/questions/41556226/windows-console-output-not-going-to-stdout-nor-stderr may be related.
Thank you very much.

rsgain crashes when RG tags are present

rsgain crashes with a crash dialog when trying to write tags with the next args when RG tags are already present:
-I 4 -L -s i
EDIT: Wrong report, was some the known unsupported unicode of Win7

[ERROR] Could not find audio stream

PS> rsgain custom .\f\a.flac
[OK] Scanning '.\f\a.flac'
[OK] Container: raw FLAC [flac]
[ERROR] Could not find audio stream
PS> ffprobe .\f\a.flac
ffprobe version 5.1.2-full_build-www.gyan.dev Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, flac, from '.\f\a.flac':
  Metadata:
    COMMENT         :
                    : Tagged by NCH Software
    ALBUM           : Beyond Understanding E.P.
    album_artist    : New Decade
    ARTIST          : New Decade
    COMPOSER        : Out Of Romford Records ‎– ROCC 001
    DATE            : 1992
    ENCODEDBY       : Switch Plus © NCH Software
    ENDDATE         : 1992-01-01
    ID3/COMMENT_1_TEXT: http://www.discogs.com/New-Decade-Beyond-Understanding-5-Track-EP/release/1083350
    ID3/COMMENT_COUNT: 1
    TITLE           : ABC
    track           : 1
    MARKER_POSTYPE  : 1
    MARKER_SAMPLERATE: 44100
    TRACKTOTAL      : 05
    GENRE           : Hardcore
    CONTENTGROUP    : Electronic
    COUNTRY         : UK
    ORGANIZATION    : Out Of Romford Records
    MEDIATYPE       : Vinyl
    LOCATION        : https://www.discogs.com/release/161516-New-Decade-Beyond-Understanding-EP
    CATALOGNUMBER   : ROCC 001
    LENGTH          : 297000
  Duration: 00:04:57.81, start: 0.000000, bitrate: 772 kb/s
  Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
  Stream #0:1: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 450x435 [SAR 1:1 DAR 30:29], 90k tbr, 90k tbn (attached pic)
    Metadata:
      comment         : Cover (front)

Extra tags (ex. -s e)

I see you ditched support for extra tags, specifically "REPLAYGAIN_REFERENCE_LOUDNESS". I know it's not really standard, but it's adopted widely enough and even appears on hydrogen.io as a de-facto extension. For players unaware of these tags they won't do anything harmful and for ones that do, reference loudness information will help adequately handle libraries with mixed loudness targets.

Were there any issues with it?

How to build this for Fedora with proprietary FFMPEG codecs installed?

I use Fedora with the proprietary codecs and the complete FFMPEG software (including x264) installed. However, I cannot build the source because:

Problem 1: package libavformat-free-devel-6.0-2.fc38.i686 from fedora requires libavformat-free(x86-32) = 6.0-2.fc38, but none of the providers can be installed
Problem 2: package libavcodec-free-devel-6.0-2.fc38.i686 from fedora requires libavcodec-free(x86-32) = 6.0-2.fc38, but none of the providers can be installed
Problem 3: package libswresample-free-devel-6.0-2.fc38.i686 from fedora requires libswresample-free(x86-32) = 6.0-2.fc38, but none of the providers can be installed

Trying to install the RPM file directly results in a similar thing.

package rsgain-3.4-1.x86_64 from @commandline requires libswresample-free >= 6, but none of the providers can be installed
package ffmpeg-libs-6.0-6.fc38.x86_64 from rpmfusion-free conflicts with libswresample-free provided by libswresample-free-6.0-2.fc38.x86_64 from fedora

Can you please help me install the dependencies needed to build this?

Directory scanning doesn't work as intended

If a directory contains different variants of supported file types rsgain skips all files

ls -l testme
total 120002
-rw-r--r--  1 diizzy  diizzy   8212896 Oct 21 22:57 sample-untagged-untouched.m4a
-rw-r--r--  1 diizzy  diizzy   8212896 Oct 21 22:57 sample-untagged-zntouched.m4a
-rw-r--r--  1 diizzy  diizzy  15262725 Oct 21 22:58 sample.mp3
-rw-r--r--  1 diizzy  diizzy  91263054 Oct 21 22:57 sample.wav

rsgain easy -p ebur128 testme
[OK] Applying preset...
[OK] Building directory tree...
[OK] Found 1 directory...
No files were scanned

Remove wav file

ls -l testme
total 30930
-rw-r--r--  1 diizzy  diizzy   8212896 Oct 21 22:57 sample-untagged-untouched.m4a
-rw-r--r--  1 diizzy  diizzy   8212896 Oct 21 22:57 sample-untagged-zntouched.m4a
-rw-r--r--  1 diizzy  diizzy  15262725 Oct 21 22:58 sample.mp3

rsgain easy -p ebur128 testme
[OK] Applying preset...
[OK] Building directory tree...
[OK] Found 1 directory...
No files were scanned

Remove mp3 file

ls -l testme
total 16009
-rw-r--r--  1 diizzy  diizzy  8212896 Oct 21 23:00 sample-untagged-untouched.m4a
-rw-r--r--  1 diizzy  diizzy  8212896 Oct 21 23:00 sample-untagged-zntouched.m4a

....
Files Scanned:     2
....

Wishlist - xHE-AAC / USAC support

It would be nice if rsgain would support this format however support is a bit troublesome in FFmpeg

[✘] Could not open codec: 'Function not implemented'

Reference:
https://hydrogenaud.io/index.php/topic,118888.msg1011212.html#msg1011212

ffmpeg -i sample-xhe-aac.m4a -f wav -acodec pcm_s16le moo.wav
[aac @ 0x83bbc0500] Audio object type 42 is not implemented.

ffmpeg -acodec libfdk_aac -i sample-xhe-aac.m4a -f wav -acodec pcm_s16le foo.wav
Works

From what I can tell you should be able to probe for a specific codec
https://www.ffmpeg.org/doxygen/4.4/group__lavc__core.html#ga776f2359007e8457799503068419e791

Symbol lookup error: undefined symbol

I'm running this through my whole library, and rsgain crashes with:

rsgain: symbol lookup error: rsgain: undefined symbol: _ZN6TagLib4MPEG4File4saveEiNS_4File9StripTagsENS_5ID3v27VersionENS2_13DuplicateTagsE

Do let me know how can I generate more verbose logs to help debugging this. As it stands I don't even know which file triggered it.

Cannot install: package conflict between ffmpeg free libs and ffmpeg libs (Fedora 38)

I am on Fedora 38. Packages ffmpeg and ffmpeg-libs are installed. I can't install the free ffmpeg libraries as they are in conflict, consequently rsgain will not install. Is there any way I can point rsgain to the installed ffmpeg libraries somehow?

> sudo dnf install --allowerasing rsgain.rpm

Installing:
 rsgain                                                  x86_64                                      3.4-1                                               @commandline                                                 151 k
Installing dependencies:
 cjson                                                   x86_64                                      1.7.14-7.fc38                                       fedora                                                        31 k
 codec2                                                  x86_64                                      1.0.5-2.fc38                                        fedora                                                       641 k
 flite                                                   x86_64                                      2.2-5.fc38                                          fedora                                                        13 M
 game-music-emu                                          x86_64                                      0.6.3-11.fc38                                       fedora                                                       157 k
 libavc1394                                              x86_64                                      0.5.4-19.fc38                                       fedora                                                        55 k
 libavcodec-free                                         x86_64                                      6.0-5.fc38                                          updates                                                      4.1 M
 libavdevice-free                                        x86_64                                      6.0-5.fc38                                          updates                                                       90 k
 libavfilter-free                                        x86_64                                      6.0-5.fc38                                          updates                                                      1.5 M
 libavformat-free                                        x86_64                                      6.0-5.fc38                                          updates                                                      1.1 M
 libavutil-free                                          x86_64                                      6.0-5.fc38                                          updates                                                      339 k
 libdc1394                                               x86_64                                      2.2.6-9.fc38                                        fedora                                                       130 k
 libebur128                                              x86_64                                      1.2.6-5.fc38                                        fedora                                                        24 k
 libiec61883                                             x86_64                                      1.2.0-31.fc38                                       fedora                                                        40 k
 libpostproc-free                                        x86_64                                      6.0-5.fc38                                          updates                                                       49 k
 librabbitmq                                             x86_64                                      0.13.0-1.fc38                                       fedora                                                        43 k
 libraw1394                                              x86_64                                      2.1.2-17.fc38                                       fedora                                                        64 k
 librist                                                 x86_64                                      0.2.7-1.fc38                                        fedora                                                        77 k
 libswresample-free                                      x86_64                                      6.0-5.fc38                                          updates                                                       69 k
 libswscale-free                                         x86_64                                      6.0-5.fc38                                          updates                                                      190 k
 lpcnetfreedv                                            x86_64                                      0.2-13.fc38                                         fedora                                                       7.3 M
 mbedtls                                                 x86_64                                      2.28.5-1.fc38                                       updates                                                      396 k
Removing dependent packages:
 ffmpeg                                                  x86_64                                      6.0-11.fc38                                         @rpmfusion-free-updates                                      2.2 M
 ffmpeg-libs                                             x86_64                                      6.0-11.fc38                                         @rpmfusion-free-updates                                       21 M
 libavdevice                                             x86_64                                      6.0-11.fc38                                         @rpmfusion-free-updates                                      167 k
> ffmpeg -version

libavutil      58.  2.100 / 58.  2.100
libavcodec     60.  3.100 / 60.  3.100
libavformat    60.  3.100 / 60.  3.100
libavdevice    60.  1.100 / 60.  1.100
libavfilter     9.  3.100 /  9.  3.100
libswscale      7.  1.100 /  7.  1.100
libswresample   4. 10.100 /  4. 10.100
libpostproc    57.  1.100 / 57.  1.100

"Could not calculate ReplayGain" and "Failed to calculate ReplayGain for '<Album>'"

Hello and thanks first of all for this work!

This is an issue specifically with the MusicBrainz Picard Plugin. If this is the wrong place, please excuse me and let me know where to report my issue instead.

Ever since ReplayGain 2.0 released, I struggled to get it to work. Up to this point I was not able to make it work at all, and I am close to giving up as I am running out of ideas... I hope somebody can help me with this.

The Problem

  • Whenever I right click on a song and click "Calculate ReplayGain ...", the message "Could not calculate ReplayGain" appears
  • Whenever doing so on an album, the message "Failed to calculate ReplayGain for '<Album>'" appears

Error Logs

To be a bit more specific, the activity log looks like this:

2023-02-18 19:33:30,376 - Calculating ReplayGain for 'Eternal Blue'...
2023-02-18 19:33:30,402 - Failed to calculate ReplayGain for 'Eternal Blue.'
2023-02-18 19:33:36,185 - Calculating ReplayGain for /home/chris/.cloud/media/music/spiritbox/2021_eternal_blue/03_yellowjacket.flac...
2023-02-18 19:33:36,209 - Could not calculate ReplayGain.

In all cases, an error message like this appears in the log:

E: 19:10:59,533 /app/lib/python3.9/site-packages/picard/util/thread.run:66: Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/picard/util/thread.py", line 63, in run
    result = self.func()
  File "/home/chris/.var/app/org.musicbrainz.Picard/config/MusicBrainz/Picard/plugins/replaygain2.zip/replaygain2/__init__.py", line 206, in calculate_replaygain
    raise Exception(f'ReplayGain 2.0: rsgain returned non-zero code ({rc})')
Exception: ReplayGain 2.0: rsgain returned non-zero code (127)

About My System

  • My OS is Debian 11 (bullseye) with Linux 5.10.0-20
  • I installed Picard as recommended for Linux using Flatpak
  • I installed rsgain as recommended here in this repo, and it seems to work from the terminal:
 $ rsgain --help
Usage: rsgain [OPTIONS] <command> ...
rsgain 3.2 supports writing tags to the following file types:
  FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),
  MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),
  WAV (.wav), and AIFF (.aiff, .aif, .snd).

Options:
  -h,   --help              Show this help.
  -v,   --version           Show version number.

Commands:
  easy                    Easy Mode:   Recursively scan a directory with recommended settings.
  custom                  Custom Mode: Scan individual files with custom settings.

Run 'rsgain easy --help' or 'rsgain custom --help' for more information.

Please report any issues to https://github.com/complexlogic/rsgain/issues

 chris@phi-deianeira  ~/media/music/spiritbox  rsgain easy 2021_eternal_blue
[✔] Building directory tree...
[✔] Found 1 directory...
[✔] Scanning directory for files...
[✔] Scanning '2021_eternal_blue/03_yellowjacket.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/02_hurt_you.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/12_constance.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/08_eternal_blue.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/09_we_live_in_a_strange_world.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/06_silk_in_the_strings.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/11_circle_with_me.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/04_the_summit.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/07_holy_roller.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/10_halcyon.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/01_sun_killer.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]
[✔] Scanning '2021_eternal_blue/05_secret_garden.flac'
[✔] Container: raw FLAC [flac]
[✔] Stream #0: FLAC (Free Lossless Audio Codec), 16 bit, 44,100 Hz, 2 ch
 100% [==================================================================================================================================================================================================================================================================================]

Track: 2021_eternal_blue/03_yellowjacket.flac
  Loudness:    -6.19 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -11.81 dB 


Track: 2021_eternal_blue/02_hurt_you.flac
  Loudness:    -5.61 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -12.39 dB 


Track: 2021_eternal_blue/12_constance.flac
  Loudness:    -8.17 LUFS
  Peak:     0.964935 (-0.31 dB)
  Gain:        -9.83 dB 


Track: 2021_eternal_blue/08_eternal_blue.flac
  Loudness:    -6.82 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -11.18 dB 


Track: 2021_eternal_blue/09_we_live_in_a_strange_world.flac
  Loudness:    -7.55 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -10.45 dB 


Track: 2021_eternal_blue/06_silk_in_the_strings.flac
  Loudness:    -5.66 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -12.34 dB 


Track: 2021_eternal_blue/11_circle_with_me.flac
  Loudness:    -6.32 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -11.68 dB 


Track: 2021_eternal_blue/04_the_summit.flac
  Loudness:    -6.11 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -11.89 dB 


Track: 2021_eternal_blue/07_holy_roller.flac
  Loudness:    -7.29 LUFS
  Peak:     0.965088 (-0.31 dB)
  Gain:       -10.71 dB 


Track: 2021_eternal_blue/10_halcyon.flac
  Loudness:    -5.97 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -12.03 dB 


Track: 2021_eternal_blue/01_sun_killer.flac
  Loudness:    -7.34 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -10.66 dB 


Track: 2021_eternal_blue/05_secret_garden.flac
  Loudness:    -5.79 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -12.21 dB 

Album:
  Loudness:    -6.44 LUFS
  Peak:     0.981995 (-0.16 dB)
  Gain:       -11.56 dB 


Scanning Complete
Time Elapsed:      00:00:06
Files Scanned:     12
Clip Adjustments:  0 (0.0% of files)
Average Gain:      -11.43 dB
Average Peak:      0.979164 (-0.18 dB)
Negative Gains:    12 (100.0% of files)
Positive Gains:    0 (0.0% of files)

  • Since flatpak is sandboxed, I used flatseal in order to try to make the plugin aware of the executable. Here are my settings:
  • In flatseal:

image

I also thought that maybe it is an issue with dynamically linked libraries not being found within the sandbox, so I added:

image

(of no avail)

  • Here are my settings in Picard:

image

More

I understand that I probably miss some additional important information, even though I tried to be thorough. Please just let me know and I will try to provide anything else needed to track this down.

Help to get close to this target

Hi I want to get my library normalize from ASWG-R001 PORTABLE / Max Integrated: -18 (±2) LKFS / Max True Peak: -1dB.
Im using this line code but I dont know if Im doing it right.
All the songs are in FLAC so this is my config showed in the preset file.

rsgain easy -p loudgain -m max "0:/folder/etc"

[FLAC]
#TagMode=i
#Album=true
#TargetLoudness=-18
#ClipMode=a
#MaxPeakLevel=-1.0
#TruePeak=true

ReplayGain 2.0 for Opus Files

First and foremost, thank you for your dedication to building and maintaining this application. I am currently in the process of transitioning from MP3 to the Opus file format, with about 10% of my files still in MP3 and M4A formats.

Regarding ReplayGain, I prefer to stick with the 2.0 standard. 'Rsgain' has successfully tagged the Opus files with 2.0 tags, and I am not experiencing any issues with playback. Both the web player and desktop player can detect the ReplayGain tags and apply them accordingly.

I would like to seek clarification on whether sticking with the ReplayGain 2.0 standard could cause any issues now or in the near future. In your documentation, you mentioned, 'If you wish to write tags that are fully compliant to RFC 7845 instead of ReplayGain 2.0, you can use the -o 's' option.' Is this compliance merely for documentation purposes, or are there potential technical issues I might encounter?

Default profile ignores OpusMode?

Changing OpusMode in default.ini seems to have no effect, no matter what is set in [Global] or [Opus]:

[Global]
Album=true
...
OpusMode=r
TagMode=i
TargetLoudness=-18
TruePeak=false

[Opus]
OpusMode=r

Although it does work using a separate profile opus.ini (rsgain easy -S -p opus):

[Global]
TagMode=n

[Opus]
OpusMode=r
TagMode=i
TargetLoudness=-23

Crashes while going through a large library in multithreaded mode can lead to data loss.

When rsgain stumbles into a damaged unplayable file -- which do exist in sufficiently large libraries -- it's liable to segfault:

[102904.055817] rsgain[277209]: segfault at 0 ip 00007fd13ca704d3 sp 00007ffd20513768 error 4 in libswresample.so.3.5.100[7fd13ca60000+16000]
[102904.055840] Code: 00 00 0f 85 59 ff ff ff 48 8d 34 96 48 8d 0c 91 48 8d 3c 97 48 f7 da 66 0f 6f 2d d8 80 00 00 66 0f 6f 04 96 66 0f 6f 4c 96 10 <66> 0f 6f 14 91 66 0f 6f5c 91 10 0f 59 c5 0f 59 cd 0f 59 d5 0f 59

Unfortunately, if that happens while it's running in multithreaded mode, and the other thread is saving replaygain tags, the crash can lose you data -- unrelated, undamaged files get renamed.

It would be nice if this sort of segfault was caught and damaged files reported instead, because that makes multithreaded mode unusable.

Work files (and log changes) in alphanumeric order

I wanted to compare two different versions of an album I have, but it got tedious when I realized that rsgain will process and log the result in what looks like a random order? I had to sort the CSV file later in order to compare results. Would be nice if this all processing and logging was done following alphanumeric order on the filenames.

std::vector Operator [] Assertion

I added --skip-existing so it would quickly get to where it gave me the error again.

famewolf@TP01-2066  /mnt/tank/shared/media  rsgain easy -m MAX --skip-existing ./music
[✔] Building directory tree...
[✔] Found 3,426 directories...
[✔] Scanning directories for files...
[✔] Scanning with 16 threads...
/usr/include/c++/12.2.1/bits/stl_vector.h:1123: constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = ScanJob::Track; _Alloc = std::allocatorScanJob::Track; reference = ScanJob::Track&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
[1] 1545602 IOT instruction (core dumped) rsgain easy -m MAX --skip-existing ./music

small bug: --clip-mode

rsgain custom --tagmode='i' --clip-mode='n' -- *.flac
[✘] Unrecognized option 'c'

the short option works though (-c n)

rsgain-git 3.1.1 (AUR)
manjaro linux

Understanding the modes

Does custom mode assume all listed files are part of the same album? That is not quite clear from the manual.

Similarly for easy mode it does not mention whether it writes the tags to the files automatically.

Can't build on macOS Big Sur (11.6.8)

Using the default compiler (Apple clang version 13.0.0 (clang-1300.0.29.30)) it never finishes building, due to "implicit instantiation of undefined template".
If I brew install gcc-12, it builds (with lots of warnings) but can't seem to properly open files for analysis.
See attachments. Any help would be appreciated!
rsgain.clang.txt
rsgain.gcc.txt

question on commandline - windows

Question

If my understanding is correct

will scan and + or -ve gain the songs in the path as seen in the report
rsgain easy test\music

How do we ungain the rsgain settings? Some tutorial will be helpful

Do we need to Undo gain changes by mp3gain before doing rsgain? if the particular song has already gone through mp3gain.

How do we gain the new song in the same album which has rsgain if it it is added later?

Thank you

2 questions about 3.0 release

1, Why have the strip tag option -S been removed?
2. Are you going to upload this project to software repositories of those popular Linux distros?

Wrong gain on opus files

When applying a given loudness to the same song in multiple formats, the opus files are noticeably louder than the rest.

For example, I start with 2 songs (another.wav and teset.wav), encode them in mp3, aac, and opus, then apply replaygain with:

$ rsgain custom -s i -l -14 -c n -o r -a -O *
Filename        Loudness (LUFS) Gain (dB)       Peak     Peak (dB)      Peak Type       Clipping Adjustment?
another.m4a     -7.22   -6.78   1.000000        0.00    Sample  N
another.mp3     -7.11   -6.89   1.000000        0.00    Sample  N
another.opus    -7.10   -6.90   1.000000        0.00    Sample  N
another.wav     -7.14   -6.86   0.999817        -0.00   Sample  N
teset.m4a       -14.12  0.12    0.989655        -0.09   Sample  N
teset.mp3       -13.99  -0.01   1.000000        0.00    Sample  N
teset.opus      -14.10  0.10    0.993439        -0.06   Sample  N
teset.wav       -14.03  0.03    0.999908        -0.00   Sample  N
Album   -9.19   -4.81   1.000000        0.00    Sample  N

Foobar2000 tells me another.m4a has a track gain of -6.78dB and an album gain of -4.81dB, which matches rsgain's output. But for another.opus, track gain is -1.90dB and album gain is +0.19dB.

Same goes with teset.opus which has gains of +5.10dB and +0.19dB.

Now, maybe that's a problem with how Foobar reads the header, I don't know. Rsgain and Foobar seem to handle the ogg header very differently.

no run with certain arguments

Executing the following:

for %%F in ("%FOLDER%\*.mp3") do (
    rsgain custom -t -I 4 -L -s i -c p -l -18 "%%F"
)

Won't run in Win7 x64 until I remove -t (true peak) and lower tag version to 3 (-I 3).
Also -s doesn't accept e anymore

Old version (2.0.1) works fine:

for %%F in ("%FOLDER%\*.mp3") do (
    rsgain custom -r -k -K -2.0 -s e -d 0.0 -L -S -I 4 "%%F"
)

Options doesn't get properly evaluated

Option parsing seems a bit broken

Examples:

rsgain easy -mq testdir
rsgain custom -Ical testdir/mp3/sample.mp3

This should fail looking at the documentation?
I would also argue that rsgain should fail on non existing ones instead of listing as invalid.

Edit: Using latest commit in master branch (3386656)

TagMode n still scans skipped files

According to Tag Mode n easy mode should skip all files except .opus but it still scans and doesn't update other files.
rsgain easy -S -p opus .../
opus.ini

[Global]
TagMode=n

[Opus]
OpusMode=r
TagMode=i
TargetLoudness=-23

The other way around it scans and even updates .opus with all the other files.
...

Not writing to ID3v2 tag

If I don't define lowercase (-L) for custom mode, rsgain won't write track replay gain to ID3v2 tag field.
Using this call:
rsgain custom -r -k -K -1.0 -s e -d 0.0 -S -I 4 "%%F"

Is this ok? As uppercase seems to be the standard.

By the way, I'm on Win7 but despite what the readme says it works on this OS as well.

Extra Tags

Loudgain used to have an option to write extra tags (reference/ranges), which seems to have been removed here, is there any chance of it being implemented again?

Unable to build on macOS 13.0 Ventura

Attempting to use Homebrew to install, or manually build from source, results in this error:

🕙 15:24:37 jeffbyrnes in rsgain/build on  master
♠ cmake .. -DCMAKE_BUILD_TYPE=Release
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Checking for module 'libavcodec'
--   Found libavcodec, version 59.37.100
-- Checking for module 'libavformat'
--   Found libavformat, version 59.27.100
-- Checking for module 'libswresample'
--   Found libswresample, version 4.7.100
-- Checking for module 'libavutil'
--   Found libavutil, version 57.28.100
-- Checking for module 'taglib>=1.12'
--   Found taglib, version 1.13
-- Checking for module 'libebur128>=1.2.4'
--   Found libebur128, version 1.2.6
-- Checking for module 'inih'
--   Found inih, version 56
-- Checking for module 'fmt'
--   Found fmt, version 9.1.0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jeffbyrnes/dev/rsgain/build

🕙 15:24:47 jeffbyrnes in rsgain/build on  master [?]
♠ make
[ 16%] Building CXX object src/CMakeFiles/rsgain.dir/rsgain.cpp.o
In file included from /Users/jeffbyrnes/dev/rsgain/src/rsgain.cpp:54:
/Users/jeffbyrnes/dev/rsgain/src/output.hpp:90:24: error: field has incomplete type 'struct winsize'
        struct winsize ws;
                       ^
/Users/jeffbyrnes/dev/rsgain/src/output.hpp:90:16: note: forward declaration of 'winsize'
        struct winsize ws;
               ^
1 error generated.
make[2]: *** [src/CMakeFiles/rsgain.dir/rsgain.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/rsgain.dir/all] Error 2
make: *** [all] Error 2

Opening output.hpp in Visual Studio Code triggers showing the same issue on that line.

Output argument not recognized when typed fully

When fully qualifying the output argument as --output, it is not recognized. So,
rsgain easy --output -m MAX /media/Take/Music/
fails, but
rsgain easy -O -m MAX /media/Take/Music/
works.

Can't install rsgain_3.3_amd64.deb on Ubuntu 23.04

Hello,

I've tried your installation method mentioned in README.md on Ubuntu 23.04, but it failed. Here is the output.

$ uname -a
Linux PC 6.2.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 23:39:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.04
Release:	23.04
Codename:	lunar

$ wget https://github.com/complexlogic/rsgain/releases/download/v3.3/rsgain_3.3_amd64.deb
--2023-08-14 20:31:13--  https://github.com/complexlogic/rsgain/releases/download/v3.3/rsgain_3.3_amd64.deb
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/462094738/777a183c-541c-4c50-a96a-a2ec74d77e08?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230814%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230814T183113Z&X-Amz-Expires=300&X-Amz-Signature=d673f79ec1db6df9104753accb0e4b85397df265c719a9a0b43bde72f68ac72c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=462094738&response-content-disposition=attachment%3B%20filename%3Drsgain_3.3_amd64.deb&response-content-type=application%2Foctet-stream [following]
--2023-08-14 20:31:14--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/462094738/777a183c-541c-4c50-a96a-a2ec74d77e08?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230814%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230814T183113Z&X-Amz-Expires=300&X-Amz-Signature=d673f79ec1db6df9104753accb0e4b85397df265c719a9a0b43bde72f68ac72c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=462094738&response-content-disposition=attachment%3B%20filename%3Drsgain_3.3_amd64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 551074 (538K) [application/octet-stream]
Saving to: ‘rsgain_3.3_amd64.deb’

rsgain_3.3_amd64.deb                   100%[=========================================================================>] 538,16K  --.-KB/s    in 0,05s   

2023-08-14 20:31:14 (9,63 MB/s) - ‘rsgain_3.3_amd64.deb’ saved [551074/551074]

$ sudo apt install ./rsgain_3.3_amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'rsgain' instead of './rsgain_3.3_amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 rsgain : Depends: libavcodec58 (>= 4.2.4) but it is not installable
          Depends: libavutil56 (>= 4.2.4) but it is not installable
          Depends: libswresample3 (>= 4.2.4) but it is not installable
          Depends: libavformat58 (>= 4.2.4) but it is not installable
E: Unable to correct problems, you have held broken packages.
100 ↵

Is there an easy way to install on Ubuntu 23.04? Thanks.

TagLib causing SegFault from MP4 with video

After hours of narrowing down the file causing the segfault, I got hit with the ultimate Rick Roll:
https://transfer.sh/77AceW2UaE/rick.mp4

I honestly had no idea this file was in my collection, and I have no need for it, but I figured this information would help to make the program more robust.

rsgain easy .

[✔] Building directory tree...
[✔] Found 1 directory...
[✔] Scanning directory for files...
[✔] Scanning './01 Never Gonna Give You Up.mp4'
[✔] Container: QuickTime / MOV [mov,mp4,m4a,3gp,3g2,mj2]
[✔] Stream #2: AAC (Advanced Audio Coding), 22,050 Hz, 2 ch
 100% [===============================================]
Segmentation fault (core dumped)

ffprobe

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559b034908c0] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '01 Never Gonna Give You Up.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder-eng     : Lavf51.8.0
    title-eng       : Never Gonna Give You Up
    album           : Whenever You Need Somebody
    track           : 1/10
    disc            : 1/1
    date            : 1987-10-01
    compilation     : 1
    sort_album_artist: Astley, Rick
    sort_artist     : Astley, Rick
    album_artist    : Rick Astley
    creation_time   : 1970-01-01T00:00:00.000000Z
    com.apple.quicktime.displayname: Never Gonna Give You Up
    com.apple.quicktime.artist: Rick Astley
    playback_requirements: QuickTime 6.0 or greater
    playback_requirements-eng: QuickTime 6.0 or greater
    encoder         : Lavf51.8.0
    artist-eng      : Rick Astley
    title           : Never Gonna Give You Up
    artist          : Rick Astley
  Duration: 00:03:32.75, start: 0.000000, bitrate: 398 kb/s
  Stream #0:0[0x0]: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 953x953 [SAR 200:200 DAR 1:1], 90k tbr, 90k tbn (attached pic)
  Stream #0:1[0x1](eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 323 kb/s, 24 fps, 24 tbr, 24 tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : FFMP
      encoder         : mpeg4
  Stream #0:2[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 64 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

Journalctl

Nov 01 01:13:24 PC kernel: rsgain[375562]: segfault at 10 ip 00007f0b903a8f34 sp 00007ffe9f993718 error 4 in libtag.so.1.19.1[7f0b90347000+77000] likely on CPU 4 (core 4, socket 0)
Nov 01 01:13:24 PC kernel: Code: ff 4d 39 f7 75 84 e9 d4 fe ff ff 0f 1f 00 b8 01 00 00 00 e9 bd fe ff ff f3 0f 1e fa 48 89 c3 e9 fe c2 fa ff 66 90 f3 0f 1e fa <48> 8b 7f 10 48 83 c7 10 e9 1f fe ff ff 90 66 66 2e 0f 1f 84 00 00
Nov 01 01:13:24 PC systemd[1]: Started Process Core Dump (PID 375563/UID 0).
Nov 01 01:13:24 PC systemd-coredump[375564]: [🡕] Process 375562 (rsgain) of user 1000 dumped core.
                                                   
                                                   Stack trace of thread 375562:
                                                   #0  0x00007f0b903a8f34 _ZN6TagLib3MP43Tag10removeItemERKNS_6StringE (libtag.so.1 + 0xa5f34)
                                                   #1  0x0000557c54087c9a n/a (rsgain + 0x18c9a)
                                                   #2  0x0000557c5407ee64 n/a (rsgain + 0xfe64)
                                                   #3  0x0000557c54081cc0 n/a (rsgain + 0x12cc0)
                                                   #4  0x0000557c5408cdb9 n/a (rsgain + 0x1ddb9)
                                                   #5  0x0000557c5408efdc n/a (rsgain + 0x1ffdc)
                                                   #6  0x0000557c54077c89 n/a (rsgain + 0x8c89)
                                                   #7  0x00007f0b8e445cd0 n/a (libc.so.6 + 0x27cd0)
                                                   #8  0x00007f0b8e445d8a __libc_start_main (libc.so.6 + 0x27d8a)
                                                   #9  0x0000557c54077ff5 n/a (rsgain + 0x8ff5)
                                                   ELF object binary architecture: AMD x86-64

Segmentation fault (core dumped) on some files

I have been encountering some crashes on a couple of files. I am not sure why these fails, I have verified that the files are not corrupted. Here are a couple of the files that makes rsgain crash.

rsgain-crash.zip

I have a feeling that one of the files is too short (803 milliseconds) but maybe it should just be padded with silence at the end automatically in case it is too short? But for the MP3 file, I have no idea why it crashes.

If I can provide more detail, please tell me.

I am running rsgain 3.2.1 - using:
   libebur128     1.2.6
   libavformat    60.3.100
   libavcodec     60.3.100
   libavutil      58.2.100
   libswresample  4.10.100

Built with:
   taglib         1.13.0

Compiler:         GCC 12.2
Build Date:       Apr  2 2023

opus-mode=t does not seem to do anything.

I found this project after the r128gain project was deprecated. For my opus files, I used the r128gain --opus-output-gain option, which according to the help output:

For Opus files, write album or track gain in the 'output gain' Opus header. This gain is mandatory to apply for all Opus decoders so this improve compatibility with players not supporting the R128 tags.

Looking at the rsgain help output, the --opus-mode=t seems to be what I'd want to replicate this. However, I tried to use this option on my opus files, and it doesn't seem to do anything, and the file remains unmodified. I'm not sure if there's an issue, or I'm missing an option or something that would actually do the write

To run through an example, I downloaded an opus sample file at https://opus-codec.org/static/examples/ehren-paper_lights-96.opus. In the following, I use rsgain to measure the loudness, attempt to use rsgain to set the output gain header, re-measure with rsgain (which shows no change), use r128gain to update the header, re-measure with rsgain (which shows an expected -23dB LUFS)

$ rsgain custom ehren-paper_lights-96.opus
Track: ehren-paper_lights-96.opus
  Loudness:   -14.66 LUFS
  Peak:     1.000000 (0.00 dB)
  Gain:        -3.34 dB
$ rsgain custom --opus-mode=t ehren-paper_lights-96.opus
Track: ehren-paper_lights-96.opus
  Loudness:   -14.66 LUFS
  Peak:     1.000000 (0.00 dB)
  Gain:        -3.34 dB
$ rsgain custom ehren-paper_lights-96.opus
Track: ehren-paper_lights-96.opus
  Loudness:   -14.66 LUFS
  Peak:     1.000000 (0.00 dB)
  Gain:        -3.34 dB
$ r128gain --opus-output-gain ehren-paper_lights-96.opus
Analyzing loudness of file 'ehren-paper_lights-96.opus'...                                                                                                                                                           
File 'ehren-paper_lights-96.opus': loudness = -14.7 LUFS, sample peak = -                                                                                                                                            
Tagging file 'ehren-paper_lights-96.opus'
$ rsgain custom ehren-paper_lights-96.opus
Track: ehren-paper_lights-96.opus
  Loudness:   -22.96 LUFS
  Peak:     0.418701 (-7.56 dB)
  Gain:         4.96 dB

questions about gain code stability and metaflac

hello @complexlogic

  1. i can't help but notice you're pumping out a lot of updates - my question is whether the actual gain code/algorithm is stable as far as the RG values that get written to the files, or whether it might change

  2. regarding the consistency of the volume on a track by track basis (vs. album), i'd like to hear any comments you might have with rsgain vs. metaflac

rsgain chokes on large file names

When scanning my music folder, it stops on the infamous Fiona Apple release with the very very very long name. It gives my preferred music player fits as well.

Last line when scanning gives a clue, but I can enable logging as well if needed
10.1% Scanning directory '/media/Take/Music/Apple, Fiona/[1999] When the Pawn Hits the Conflicts He Thinks Like a King What He Knows Throws the Blows When He Goes to the Fight and Segmentation faultirectory '/media/Take/Music/Various Artists/[2019] Paste Studio Sampler #5 - October 2019'...

Missing dependency [ubuntu]

rsgain: error while loading shared libraries: libinih.so.1: cannot open shared object file: No such file or directory

Fixed by installing libinih1

Q: 'add mp4 support'

hello again!

what exactly does 'add mp4 support' mean? can rsgain now be run on mp4 files which contain both audio and video?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.