Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ReplayGain
14-04-2023, 07:05
Post: #1
ReplayGain
I have been using MP3Gain to calculate ReplainGain for mp3 files. The values are stored in APEv2 tags. Does MinimServer/MinimStreamer recognise these tags, and is there a definitive way to determine whether ReplayGain is applied, either with BubbleUPNP and Hi-Fi Cast? At times, I wonder whether ReplayGain is applied. Thanks.
Find all posts by this user
Quote this message in a reply
14-04-2023, 07:21
Post: #2
RE: ReplayGain
I do not know if this still is the way to set it up, but in 2018 Simon did write: https://forum.minimserver.com/archive/in...365-5.html
Find all posts by this user
Quote this message in a reply
14-04-2023, 09:45 (This post was last modified: 14-04-2023 11:24 by simbun.)
Post: #3
RE: ReplayGain
I can't confirm whether those tags are used but one way to check would be to split the mp3 file into chunks and apply different gain values to the alternating pieces, then play it back (making sure to change the tracknumber of the parts so they're played sequentially).

I use this track splitting approach to test if a renderer supports gapless playback (can test multiple track transitions quickly) where I use sox to perfom the split:
Code:
sox 01.01.flac 02.%2n.flac trim 0 20 : newfile : restart

EDIT: Looking at wikipedia MP3Gain appears to edit the audio itself (information on how to undo the changes are stored in the tags, not the gain itself), so there's nothing to apply in MinimServer.
Find all posts by this user
Quote this message in a reply
15-04-2023, 06:16
Post: #4
RE: ReplayGain
(14-04-2023 07:21)tarnkappe Wrote:  I do not know if this still is the way to set it up, but in 2018 Simon did write: https://forum.minimserver.com/archive/in...365-5.html

I remember that thread and added it to the properties, i.e. convOut=-af volume=replaygain=track for stream.options and included mp3:wav;44 in stream.transcode. I don't believe that it works on mp3 files where ReplayGain was applied using MP3Gain that writes the values to APE tag by default. Synology mediaserver seems to be able to read the tag, but is not as refined a mediaserver as MinimServer. Would it work if the tags were written to ID3v2.3 instead?
Find all posts by this user
Quote this message in a reply
15-04-2023, 06:20
Post: #5
RE: ReplayGain
(14-04-2023 09:45)simbun Wrote:  I can't confirm whether those tags are used but one way to check would be to split the mp3 file into chunks and apply different gain values to the alternating pieces, then play it back (making sure to change the tracknumber of the parts so they're played sequentially).

I use this track splitting approach to test if a renderer supports gapless playback (can test multiple track transitions quickly) where I use sox to perfom the split:
Code:
sox 01.01.flac 02.%2n.flac trim 0 20 : newfile : restart

EDIT: Looking at wikipedia MP3Gain appears to edit the audio itself (information on how to undo the changes are stored in the tags, not the gain itself), so there's nothing to apply in MinimServer.

That is incorrect. MP3Gain does not modify the file, but adds the information as an APE tag incl. undo information. It is a nifty little program.
Find all posts by this user
Quote this message in a reply
15-04-2023, 08:46
Post: #6
RE: ReplayGain
(15-04-2023 06:20)jes Wrote:  That is incorrect. MP3Gain does not modify the file, but adds the information as an APE tag incl. undo information. It is a nifty little program.
I've never used this program before, but I think you're wrong. Hydrogenaud.io has a good explanation of what it does. It does make sense to apply the changes directly to the audio as otherwise you'd need every player to support the tags, this way it "just works".

As a quick test, I chose a quiet song (from my FLAC collection), converted it to MP3, took a copy of it and ran one through MP3Gain. Removed all the tags from the "gained" song, and compared both in Audacity and one is much louder than the other.
I also split both MP3's into 20 second chunks, interleaved the tracks so they formed one coherent song and then indexed with MinimServer and the gain was obvious.

I used the default settings in MP3Gain if that makes a difference.
Find all posts by this user
Quote this message in a reply
15-04-2023, 11:52 (This post was last modified: 15-04-2023 11:53 by simoncn.)
Post: #7
RE: ReplayGain
I ran a test to check whether
1) mp3gain changes audio data in the file
2) the APEv2 tags written by mp3gain are readable by ffmpeg (the converter program that MinimServer uses when transcoding a stream)

The test MP3 file I used contained no metadata before running the test. The test command I used was:

mp3gain -r test.mp3

The test results were
1) the audio data in the file was modified
2) ffmpeg doesn't read APEv2 tags in MP3 files

The test was performed using mp3gain version 1.2.5.
Find all posts by this user
Quote this message in a reply
15-04-2023, 12:13 (This post was last modified: 15-04-2023 12:29 by simbun.)
Post: #8
RE: ReplayGain
I've just been playing with it too :-)

It might be that the OP is just performing the analysis stage as this would just add the tags, although you're then limited to software that supports the tags, which is probably why they chose the other route.
Find all posts by this user
Quote this message in a reply
15-04-2023, 12:29
Post: #9
RE: ReplayGain
That makes sense. In that case the APEv2 tags would need to be converted to ID3v2 so that MinimStreamer/FFmpeg can read them.
Find all posts by this user
Quote this message in a reply
16-04-2023, 06:39 (This post was last modified: 16-04-2023 06:44 by jes.)
Post: #10
RE: ReplayGain
(15-04-2023 12:29)simoncn Wrote:  That makes sense. In that case the APEv2 tags would need to be converted to ID3v2 so that MinimStreamer/FFmpeg can read them.

Do you have a suggestion how this can be done? All song information is in ID3v2 tags, only replaygain info is in APE tags. I have not yet found a simple way to merge the two formats into one without fields being overwritten and info lost. The fields are 100% complimentary, no overlaps.

There also seems to be a difference in replaygain values for the same mp3 file if MP3Gain or Foobar2000 is used. For example:

MP3Gain APE tags:
MP3GAIN_MINMAX="112,181"
MP3GAIN_UNDO="+005,+005,N"
REPLAYGAIN_TRACK_GAIN="-0.995000 dB"
REPLAYGAIN_TRACK_PEAK="0.446419"

Foobar2000 ID3v2 tags:
TXXX="replaygain_track_gain -10.09 dB"
TXXX="replaygain_track_peak 1.087579"

If I undo MP3gain changes, I get these APE tags:
MP3GAIN_MINMAX="117,186"
MP3GAIN_UNDO="+000,+000,N"
REPLAYGAIN_TRACK_GAIN="-8.520000 dB"
REPLAYGAIN_TRACK_PEAK="1.061769"

I guess APE tags could be just deleted at this stage.

Sounds all a bit complex and any clarifications are welcome.

PS: ReplayGain done with Foobar2000 rather than MP3Gain appears to work with MinimStreamer/ffmpeg.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)