HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - General => Topic started by: guptaas on 2019-08-01 01:47:14

Title: OggEnc2 Replaygain
Post by: guptaas on 2019-08-01 01:47:14
Trying to transcode FLAC files into OGG on the fly, streaming from Subsonic to an iPhone. Works great in two steps.
Step 1) flac -d --totally-silent --decode-through-errors --stdout %s
Step 2) oggenc2 -Q -q7.7 -t %t -a %a -l %l -
Would like to utilize the replaygain values in the FLAC files to be carried over. However, can't make sense of the help in OggEnc2.exe (oggenc2.88-1.3.6-aoTuVb6.03-Lancer-SSE3-x.64). Using 1 or 2 in place of "n" doesn't seem to do anything and is not the instruction anyway.
 --FLAC-scale n       Scale input data using FLAC Replaygain Tags where:
                               c = 1 to use Title Replaygain value, and
                               c = 2 to use Album Replaygain value.
Also, this version is supposedly able to take FLAC files directly as long as FLAC.exe is in the same directory. Haven't succeeded with that either. Any help appreciated
Title: Re: OggEnc2 Replaygain
Post by: kode54 on 2019-08-01 02:29:19
The ReplayGain values from the FLAC do not carry over, because information is lost when converting to Ogg Vorbis. The results will be different, because the audio is actually different, even if likely not audibly different.
Title: Re: OggEnc2 Replaygain
Post by: john33 on 2019-08-01 11:40:51
"oggenc2 -q 7.7 input.flac" will convert the input file 'input.flac' to 'input.ogg'. All standard Flac tags, except Replaygain taqs, will be copied over to the .ogg output file automatically. The 'FLAC-scale n' option will read either the Title gain or the Album gain tag and apply the gain to the decoded Flac data prior to encoding to oggvorbis. FLAC.exe is not required to be present anywhere as the Flac decoding routines are built in to the oggenc2 executable. I'm sorry if the 'help' is not clear, it appears to be a little out of date! ;) I must update it at some point.
Title: Re: OggEnc2 Replaygain
Post by: guptaas on 2019-08-01 16:02:03
Thank you so much for the quick responses. And thank you for creating such useful tools John33. Will try "oggenc2 -q 7.7 input.flac" tonight. Still confused by the following:
 --FLAC-scale n       Scale input data using FLAC Replaygain Tags where:
                               c = 1 to use Title Replaygain value, and
                               c = 2 to use Album Replaygain value.
What switch do I need if I wanted to apply Track gain? "n" is not "c", I still did try "--FLAC-scale 1" with two FLAC files with a huge difference in track gain. --FLAC-scale 1 made no difference to the resultant OGG volume.
Title: Re: OggEnc2 Replaygain
Post by: john33 on 2019-08-01 17:59:19
OK, I'll try the scale option in the next day, or so, just to check it out. I really haven't checked in a long time!
Title: Re: OggEnc2 Replaygain
Post by: john33 on 2019-08-03 09:32:20
I've just checked the FLAC usage, tag transfer and scale options.

The command line: "oggenc2 -q 7 --FLAC-scale 1 06.flac" does everything that is expected. The oggvorbis file is created with the vorbis comments copied across (excluding the Replaygain tags) and the Track Gain value is applied during the encoding. Using "FLAC-gain 2" in place also works and applies the Album Gain value.

The only caveat I would mention is that only 'vorbis style' comments will be copied and applied. If id3 or ape tags have been used, these will be ignored.
Title: Re: OggEnc2 Replaygain
Post by: guptaas on 2019-08-03 16:07:47
Can't thank you enough! Everything working perfectly. I had to search a bit to figure out how to handle input and output to stdout for the streamer I'm using (Subsonic). It all worked out. Thank you for creating a brilliant tool and for the help.
For anyone else searching for a FLAC to OGG streaming transcode solution utilizing Replaygain, oggenc2 can do it in one step without needing any other file: "oggenc2 -Q -q 7 --FLAC-scale 1 %s -o -"
Title: Re: OggEnc2 Replaygain
Post by: john33 on 2019-08-03 16:19:17
Happy to be of help! ;)