IPB

Welcome Guest ( Log In | Register )

23 Pages V  « < 20 21 22 23 >  
Closed TopicStart new topic
R128GAIN: An EBU R128 compliant loudness scanner
westis
post Apr 27 2013, 11:03
Post #526





Group: Members
Posts: 2
Joined: 27-April 13
Member No.: 107859



How can I use this tool to normalize mpeg-2 and h.264 files?
Go to the top of the page
+Quote Post
pbelkner
post Apr 28 2013, 11:38
Post #527





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (westis @ Apr 27 2013, 12:03) *
How can I use this tool to normalize mpeg-2 and h.264 files?

You may consider re-wrapping them into a MKV container by choosing the MKV format.
Go to the top of the page
+Quote Post
westis
post Apr 28 2013, 12:34
Post #528





Group: Members
Posts: 2
Joined: 27-April 13
Member No.: 107859



QUOTE (pbelkner @ Apr 28 2013, 11:38) *
QUOTE (westis @ Apr 27 2013, 12:03) *
How can I use this tool to normalize mpeg-2 and h.264 files?

You may consider re-wrapping them into a MKV container by choosing the MKV format.


Thanks for your reply. I need the final file in H.264/AVC/MPEG-4 Part 10, since this is for TV broadcasting. I tried separating audio and video, to normalize the audio and then merge audio and video together. But the audio doesn't change. I have downloaded the shared autobuild of ffmpeg and replaced the dll's in the r128gain-tools folder.

The script that I use is one that Charalampos Tsimpouris helped me adapt from his script at http://1024.gr/blog/normalize-audio-movies...and-sox-windows. It looks like this:

CODE
echo off
cls
echo Script by http://1024.gr

cd /d %~dp0

echo Extracting audio to "%~1_clean.wav"..
r128gain-1.0-beta-2\r128gain-tools\ffmpeg.exe -i "%~1" -ac 2 -y "%~1_clean.wav"

echo Getting max amplitude and normalizing to "%~1_clean.wav"..
r128gain-1.0-beta-2\r128gain.exe --in-place "%~1_clean.wav"

echo Extracting video to "%~1_clean.avi"..
r128gain-1.0-beta-2\r128gain-tools\ffmpeg.exe -i "%~1" -map 0:0 -vcodec copy -y "%~1_clean.avi"

echo Creating new video file into "%~1_new.avi"..
r128gain-1.0-beta-2\r128gain-tools\ffmpeg.exe -i "%~1_clean.avi" -i "%~1_clean.wav" -vcodec copy "%~1_new.avi"

:clear
echo Cleaning..
del "%~1_clean.wav"
del "%~1_clean.avi"
pause


If I remove deleting the temporary files at the end, I compared the cleaned audio with the original audio and there is no change after running it through r128gain. Are we doing anything wrong in the script above?

In the above case we used it on avi files, but same result regardless of video format.

Cheers,
Daniel
Go to the top of the page
+Quote Post
pbelkner
post Apr 28 2013, 14:33
Post #529





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (westis @ Apr 28 2013, 13:34) *
I tried separating audio and video, to normalize the audio and then merge audio and video together.

In principle this should work.

QUOTE (westis @ Apr 28 2013, 13:34) *
But the audio doesn't change.

That's right because "r128gain" doesn't apply the gain. You may use the "--command" option in order to let SoX apply the gain:

CODE
r128gain "--command=sox %TRACK% %BN%-norm.wav gain %TGDB%" C:\Windows\Media\chord.wav -o .
Go to the top of the page
+Quote Post
J.Fleming
post May 9 2013, 03:39
Post #530





Group: Members
Posts: 23
Joined: 13-February 13
Member No.: 106606



Crashes on 2 different computers for me after I click OK using default settings, no log files are written.

I'm guessing this needs SSE2... both computers I tried are PIII. sad.gif
Go to the top of the page
+Quote Post
pbelkner
post May 9 2013, 21:23
Post #531





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



Version 1.0 RC1 released:
Download: http://sourceforge.net/projects/r128gain/files/r128gain/1.0/
What's new?
  • SoX 14.4.1
  • Improved stability
  • Win64 build

  • QUOTE (J.Fleming @ May 9 2013, 04:39) *
    Crashes on 2 different computers for me after I click OK using default settings, no log files are written.

    I'm guessing this needs SSE2... both computers I tried are PIII. sad.gif

    Final finish: Removed SSE.

Go to the top of the page
+Quote Post
MrMod
post May 11 2013, 22:05
Post #532





Group: Members
Posts: 8
Joined: 21-November 12
Member No.: 104659



I noticed that the 14.4.1 windows build of SoX doesn't include FLAC or W64 support. I did some searching and found this posted on their project forum:
QUOTE
Unfortunately, there was a build problem in the 14.4.1 release leading to libflac and libsndfile being left out of the Windows binary.

I don't know what the fix is, just letting you know of this issue. In the meantime, I'll continue using SoX 14.4.0 with R128GAIN RC1 due to WAVs above 4GB in size not working properly (hence why I use FLAC).
Go to the top of the page
+Quote Post
pbelkner
post May 12 2013, 20:29
Post #533





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (MrMod @ May 11 2013, 23:05) *
I noticed that the 14.4.1 windows build of SoX doesn't include FLAC or W64 support.

This may be true for the official distribution, but it doesn't hold for the build coming with R128GAIN (which is crippled in other ways).

QUOTE (MrMod @ May 11 2013, 23:05) *
I did some searching and found this posted on their project forum:
QUOTE
Unfortunately, there was a build problem in the 14.4.1 release leading to libflac and libsndfile being left out of the Windows binary.

Meanwhile there are "sox-14.4.1a-win32.*" builds available.
Go to the top of the page
+Quote Post
MrMod
post May 21 2013, 16:45
Post #534





Group: Members
Posts: 8
Joined: 21-November 12
Member No.: 104659



Thank you for adding FLAC support to the RC2 build. Works great.
Go to the top of the page
+Quote Post
BFG
post May 22 2013, 16:13
Post #535





Group: Members
Posts: 206
Joined: 22-July 12
Member No.: 101637



I decided to give R128Gain (latest RC2 build) a try last night after reading about it here and hearing good things about it. At first, I couldn't get it to work on my MP3s, but as directed I updated FFmpeg and then it was able to do so. However, the R128Gain-modified MP3s seem to be missing all the ID3 and other metatags. Is there any simple way to tell R128Gain to simply pass through all tags other than the original ReplayGain one?

This post has been edited by BFG: May 22 2013, 16:14
Go to the top of the page
+Quote Post
pbelkner
post May 25 2013, 14:23
Post #536





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (BFG @ May 22 2013, 17:13) *
I decided to give R128Gain (latest RC2 build) a try last night after reading about it here and hearing good things about it. At first, I couldn't get it to work on my MP3s, but as directed I updated FFmpeg and then it was able to do so. However, the R128Gain-modified MP3s seem to be missing all the ID3 and other metatags. Is there any simple way to tell R128Gain to simply pass through all tags other than the original ReplayGain one?

Unfortunately I'm not able to reproduce this. The result should be the same as in

CODE
ffmpeg -i "in.mp3" -c copy -y "out.mp3"

You may list the meta data seen by FFmpeg by means of

CODE
ffmpeg -i "in.mp3"

or

CODE
ffmpeg -i "out.mp3"
Go to the top of the page
+Quote Post
pbelkner
post Jul 14 2013, 14:01
Post #537





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



Finally version 1.0 released:
Download: http://sourceforge.net/projects/r128gain/files/r128gain/1.0/
Go to the top of the page
+Quote Post
dawnrazor
post Jul 19 2013, 22:13
Post #538





Group: Members
Posts: 4
Joined: 19-July 13
Member No.: 109182



Just to be sure before I trash my whole library - I'm intending to run r128gain on all my mp3s, then write the results to the replaygain tag and convert those to Soundcheck values for use in iTunes. Will my mp3s stay as they are (apart from the tags) or will they be re-encoded during the process?
Go to the top of the page
+Quote Post
db1989
post Jul 19 2013, 23:39
Post #539





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



They will not be re-encoded. RG data are stored in dedicated fields in the tags.

Even if you were using the method of MP3gain and similar tools, the adjustments would be written to gain fields in the MP3 (quantised to 1.5 dB), but the audio data itself would remain untouched.
Go to the top of the page
+Quote Post
dawnrazor
post Jul 20 2013, 09:27
Post #540





Group: Members
Posts: 4
Joined: 19-July 13
Member No.: 109182



QUOTE (db1989 @ Jul 19 2013, 23:39) *
They will not be re-encoded.


Thanks for the info. I was just wondering how it works with the parallel level and peak adjustments that are required to achieve r128 compliance.
Go to the top of the page
+Quote Post
db1989
post Jul 20 2013, 13:02
Post #541





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Sorry, but what do you mean? These algorithms just analyse the entire stream, determine the peak and average perceptual loudness, and write corresponding data to tag fields, thus enabling levelling of the volume during subsequent playback. None of this requires rewriting of the stream in even a temporary form, nor any sort of parallelism.
Go to the top of the page
+Quote Post
dawnrazor
post Jul 21 2013, 07:46
Post #542





Group: Members
Posts: 4
Joined: 19-July 13
Member No.: 109182



QUOTE (db1989 @ Jul 20 2013, 13:02) *
Sorry, but what do you mean? These algorithms just analyse the entire stream, determine the peak and average perceptual loudness


On the production side, you have to work on both aspects to not end up with a file that either has correct peaks but incorrect average loudness, or vice versa. I'm just wondering how a single tag value can result in r128 compliant playback when you, for example, have a track with correct occasional peaks but way too low average loudness.

This post has been edited by dawnrazor: Jul 21 2013, 07:46
Go to the top of the page
+Quote Post
db1989
post Jul 21 2013, 12:03
Post #543





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



The two data are stored in separate fields. The player should provide options to (A) normalise average perceptual loudness and also (B) override the adjustment invoked by step A if it would result in clipping according to the specified peak, thus preventing clipping. The user then chooses the combination of options that suit them. Here, straight from the original author, why the user should use clipping prevention but might choose not to: http://hydrogenaudio.org/forums/?showtopic=62625#entry559266
Go to the top of the page
+Quote Post
dawnrazor
post Jul 28 2013, 17:46
Post #544





Group: Members
Posts: 4
Joined: 19-July 13
Member No.: 109182



QUOTE (db1989 @ Jul 21 2013, 12:03) *
The two data are stored in separate fields. The player should provide options to (A) normalise average perceptual loudness and also (B) override the adjustment invoked by step A if it would result in clipping according to the specified peak, thus preventing clipping.


Thanks for claryfing. I suppose r128gain then is not for me, as I'm using iTunes and it will rely on a single value. I justed wanted to make sure beforehand, because in another discussion I stumbled over statements saying r128gain would sum up its result in a single value (which I couldn't believe).
Go to the top of the page
+Quote Post
pbelkner
post Jul 28 2013, 18:02
Post #545





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (dawnrazor @ Jul 28 2013, 18:46) *
as I'm using iTunes and it will rely on a single value.

Could you please let us know what kind of value this is?

What "r128gain" does is (as already mentioned) to calculate a set of values and store them as tags in the audio or video file. The most important of theses values (at least to me) is the gain which has to be applied to the audio in order to achieve the loudness required by some standards (e.g. EBU R128 or ATCS A/85). Other values stored are the maximum (inter-sample) peak and the loudness range.

Regarding the maximum (inter-sample) peak: Having applied the gain in order to achieve the loudness as defined by the mentioned standards (-23 dBFS or -24 dBFS, respectively) the maximum (inter-sample) peak typically is between -10 dBFS and -15 dBFS, in seldom cases -6 dBFS at a maximum (for a typical mixture of rock and pop music), i.e. in practice there's no need for limiting.

EDIT: In order to get an idea of what we are talking about you may consider using Winamp in conjunction with the FFSoX Player plugin (http://sourceforge.net/projects/in-ffsox/f...in_ffsox-2/0.0/). The pugin's file information dialog gives some information about a track's maximum peak and whether it's clipping:


In this particular case the maximum inter-sample peak without a gain applied would clip with +0.41 dBFS. On the other hand the EBU R128 gain is between -9.9 dB (track) and -10.9 (album) resulting in an effective maximum peak of about -10.0 dBFS during playback with the gain applied.

This post has been edited by pbelkner: Jul 28 2013, 18:46
Go to the top of the page
+Quote Post
kareha
post Aug 2 2013, 16:08
Post #546





Group: Members
Posts: 52
Joined: 1-September 11
Member No.: 93415



Just wondering if this is worth using over foobars RG implementation?
Go to the top of the page
+Quote Post
[JAZ]
post Aug 2 2013, 16:15
Post #547





Group: Members
Posts: 1783
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



@kareha: Current foobar2000 versions use the R128 algorithm to calculate replaygain values, so it is not needed to use the application, because it already uses the algorithm.
Go to the top of the page
+Quote Post
Pat_
post Aug 2 2013, 19:12
Post #548





Group: Members
Posts: 10
Joined: 2-August 13
Member No.: 109428




QUOTE (db1989 @ Jul 21 2013, 12:03) *
The two data are stored in separate fields. The player should provide
Regarding the maximum (inter-sample) peak: Having applied the gain in order to achieve the loudness as defined by the mentioned standards (-23 dBFS or -24 dBFS, respectively)


Hi,
I've given R128GAIN V1.0 a try. Nice work.
I like the idea of additional meta-data tags besides the standard 4 replaygain tags. Especially tags for REPLAYGAIN_ALGORITHM and REPLAYGAIN_REFERENCE_LOUDNESS (and of course the 2 loudness ranges as specified by EBU-R128).

Question
On the user interface it is possible to specify an offset value ('ReplayGain Calibration') defaulting to -18. However, after running the loudness scanner it does seem hold on the Reference Loudness (default -23 LUFS), regardless of the calibration value (default -18 LUFS). If I compare a loudness scan on the same file with Foobar2000 (v1.2.9), which uses -18 by default I get a different value.

(1) I'm confused because I can modify both Reference Level AND Calibration value for both options "EBU R128" and "Replaygain"
I would have assumed that the replaygain value is calculated as RG = (Reference Value) - (Loudness), with Loudness measured according ITU-1770-2. For EBU-R128 compliance, the reference value is -23 LUFS to offset content for normalized loudness. For use with music files on portable devices, the recommended reference value is -18 dB for normalized loudness (Wolters et al. (2010), page 11). Can you help me out?


(2) How could I afterward inspect the meta-date of a file to see which calibration value was used?


Thanks

----------------
Wolters, Mundt, Reidmiller (2010). Loudness normalization in the age of portable media players, Audio Engineering Society,
[Note1] http://www.dolby.com/uploadedFiles/Assets/...dia-Players.pdf

Go to the top of the page
+Quote Post
pbelkner
post Aug 3 2013, 07:28
Post #549





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (Pat_ @ Aug 2 2013, 20:12) *
On the user interface it is possible to specify an offset value ('ReplayGain Calibration') defaulting to -18. However, after running the loudness scanner it does seem hold on the Reference Loudness (default -23 LUFS), regardless of the calibration value (default -18 LUFS). If I compare a loudness scan on the same file with Foobar2000 (v1.2.9), which uses -18 by default I get a different value.

RG and EBU R128/ITU BS.1770 use completely unrelated metrics and postulate some default or reference loudness w.r.t. there their algorithms, i.e. 89 dB and -23 LUFS, respectively. To my understanding these absolute values don't have any meaning on their own and there is no means to relate them to each other from a theoretical point of view.

However, you may apply the algorithms to some audio and may compare the resulting absolute loudness with the respective reference loudness and those getting the gain you have to apply in order to attenuate the audio's loudness to the reference level. And, of course, you can compare the gain calculated from RG with it's counterpart calculated by EBU R128/ITU BS.1770.

If you do this kind of comparison with a larger set of audio files you'll soon discover that the difference between the two gains is not a constant, i.e. it is varying. That's no surprise because the two gains are based on completely different algorithms. However, you can do some statistics in order to figure out the mean difference between the two gains for a given set of audio files (regression).

Those kinds of statistics came to the impression that 89 dB in RG world is (in mean) equivalent to -18 LUFS in EBU R128/ITU BS.1770 world (for details cf. the respective discussion up this thread).

As far as I can see, you're looking for ITU BS1770 algorithm with metrics taken from RG world. That's what is called RG2 in "r128gain".

QUOTE (Pat_ @ Aug 2 2013, 20:12) *
(1) I'm confused because I can modify both Reference Level AND Calibration value for both options "EBU R128" and "Replaygain"
I would have assumed that the replaygain value is calculated as RG = (Reference Value) - (Loudness), with Loudness measured according ITU-1770-2. For EBU-R128 compliance, the reference value is -23 LUFS to offset content for normalized loudness. For use with music files on portable devices, the recommended reference value is -18 dB for normalized loudness (Wolters et al. (2010), page 11). Can you help me out?

Assuming you're looking for RG2 the command would be (if you are using the GUI just choose the respective radio button from the "Compliant" group):

CODE
$ r128gain --rg2 --overwrite input/Track01.flac -o output
SoX sucessfully loaded.
FFmpeg sucessfully loaded.
analyzing ...
  [1/1] "Track01.flac": 96.2 dBFS (-7.2 dB)
      peak: 0.2 dBFS, range: 3.9 dB
  [ALBUM]: 96.2 dBFS (-7.2 dB)
      peak: 0.2 dBFS, range: 3.9 dB
writing ...
  [1/1] "Track01.flac" ... done.
done.

Please note that the result is slightly different to the one from classical RG:

CODE
$ r128gain --rg --overwrite input/Track01.flac -o output
SoX sucessfully loaded.
FFmpeg sucessfully loaded.
ReplayGain sucessfully loaded.
analyzing ...
  [1/1] "Track01.flac": 96.9 dBFS (-7.9 dB)
  [ALBUM]: 96.9 dBFS (-7.9 dB)
writing ...
  [1/1] "Track01.flac" ... done.
done.

QUOTE (Pat_ @ Aug 2 2013, 20:12) *
(2) How could I afterward inspect the meta-date of a file to see which calibration value was used?

CODE
$ r128gain-tools/ffmpeg -i output/Track01.flac
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 14 2013 13:18:11 with gcc 4.7.3 (rubenvb-4.7.4-release)
  libavutil      52. 39.100 / 52. 39.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 80.101 /  3. 80.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, flac, from 'Track01.flac':
  Metadata:
    REPLAYGAIN_ALGORITHM: EBU R128
    REPLAYGAIN_REFERENCE_LOUDNESS: 89.00 dBFS
    REPLAYGAIN_TRACK_GAIN: -7.25 dB
    REPLAYGAIN_TRACK_PEAK: 1.023053
    REPLAYGAIN_TRACK_RANGE: 3.94 dB
    REPLAYGAIN_ALBUM_GAIN: -7.25 dB
    REPLAYGAIN_ALBUM_PEAK: 1.023053
    REPLAYGAIN_ALBUM_RANGE: 3.94 dB
    ENCODER         : Lavf55.12.102
  Duration: 00:05:44.49, bitrate: 838 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
At least one output file must be specified

Go to the top of the page
+Quote Post
Pat_
post Aug 4 2013, 10:26
Post #550





Group: Members
Posts: 10
Joined: 2-August 13
Member No.: 109428



QUOTE (pbelkner @ Aug 3 2013, 07:28) *
As far as I can see, you're looking for ITU BS1770 algorithm with metrics taken from RG world. That's what is called RG2 in "r128gain".


Thanks, this clarifies.

So basically, Gain Adjustment at album or track level can be chosen to be calculated as:

EBU-128 compliant : GainAdjust (LUFS)= -23 LUFS - (Integrated Programme Loudness calculated with R128 algorithm) LUFS
Replaygain v1.0 (RG) : GainAdjust (dB) = -89 dBFS - (Loudness calculated with replaygain 1.0 algorithm) dBFS
Replaygain v2.0 (RG2) : GainAdjust (dB) = -18 dBFS - (Integrated Programme Loudness calculated with R128 algorithm) dBFS

For ReplayGain v2.0 (RG2), it is assumed that the integrated proramme loudness expressed in LUFS can be interpreted as dBFS because the relationship with the offset of -18 dBFS was empirically determined by correlation analysis (linear regression) between values of classical RG and R128 determined loudness.

The GainAdjust values calcuated are stored in the original meta-data tags of ReplayGain 1.0 for compatibility reasons. I guess this was part of my confusion. The meta-data name is called REPLAYGAIN_xxxx, but the VALUE should be interpreted either as R128 compliant, ReplayGain v1.0 adjustment or ReplayGain v2.0 adjustment.

Would it not be a good idea to note this difference in the tag "REPLAYGAIN_ALGORITHM"? To distinguish the "METHOD" of calculating the values stored in the REPLAYGAIN at album and track level.

REPLAYGAIN_ALGORITHM = "EBU-128"
REPLAYGAIN_ALGORITHM = "ReplayGain 1.0"
REPLAYGAIN_ALGORITHM = "ReplayGain 2.0"

Technically, the algorithm for determining loudness is either R128 or RG 1.0
The METHOD of adjusting the playback gain (replaygain_xxxx tags) is EBU-128 compliant, RG 1.0 compliant or RG 2.0 compliant.

This post has been edited by Pat_: Aug 4 2013, 10:28
Go to the top of the page
+Quote Post

23 Pages V  « < 20 21 22 23 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd September 2014 - 19:58