Log in

View Full Version : BeHappy - AviSynth based audio transcoding tool (UPD 19-07-2006)


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 20 21 22 23 24 25 26 27

tebasuna51
20th December 2010, 19:26
Like you say eac3to do:

SuL = BL + 0.7xSL
SuR = BR + 0.7xSR

Then the acustic power contribution of SL and SR channels in 5.1 is half than in 7.1 audio

The 6.1 -> 5.1 downmix in eac3to is broken (DTS-MA or WAV source):

SuL = BC + 0.7xSR
SuR = SL + 0.7xSR

Richard1485
29th January 2011, 21:24
I like this transcoder so far. Thank you very much! Can you use this with the Sonic audio decoder? I am using it to downmix DTS-HD MA to simple stereo (i.e. not DPII) to avoid the left channel being louder than the right, as discussed here (http://forum.doom9.org/showthread.php?t=151283). Eac3to has always had a switch for sonic, but I don't know how to use sonic with this program.

tebasuna51
30th January 2011, 02:54
Sorry I don't know how use Sonic audio decoder with BeHappy.

You can use eac3to to decode the DTS-MA to a wav file and after use BeHappy for the stereo downmix.

BTW, not always the DPL II downmix make left channel louder than right.

Richard1485
3rd February 2011, 17:57
You can use eac3to to decode the DTS-MA to a wav file and after use BeHappy for the stereo downmix.

Thank you! How exactly do I make the wav file with eac3to? What sort of wav file? :)

tebasuna51
4th February 2011, 01:19
Just decode:

eac3to input.dtsma output.wav

alexVS
13th February 2011, 09:12
Hi! I'm trying to use 7.1 to 5.1 avisynth script and there's a question.
I want to make 5.1 as much close to 7.1 as possible.
And command normalize() changes volume of all channels.
Maybe it's better to normalize just two channels sul and sur (or use some reducing coefficients for them before mixing to avoid overflow).
And leave all other channels F,L,C,LFE intact?

tebasuna51
13th February 2011, 13:19
...I want to make 5.1 as much close to 7.1 as possible.
Then:
SuL = BL + SL
SuR = BR + SR
And command normalize() changes volume of all channels.
Yes, this is needed to have the same volume contribution than 7.1 without distort.
Maybe it's better to normalize just two channels sul and sur ...
Nope, with that you don't know if SuL,SuR contribution is less or more than in 7.1

PBear
4th March 2011, 23:53
Been using BeHappy a long time to re-encode time-compressed movie audio to the correct pitch w/Time-Stretch filter, extracting audio from AVI files using VDubMOD to save as WAV file for input. Usually re-encode to AC3 using Aften @ 192K but sometimes, to save file space, will use MP3 @ 128K.

Since LAME MP3 is so slow compared to Aften's AC3 encoding, thought I would try the Fraunhofer MP3 encoder whose link appears in README file. Cannot get Fraunhofer encoder to work. BeHappy does not appear to pass the command line correctly - as you can see, the "-if" (input file) parameter is blank and the following error appears in BeHappy window:

Starting job Movie.wav->Movie.mp3
Found Audio Stream
Channels=1, BitsPerSample=32 float, SampleRate=48000Hz
encoder\mp3sencoder.exe -if - -of "D:\Hold\Movie.mp3" -q 1 -eof -br 128000 -sr 48000 -c 1
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: The pipe has been ended.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)
at BeHappy.Encoder.encode()

Any possible fix?

Thanks.

tebasuna51
5th March 2011, 04:15
BeHappy does not appear to pass the command line correctly - as you can see, the "-if" (input file) parameter is blank and the following error appears in BeHappy window:
...
After the "-if" there are a "-" what means than the STDOUT of AviSynth is send to STDIN of the encoder.

The problem is with some changes in parameters between 1.4 and 1.5 encoder versions:
-q 1 seems not needed in v1.5
-res (new parameter) is needed in v1.5 because now support 24 bit depth samples, not only 16 like v1.4

Then if you use mp3sencoder v1.5 you need a new FraunhoferMp3.extension file:

b66pak
5th March 2011, 20:26
thanks a lot...
_

L.E. It looks like FraunhoferMp3Encoder autoresample 48000 Hz to 44100 Hz!!!
_

tebasuna51
6th March 2011, 01:40
L.E. It looks like FraunhoferMp3Encoder autoresample 48000 Hz to 44100 Hz!!!

Maybe for low bitrate, Lame also downsample if the bitrate is not enough.

b66pak
6th March 2011, 02:35
on highest quality setting...
_

tebasuna51
6th March 2011, 03:18
I can't reproduce this, input 48 KHz -> output 48 KHz

b66pak
6th March 2011, 05:09
your cli line, please?
_

tebasuna51
6th March 2011, 10:35
BeHappy VBR higest quality:
encoder\mp3sencoder.exe -if - -of "D:\wavs\48KHz.mp3" -eof -br 0 -m 1 -sr 48000 -res 16 -c 2 -vbri

the mp3 output is 48 KHz like input.

b66pak
6th March 2011, 19:46
-q Quality:
Encoder quality:
0: fast encoding <Default>
1: high quality

if i use "-q 1" i get the autoresampling: 48000 Hz > 44100 Hz

my line:
mp3sEncoder -if audio.wav -of vbr_m1.mp3 -br 0 -m 1 -q 1 -vbri
_

egrimisu
6th March 2011, 21:01
Visit us in Transylvania :)

tebasuna51
7th March 2011, 01:13
@b66pak
Seems a bug, the -q parameter isn't used now in BeHappy with v1.5 like a say before (new FraunhoferMp3.extension)

PBear
11th March 2011, 04:32
Then if you use mp3sencoder v1.5 you need a new FraunhoferMp3.extension file:

Thanks for the reply. I downloaded and installed the new extension file you provided, but I'm still getting the same error and still no encoding takes place.

(I'm not using an AVISynth script, I'm just using the WavSource setting for input file - which works fine with Aften and LAME MP3.)

:)

tebasuna51
11th March 2011, 14:01
If your sample is the same:

"Channels=1, BitsPerSample=32 float, SampleRate=48000Hz"

you need convert the wav samples 32 float to 16 or 24 (recommended) because:
"-res (new parameter) is needed in v1.5 because now support 24 bit depth samples, not only 16 like v1.4"

Check the DSP 'Convert Sample To 24 bit int' in [3] Digital Signal Processing

PBear
11th March 2011, 20:11
If your sample is the same:

"Channels=1, BitsPerSample=32 float, SampleRate=48000Hz"

you need convert the wav samples 32 float to 16 or 24 (recommended) because:
"-res (new parameter) is needed in v1.5 because now support 24 bit depth samples, not only 16 like v1.4"

Check the DSP 'Convert Sample To 24 bit int' in [3] Digital Signal Processing

I've converted the sample to 24 bit, like you instructed, and used that output file as the input for Fraunhofer. BeHappy stills shows:

Found Audio Stream
Channels=2, BitsPerSample=32 float, SampleRate=48000Hz

and gives the same error as before.

I tried it again using Convert Sample to 16 bit. Got same results from that output file. As a matter of fact, I checked my original input file with MediaInfo and it shows as 16 bit already. It was never 32 bit.

No matter what the sample rate of the input file actually is, when I try to convert it with Fraunhofer, BeHappy reports

Found Audio Stream
...BitsPerSample=32 float...

I don't get it. :(

b66pak
11th March 2011, 20:29
make sure that "convert to 24 bit int" (or "convert to 16 bit int") is checked and is the last line in "[3] Digital Signal Processing" window (use "Move Down" to make it last!!!)...
_

PBear
11th March 2011, 20:48
That did it! Thanks very much.

(Having that line at the bottom is so counter-intuitive, though. I moved the Convert Sample line all the way to the top because I assumed that action would need to be done first, before anything else. That'll teach me to try to out-think the program I'm using!!!)

The Fraunhofer encoder is much, much faster than LAME's, by the way (as fast, or even a tiny bit faster than Aften's AC3), and the results seem to sound fine.

:thanks:

TDiTP_
21st March 2011, 12:47
Does BeHappy use dithering (and may be noise shaping) when we use DSP "Convert Sample To X bit"? If not, then why?

For example. One test AC-3 i decode in eac3to with libav twice and output WAVs does not byte-in-byte identical because eac3to use dithering when convert 64 fp -> 24 int (with "-full" identical). In case of BeHappy everyone output WAV byte-in-byte identical to the previous. Why?

Upd.
Related Issues. In case of certified AC-3 decoders (nero, sonic) i always have byte-in-byte identical output WAVs after decoding test AC-3. I thought, that work inside filter is: decode to 32 fp (as in spec.)->reduce bitdepth with dithering to 24 int (or 16 int). But then why we have byte-in-byte identical results, where I'm wrong?

tebasuna51
21st March 2011, 16:22
About dithering in "Convert Sample To X bit":
BeHappy is only a GUI for AviSynth then only uses the functions
ConvertAudioTo8bit / ConvertAudioTo16bit / ConvertAudioTo24bit / ConvertAudioTo32bit / ConvertAudioToFloat
(don't exist with dithering)

I don't know how work exactly eac3to or certified ac3 decoders because the source isn't public.

TDiTP_
21st March 2011, 18:29
tebasuna51, how do you think: we need dithering when reduce bitdepth or not?

tebasuna51
21st March 2011, 23:52
Is your choice, but I never use it.

TDiTP_
7th April 2011, 14:02
slightly offtopic, excuse me please.

BeHappy doesn't use such BSI as 'Surround Downmix Level' in AC-3 when downmix it (5.1->2.0 Lo/Ro). BeHappy uses standart stereo-matrix and my question is: "Why? 'Surround Downmix Level' in AC-3 stream isn't so important information? This BSI is used by all Dolby certifyed decoders and Azid. Why not by other (L)GPL decoders?"

The same situation with 'Center Downmix Level' but this info isn't so important because =-3 almost always.

tebasuna51
7th April 2011, 14:32
BeHappy is only a GUI for AviSynth.

In AviSynth we can't know BSI info.

BSI info are know by decoder (NicAudio, BassAudio, DirectShow filters, ...) but can't pass the info to AviSynth, more important than downmix levels is the maskchannel to know the channels presents in the decoded stream.

Then the procces can't be automatic, if you know the BSI values you can write the .avs to make the recommended downmix.

TDiTP_
7th April 2011, 14:47
tebasuna51, I need your opinion again :)

Is "Surround Mix Level" so important BSI? I can't understand Dolby's recommendation, why is the recommended value is -3 db (and not "none")? Because in this case we don't get the initial acoustic power ratio. i.e the basic question is: "Why Dolby inc. does recommend to lower the level of Ls/Rs at downmix?"

tebasuna51
7th April 2011, 15:15
Is "Surround Mix Level" so important BSI?
No
I can't understand Dolby's recommendation, why is the recommended value is -3 db (and not "none")? Because in this case we don't get the initial acoustic power ratio. i.e the basic question is: "Why Dolby inc. does recommend to lower the level of Ls/Rs at downmix?"
Because the Surround channels transport less important info than front and center channel.

Richard1485
22nd April 2011, 17:38
Sorry I don't know how use Sonic audio decoder with BeHappy. You can use eac3to to decode the DTS-MA to a wav file and after use BeHappy for the stereo downmix.

Thank you! How exactly do I make the wav file with eac3to? What sort of wav file? :)

Just decode: eac3to input.dtsma output.wav

Hi! Sorry to bring this up again but I finally found time to try this method out. I had a problem with decoding to .wav: the file was cut off halfway through. Instead, I extracted the DTS-HD MA as RF64 with eac3to and then used Behappy (Source: RaWav ignore lengthways) to downmix to stereo. Anything potentially wrong with this workflow?

It seems to have worked, but the log contained warnings of a number of overlaps, each of a few milliseconds' duration, which I assume is because this was a seamless branching BD. The log also says Realizing RAW/PCM gaps... so can I assume that everything is fine? Thanks for any help.

tebasuna51
22nd April 2011, 22:36
I had a problem with decoding to .wav: the file was cut off halfway through.
I don't think so, but
Instead, I extracted the DTS-HD MA as RF64
this can work also.
but the log contained warnings of a number of overlaps,... so can I assume that everything is fine?
Yes, I hope.

Richard1485
22nd April 2011, 22:44
Thank you for the reply. I appreciate it. :-)

Bluedan
4th May 2011, 11:41
omit encoder script

What does it do to my encode?
Ticking the box had no effect on the avisynth script.
In this forum I found no explanation.

tebasuna51
4th May 2011, 20:18
Work only with the Preview.

Check yourself with the ogg encode, add or not the line:

6==AudioChannels(last)?GetChannel(last,1,3,2,5,6,4):last

Bluedan
4th May 2011, 22:13
Ah. Oh, I overlooked the slight frame which indicates the context between the huge Preview button an that tick box.

Got it now.
The problem with the multichannel ogg encode is already clear.

flapane
6th July 2011, 18:04
Hi,
latest Behappy and latest version of Aften here.
I need to recompress a 448kbps 5.1 ac3 audio to 192kbps.
I moved down NORMALIZE, so that it's the LAST operation in the DSP chain.
I downmixed using STEREO method (please correct me if I'm wrong, but a 5.1 file wouldn't fit well in just 192kbps, isn't it?).
Finally I disabled DRC and DN.
The settings are showed in these screenshoots:
http://i.imgur.com/bSm2us.jpg (http://i.imgur.com/bSm2u.png)http://i.imgur.com/aOPxms.jpg (http://i.imgur.com/aOPxm.png)

It seems that the output 192kbps 2.0 file has the same loudness as the source file (it's less loud if NORMALIZE is at the beginning of the DSP chain), and I can't find any audio clipping.

I'm relatively new to BeHappy, I've downloaded it a couple of hours ago and did some experiments, so if I missed some options in order to produce a better output, please let me know.

b66pak
6th July 2011, 18:30
you did good...
_

flapane
6th July 2011, 18:47
Great, thanks.
I must admit that IMHO this is the best audio tool by far. Besweet and its gui are too outdated.

flapane
7th July 2011, 00:14
Weird... with another 448kbps AC3 I get a result 192kbps file with a much lower volume.
Same method, different results... how could it be?

flapane
14th July 2011, 15:48
Interestingly, I don't have low volume issues if I use Besweet.
Is it due to that boost factor? How to achieve the same result in BeHappy?
"D:\Programmi\besweet+gui\BeSweet.exe" -core( -input "g:\Received Files\aaaa.ac3" -output "g:\Received Files\aaaaa-New.ac3" ) -azid( -s surround2 -g 1 ) -ota( -hybridgain ) -boost( /b2=5 ) -ac3enc( -b 224 )
BeSweet v1.5b31 by DSPguru.
--------------------------
Using azid.dll v1.9 (b922) by Midas (midas@egon.gyaloglo.hu).
Using AC3enc.dll v1.20 (Feb 18 2004) by Fabrice Bellard (http://ffmpeg.org).
Manual Dynamic-Compression algorithm by LigH (author of WaveBooster).

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : g:\Received Files\the-others-25fps.ac3
[00:00:00:000] | Output: g:\Received Files\the-others-25fps-New.ac3
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.389dB
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Input Channels Mode: 3/2, Bitrate: 448kbps
[00:00:00:000] | Output Stereo mode: Dolby surround 2 compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- BOOST ------
[00:00:00:000] | Algorithm by : Dg
[00:00:00:000] | Boost Factor : 5.0
[00:00:00:000] | Limit Factor : 0.73
[00:00:00:000] +------- AC3ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | AC3 bitrate : 224
[00:00:00:000] | Channels Mode : 2.0
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[01:40:31:656] Conversion Completed !
[01:40:31:656] Actual Avg. Bitrate : 223kbps
[00:05:08:000] <-- Transcoding Duration

tebasuna51
14th July 2011, 21:59
...Is it due to that boost factor? How to achieve the same result in BeHappy?
Of course, boost distort the original audio and don't exist in BeHappy.
If you like this use BeSweet with last BeLight GUI and encode with Aften, never with ac3enc.dll.

flapane
14th July 2011, 22:35
To be honest I prefer the newer BeHappy than BeSweet and its old GUIs, but for some reason I could only obtain low volume ac3 files (except the first time as posted above)... I could hardly hear some speeches in the transcoded ac3 files.
Do you have any hints? My workflow seems to be ok (http://forum.doom9.org/showpost.php?p=1511977&postcount=938). I'm sure I'm missing something.

Chumbo
15th July 2011, 00:42
You should be fine with BeHappy. Just add the Amplify to your chain and play with boosting the volume in incremental values in decibals (check DB). You'll have to find a fine line between the compression you use and amplification as well as playing with which comes first in the chain. Let your ears guide you, but once you figure it out it should work nicely for you. Amplifying too much is the same as overrdriving your system when you turn it up so loud that it distorts the speakers that can't handle it.

You also may want to check your source if you're using an AVS as the input and what filter it's using to process your source AC3 file, e.g., if using AC3Filter, then make sure it's configured correctly and doesn't have its volume set way down or additional compression turned on and so on. You don't want to compress too much, especially an already compressed audio stream as you'll start to hear it distort. If your source is the nicac3source, then you should be fine.

flapane
15th July 2011, 11:43
Thanks.
What point of the workflow should Amplify go at? Just after downmix and before normalization?

As for source, I use AC3 files (nicac3source) as input in BeHappy.

Chumbo
15th July 2011, 21:40
Thanks.
What point of the workflow should Amplify go at? Just after downmix and before normalization?

As for source, I use AC3 files (nicac3source) as input in BeHappy.
You'll have to decide based on how much you're amplifying the volume. Use your ears with Amplify before and after normalization. Keep in mind that normalization will compress the sound and bring up all the lower (in volume) sounds up. So I would start with ampifying the volume without normalization. Try it in +3db increments until you reach a satisfactory level. That may be enough for what you need.

If at the now acceptable level you still want to bring up some of the other sounds in the mix, i.e., compression, then add normalization after Amplify and set it accordingly. Again, let your ears do the work. No one knows what sounds best to you but you. :)

You can even put downmix AFTER Amplify if you want to amplify, let's say, your 5.1 source BEFORE you downmix. Just play around with it until you get what you want. Good luck.

tebasuna51
15th July 2011, 22:32
1) Decode with DRC
2) Downmix to stéreo
3) Normalize
4) Amplify at your choice

Never Amplify before Downmix or Normalize.

@Chumbo:
"normalization will compress the sound and bring up all the lower (in volume) sounds up"

AviSinth Normalize don't work like you say.

There are a first pass to calculate the max volume, in the second pass all sounds are amplified with the difference between 0 dB and the max volume reached.
Then if you Amplify after Normalize always cut the max peaks.

Chumbo
15th July 2011, 22:41
1) Decode with DRC
2) Downmix to estéreo
3) Normalize
4) Amplify at your choice

Never Amplify before Downmix or Normalize.

@Chumbo:
"normalization will compress the sound and bring up all the lower (in volume) sounds up"

AviSinth Normalize don't work like you say.

There are a first pass to calculate the max volume, in the second pass all sounds are amplified with the difference between 0 dB and the max volume reached.
Then if you Amplify after Normalize always cut the max peaks.
Thanks for the clarification. I thought it worked like dynamic compression, i.e., DRC.

flapane
17th July 2011, 23:37
1) Decode with DRC
2) Downmix to estéreo
3) Normalize
4) Amplify at your choice

Never Amplify before Downmix or Normalize.
.

Thanks a lot.
Any particular reasons to prefer Stereo over DPL II in a downmix?