[Matroska-users] Question on ReplayGain tags

Steve Lhomme slhomme at matroska.org
Sun Feb 13 08:40:54 CET 2011


On Sat, Feb 12, 2011 at 6:47 PM, Johannes Weißl <jargon at molb.org> wrote:
> Hello Steve,
>
> thanks for the clarification! I still think a text value would be so
> much better, not just for supporting a single proprietary player:
>
> * Tag can be displayed / edited, even if only simple tags are supported
>  (which is so convenient with vorbistags as compared to e.g. id3, where
>  many fields can only displayed/edited if they are supported).
>  Right now it is only a hex64-blob in the tags xml file.

But ReplayGain is not something you're supposed to edit manually. It
takes an analyzer to get the actual value. It takes such a "heavy"
code to edit the ReplayGain value, so storing it in the way that might
be found elsewhere and in binary is not a big deal. It's may only be
tricky to display the value for regular tag editors. But even so, the
binary format is not that complex. In the end you don't want users to
directly edit text in there and possibly make a typo and put some just
not appropriate for a ReplayGain value.

> * I think the compact binary-style spec at replaygain.org was meant for
>  much more inflexible formats than matroska, where we can easily add
>  variable-length data because of the xml-like structure.
> * Numeric values can be stored in arbitrary precision.

Again there's the typo problem. The ReplayGain, unlike most tags, is
actually used to alter/improve playback. You don't want people to
easily mess with that.

> * Matroska doesn't need the first three bits (name code) at all, it
>  would be confusing if the name code and the TargetType differ.

True

> * The originator code isn't very important, nobody uses it. If we don't
>  want to loose this information, a new text tag (REPLAYGAIN_ORIGINATOR)
>  would be much more flexible.

In fact, it should be done with a nested tag, so that the originator
applies to its parent.

> The binary format has no advantages I can think of.

See above :)

> I think it is not too late to change the spec, especially because there
> are almost none (if any?) implementations...

Well, I thought the same for the 3D StereoMode field until someone
came out of the wood and said it was in fact used. So I won't try to
go that way again.

The sad thing here is that there is a clear spec of how ReplayGain is
supposed to be stored in Matroska. It's been like that before
foobar2000 adding tag support in Matroska. And still, they store it
incorrectly, when it would not take much to use a different name to
store the value.
IIRC the source for the foobar2000 Matroska handler are available. So
it may be possible to modify that to write another tag or the proper
binary value (or both). We are soon going to introduce Matroska v3 and
that way it should be possible to clean such legacy (ie know if the
old or new value is used).

If you know people at foobar2000, let them know of the possible fix
(or direct them to this thread).

Steve

> At least it is very easy to differentiate between binary/text because
> the tags are typed.
>
> Johannes
>
>
> On Sat, Feb 12, 2011 at 10:00:12AM +0100, Steve Lhomme wrote:
>> Yes the values are according to [2] as implied in the specs by the
>> link to http://www.replaygain.org/
>>
>> I'm not too thrilled to change the meaning in the specs just because
>> one player decided to go its way without looking at the specs. At the
>> very least foobar2000 should store the value in another tag than the
>> ones that are clearly specified as binary. Also it seems the binary
>> format offers many more information than just "+9.65 dB" for example
>> if the gain was specified in the studio, by a user, etc.
>>
>> We are going to introduce a new Matroska v3 (ie put 3 in the header)
>> to get rid of legacies like that (and add new things). I suggest the
>> foobar2k dev check this value and store it in binary from now on in v3
>> files. So they can tell between current and future files the meaning
>> of the REPLAYGAIN_GAIN and REPLAYGAIN_PEAK tag values.
>>
>> Steve
>>
>> On Thu, Feb 10, 2011 at 5:31 AM, Johannes Weißl <jargon at molb.org> wrote:
>> > Hello list,
>> >
>> > I have a question on the replaygain tags in Matroska. The documentation [1]
>> > states that the type of REPLAYGAIN_GAIN and REPLAYGAIN_PEAK is "binary".
>> > Does this mean that the value should be stored according to the Replay
>> > Gain Data Format [2]? I don't know if that makes much sense, since this
>> > format encodes a "name", which is redundant since Matroska has something
>> > similar using TargetType. The only existing program I could find which
>> > writes those tags is foobar2000, and it stores the values as UTF-8 text
>> > (e.g. "+9.65 dB").
>> >
>> > [1] http://www.matroska.org/technical/specs/tagging/index.html
>> > [2] http://replaygain.hydrogenaudio.org/rg_data_format.html
>> >
>> >
>> > Greetings,
>> > Johannes
>> >
>> > _______________________________________________
>> > Matroska-users mailing list
>> > Matroska-users at lists.matroska.org
>> > http://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-users
>> > Read Matroska-Users on GMane: http://dir.gmane.org/gmane.comp.multimedia.matroska.user
>> >
>> >
>>
>>
>>
>> --
>> Steve Lhomme
>> Matroska association Chairman
>> _______________________________________________
>> Matroska-users mailing list
>> Matroska-users at lists.matroska.org
>> http://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-users
>> Read Matroska-Users on GMane: http://dir.gmane.org/gmane.comp.multimedia.matroska.user
>
> _______________________________________________
> Matroska-users mailing list
> Matroska-users at lists.matroska.org
> http://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-users
> Read Matroska-Users on GMane: http://dir.gmane.org/gmane.comp.multimedia.matroska.user
>
>



-- 
Steve Lhomme
Matroska association Chairman



More information about the Matroska-users mailing list