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


Pages : [1] 2

dimzon
27th December 2005, 13:45
http://img464.imageshack.us/img464/2619/bh720je.png

Use-Case
BeHappy is designed mostly for movie audiotrack transcoding. It's powerfull BeLight/BeSweet replacement. So do not ask me about:

Batch trancoding support
Tags support

If You need to transcode multiple files at "one click" and/or tagging support - use foobar2000 (http://foobar2000.org/) converter

Screenshots
http://img107.imageshack.us/img107/8316/untitled6ta.png

http://img167.imageshack.us/img167/7659/untitled5vg.png

http://img288.imageshack.us/img288/9819/untitled8kq.png http://img259.imageshack.us/img259/7243/untitled2xe.png

http://img101.imageshack.us/img101/9778/untitled4ey.png http://img127.imageshack.us/img127/2340/111111111111118dm.png http://img99.imageshack.us/img99/4794/untitled2uy1.png

http://img62.imageshack.us/img62/6428/c19lr.png

http://img232.imageshack.us/img232/274/aftenam4.png

http://img88.imageshack.us/img88/5688/untitled5ez1.png

http://img142.imageshack.us/img142/6162/untitled0lk2.png

http://img139.imageshack.us/img139/3029/untitled8rr.png

http://img114.imageshack.us/img114/2207/untitled7bq.png

http://img105.imageshack.us/img105/6730/untitled7ir.png

System requirements

Supported operating systems: Windows 2000, Windows XP, Windows XP 64-bit edition, Windows Vista
RAM: 128MB
Display: 800x600 resolution
Microsoft .NET Framework Version 2.0 (http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en)
Avisynth v2.56 (http://sourceforge.net/project/showfiles.php?group_id=57023)


Installation

Download and extract latest BeHappy from BeHappy Workspace (http://workspaces.gotdotnet.com/behappy)
Download and extract latest NicAudio.dll from BeHappy Workspace (http://workspaces.gotdotnet.com/behappy), place NicAudio.dll to AviSynth plugins folder
If You plan to use Stereo To 5.1 UpMix functionality download and extract latest SoxFilter from here, place it to AviSynth plugins folder
If You plan to use AudX MP3 5.1 surround encoding download and extract latest enc_AudX_CLI from BeHappy Workspace (http://workspaces.gotdotnet.com/behappy), place enc_AudX_CLI.exe and audxlib.dll to BeHappy folder
If You plan to encode to MP3 download and extract Lame encoder from rarewares (http://rarewares.org/mp3.html) (recomended version is 3.97b2). Place lame.exe into BeHappy folder
If You plan to encode to OggVorbis download and extract fresh OggEnc2 from rarewares (http://rarewares.org/ogg.html), place oggenc2.exe to BeHappy folder
If You plan to encode to FLAC download and extract fresh FLAC (http://flac.sourceforge.net/) coder, place flac.exe into BeHappy folder
If You plan to encode to WavPack download and extract fresh WavPack encoder (http://www.wavpack.com/), place wavpack.exe into BeHappy folder
If You plan to use Coding Technologies AAC encoder (http://codingtechnologies.com/products/aacPlus.htm)

Download and extract latest enc_aacPlus from BeHappy Workspace (http://workspaces.gotdotnet.com/behappy), place enc_aacPlus.exe to BeHappy folder
Download and extract latest GPAC's MP4Box, place mp4box.exe to BeHappy folder
Download and install fresh WinAmp player (http://winamp.com/player/free.php) (Full version is enought)
Copy enc_aacplus.dll and nscrt.dll from Winamp\Plugins to BeHappy folder
If You doesn't want to use WinAmp You can uninstall it now ;)

If You plan to encode to Nero AAC download and extract fresh FREE NeroDigital AAC (http://www.nero.com/nerodigital/eng/Nero_Digital_Audio.html), place neroAacEnc.exe and neroAacEnc_SSE2.exe into BeHappy folder




Original idea


Workspace (http://workspaces.gotdotnet.com/behappy) is hosted @ http://www.gotdotnet.com/workspaces/ui/resources/gdn/images/logo.jpg (http://workspaces.gotdotnet.com/behappy)

Note
MeGUI since v 0.2.3.2038 23 Jan 2006 share same code with BeHappy. So you can use MeGUI for audio encoding via AviSynth too. MeGUI audio part has less functionality/flexibility but is more stable

Mini FAQ:
TODO

tebasuna51
27th December 2005, 20:48
*** READ THIS: actualized 2025-02-24 ***

- BeHappy Workspace link don't work because GotDotNet Workspaces have been phased out.

- New BeHappy home: CodePlex BeHappy project (http://www.codeplex.com/BeHappy) with last mod's included.
- And now https://github.com/jones1913/BeHappy
- And a upgrade here (https://forum.doom9.org/showthread.php?p=2015201#post2015201) (without sources)

------------------------------------------
*** Now the original post ***
------------------------------------------

Good job, Dimzon!

For me work the 'Delay', 'Split', 'Downmix', ...

Only with the 'Upmix' I get always:
Error: Can't find audio stream!

Please be patient with me, because I have a lot of comments:

Questions
In Avisynth internal plugin info say SuperEq(string filename), then wait for a parameter like this:
SuperEq("C:\Equalizer Presets\Loudness.feq")
Can work SuperEq(clip, values="0 0...96...0")?

In Upmix using Reverberation you put the plugin reverb(). Is a external plugin and need be downloaded?

EnsureVBRMP3Sync(). We can work with mp3 audio?. Is not necessary a decoder first to work with uncompressed audio?

If is possible, EnsureVBRMP3Sync() must be before AudioDubEx(BlankClip(...)) or after?

Petitions
With buttons 'New' and 'Edit' in Source, DSP and Destination we can test others decoders, DSP functios and encoders.

Please include the Downmix - DPL I, like DPL II but:
ssr = MixAudio(sl, sr, 0.2222, 0.2222)
ssl = Amplify(ssr, -1.0)


Bugs
The last buffer send to the encoder can be incomplete but is send complete, then there are extrabytes at end.
The RiffChunkSize in wav header is incorrect.

A example (without DSP), the same Input.wav and three outputs:
Input.wav (with correct classical wav header)
--------------
FileLength ..: 1920044 bytes
RiffChunkSize: 1920036 Ok = FileLength - 8 = DataLength + 36
DataLength ..: 1920000
Duration ...: 10.000000 sec.

Output.wav (RiffChunkSize error, Extrabytes at end of file)
--------------
FileLength ..: 1933356 bytes
RiffChunkSize: 1920450 Error: Must be FileLength - 8 = 1933348
DataLength ..: 1920000 Warning: ExtraBytes at end of file, bytes = 13312
Duration ...: 10.000000 sec. (with DataLength Ok, extrabytes are ignored)

Output.dat (Raw PCM, without header)
--------------
FileLength ..: 1933312 bytes
Duration ...: 10.069333 sec. Error: Extrabytes interpreted as data

Output.ogg
--------------
Duration ...: 10.069333 sec. Error: Extrabytes interpreted as data
Another warning: with source 5.1, 48 KHz (ac3, aac, dts, ...) greater than 124 min. 16.54 sec
m_nSizeInBytes = m_nSampleCount * nBlockAlign is > 2^32, then we need a int64 variable in source code.

chros
28th December 2005, 11:04
Isn't there mp3 output yet ?

dimzon
28th December 2005, 12:34
@tebasuna51
Upmix is not forking yet, this is just algorytm, not working script yet!

EnsureVBRMP3Sync - I think it must be right after decoder. I believe this is just buffering to avoid desync and it can be used with any source type (maybe i'm wrong?)

Petitions
Please include the Downmix - DPL I, like DPL II but:
ssr = MixAudio(sl, sr, 0.2222, 0.2222)
ssl = Amplify(ssr, -1.0)

I beleive you can do it yourself - just edit downmix.extension via notepad - I believe you are able to do it. And don't forget to share modified file with me :D

With buttons 'New' and 'Edit' in Source, DSP and Destination we can test others decoders, DSP functios and encoders.
there are some troubles implementing this functionality... But you can add new Source, DSP and Destination manualy:
Creating new Source
Use nicaudio.extension as starting point for new source. Copy it to yorsource.extension and open via notepad. Don't forget to generate new UUID(GUID) for UniqueID attribute
Edit Name attribute and
Edit <Script> element
{0} means input file name
{1} means output file name
{2} means unique string (to use as part of identifier)
{3} means '{' character (to allow '{' to be used)
{4} means '}' character (to allow '}' to be used)
Add/Delete/Edit <SupportedFileExtension> element

Sample:
<?xml version="1.0"?>
<BeHappy.Extension
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioSource Name="MySourceName" UniqueID="5D209A6D-E6EA-4640-AF60-BAE14A529792">
<Script>SomeSource("{0}")</Script>
<SupportedFileExtension>ext1</SupportedFileExtension>
<SupportedFileExtension>ext2</SupportedFileExtension>
<SupportedFileExtension>ext3</SupportedFileExtension>
</AudioSource>
</BeHappy.Extension>

Creating new DSP
There are 2 ways to create simple DSP:
Creating very simple DSP
Example:

<BeHappy.Extension
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP Name="Normalize to 100%" UniqueID="6158f79f-d8a0-4021-89ae-b77b37c04c55">
<Script>
# Some script:
Normalize()
</Script>
</AudioDSP>
</BeHappy.Extension>
Creating multioption DSP
Take look @ DownMix.extension and UpMix.extension - good examples of multioption DSP
<?xml version="1.0"?>
<BeHappy.Extension
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>DSP Name, Selected Option = {0}</TitleFormatString>
<ScriptPrologue>
# ScriptPrologue
# this part of script will be included in resulting script without any conditions
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</ScriptPrologue>
<Option>
<Name>Option Name 1</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<Option>
<Name>Option Name 2</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<Option>
<Name>Option Name 3</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<Option>
<Name>Option Name 4</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<Option>
<Name>Option Name 5</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<Option>
<Name>Option Name 6</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<Option>
<Name>Option Name 7</Name>
<Value>
# this part of script will be included in resulting script only if this option is selected
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</Value>
</Option>
<ScriptEpilogue>
# ScriptEpilogue
# this part of script will be included in resulting script without any conditions
# {0} means input file name
# {1} means output file name
# {2} means unique string (to use as part of identifier)
# {3} means '{' character (to allow '{' to be used)
# {4} means '}' character (to allow '}' to be used)
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

Creating new Destination
Creating new Destination is very close to new Source. Take look @ ffmpeg-ac3.extension, enc_aacPlus.extension, wavpack.extension, flac.extension
<ExecutableArguments>
{0} means output file name
{1} means samplerate in Hz
{2} means bits per sample
{3} means channel count
{4} means samplecount
{5} means size in bytes

Example:
<?xml version="1.0"?>
<BeHappy.Extension
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioEncoder Name="EncoderName" UniqueID="83517DA6-B34F-45ee-B48C-5D9370CC6032">
<Script>#Some script to be used for this encoder</Script>
<ExecutableFileName>encoder.exe</ExecutableFileName>
<ExecutableArguments>- "{0}" --cbr 32000</ExecutableArguments>
<SupportedFileExtension>ext1</SupportedFileExtension>
<SupportedFileExtension>ext2</SupportedFileExtension>
<SupportedFileExtension>ext3</SupportedFileExtension>
</AudioEncoder>
</BeHappy.Extension>

Creating a really complex Source/DSP/Encoder with it's own GUI
If you are familiar with .NET you can create really fine and complex extension. Take look @ BeHappy.OggVorbis.Encoder.Extension project.
You must:

Create Class Library
Add reference to BeHappy.Extensibility.dll
Impelent IDigitalSignalProcessor or IAudioSource or IAudioEncoder interface
Optionally implement ISupportConfiguration interface
Create .extension file (refer to BeHappy.OggVorbis.Encoder.extension for example)


PS. One *.extension can contain any amount of DSP Source and Encoder at same time

dimzon
28th December 2005, 14:11
fresh beta out

dimzon
28th December 2005, 15:12
Bugs
The last buffer send to the encoder can be incomplete but is send complete, then there are extrabytes at end.
Finally I found a bug in Microsoft VfW AVIStreamRead function - it still "read" data even if EOF is alredy occured....

Now I'm using such workaround:

int nHowMany = Math.Min((int) (m_aviStreamInfo.dwLength-frameSample), MAX_SAMPLES_PER_ONCE) ;
AVIStreamRead(m_aviStream, frameSample, nHowMany, h.AddrOfPinnedObject(), frameBufferTotalSize, out bytesRead, out samplesRead);

dimzon
28th December 2005, 19:42
http://img309.imageshack.us/img309/1055/untitled2222bw.jpg

download it @ workspace @ gotdotnet.com

tebasuna51
29th December 2005, 02:22
Thanks for your rapid and large answer. I have a lot of work to do.
First I want answer your questions.
EnsureVBRMP3Sync - I think it must be right after decoder. I believe this is just buffering to avoid desync and it can be used with any source type (maybe i'm wrong?)
I think is not necessary for uncompressed audio, but I'm not sure.
Which software did You use for such diagnostic?
I make a little utility to read wav header. But with a hex editor (I use WinHex) you can see the header (only 44 bytes). Here is a graphical description of wav header:
http://ccrma.stanford.edu/courses/422/projects/WaveFormat/
I can use int64 in source BUT there are only 4 bytes in WAV HEADER - how I must write this to WAV?
This is the problem for the wav limit 4 GB. And 2 GB limit is for soft using 'signed long int' for these fields.
The faad decoder (aac) can generate 'invalid' wav's > 4 GB, and fill these fields (RiffLength and DataLength) with 0xFFFFFF00.
Foobar also make 'invalid' wav's > 4 GB, and fill these fields with the 4 low order bytes.
Really the only way, afaik, to use a wav > 4 GB is split it in mono wav's. Then Tranzcode, WaveWizard and BeSplit can generate valid (not for BeSplit because a bug in BlockAlign field) mono wav's with the original length. The method is ignore these fields and continue working until end of file.
I prefer the faad method (0xFFFFFF00) because Foobar method can be confused with valid fields.
Can you fix my source?
I send you a PM (2005-12-19) about this. In your previous BeHappy version you use for DataLength:
Int64 nByteSize = streamSampleLength * m_WavHeader.nBlockAlign;
target.Write(BitConverter.GetBytes((uint)Math.Min(nByteSize,uint.MaxValue)),0,4);
And I suggest you use the same method for RiffLength. In actual version the int64 is missing and you use for DataLength the method from RiffLength (?).

In the actual version, the variable with possible overflow is used also in:
private uint m_nSizeInBytes;
...
m_nSizeInBytes = m_nSampleCount*m_wavHeader.nBlockAlign; // may be > 2^32
...
private void createEncoderProcess()
...
info.Arguments = string.Format(m_commandLine, m_output,
m_wavHeader.nSamplesPerSec, m_wavHeader.wBitsPerSample,
m_wavHeader.nChannels,m_nSampleCount,m_nSizeInBytes);

dimzon
29th December 2005, 10:56
I prefer the faad method (0xFFFFFF00) because Foobar method can be confused with valid fields.

pleaese check this code:


private long m_nSizeInBytes;
...
private void writeHeader(Stream target )
{
const uint FAAD_MAGIC_VALUE = 0xFFFFFF00;
const uint WAV_HEADER_SIZE = 36;
bool useFaadTrick = m_nSizeInBytes>=(uint.MaxValue-WAV_HEADER_SIZE);
target.Write(System.Text.Encoding.ASCII.GetBytes("RIFF"),0,4);
target.Write(BitConverter.GetBytes(useFaadTrick?FAAD_MAGIC_VALUE:(uint)(m_nSizeInBytes + WAV_HEADER_SIZE)),0,4);
target.Write(System.Text.Encoding.ASCII.GetBytes("WAVEfmt "),0,8);
target.Write(BitConverter.GetBytes((uint)0x10),0,4);
target.Write(BitConverter.GetBytes(m_wavHeader.wFormatTag),0,2);
target.Write(BitConverter.GetBytes(m_wavHeader.nChannels),0,2);
target.Write(BitConverter.GetBytes(m_wavHeader.nSamplesPerSec),0,4);
target.Write(BitConverter.GetBytes(m_wavHeader.nAvgBytesPerSec),0,4);
target.Write(BitConverter.GetBytes(m_wavHeader.nBlockAlign),0,2);
target.Write(BitConverter.GetBytes(m_wavHeader.wBitsPerSample),0,2);
target.Write(System.Text.Encoding.ASCII.GetBytes("data"),0,4);
target.Write(BitConverter.GetBytes(useFaadTrick?FAAD_MAGIC_VALUE:(uint)m_nSizeInBytes),0,4);
}

tebasuna51
29th December 2005, 12:26
@Dimzon
Yes, I think can work OK.
Thanks.

dimzon
29th December 2005, 13:45
introducing new feature - Multioption encoder (wait for fresh beta)
http://img521.imageshack.us/img521/5043/cool3oj.png

scharfis_brain
29th December 2005, 14:54
I don't know whether you are already doing this:

any_audiosurce()
ConvertAudioTo24bit() #or better float or 32bit
downmix() / upmix() / normalize()
ConvertAudioTo16bit()

this should effectively reduce rounding errors.

dimzon
29th December 2005, 15:07
I don't know whether you are already doing this:

any_audiosurce()
ConvertAudioTo24bit() #or better float or 32bit
downmix() / upmix() / normalize()
ConvertAudioTo16bit()

this should effectively reduce rounding errors.
thanx, i will implement it nex year!

dimzon
29th December 2005, 15:27
New beta is out!
Get it @ workspace @ gotdotnet.com

Prodater64
29th December 2005, 15:32
Usually, ac3 to ac3 encodings with besweet (and also with ffmpeg as i heard) has a problem, that resulting ac3 has low volume.
Has BeHappy same problem or does it manage this issue well?

dimzon
29th December 2005, 15:43
Usually, ac3 to ac3 encodings with besweet (and also with ffmpeg as i heard) has a problem, that resulting ac3 has low volume.
Has BeHappy same problem or does it manage this issue well?
BeHappy use ffmpeg for AC3 encoding bcz there are not any another free avaluable AC3 encoder :(

dimzon
29th December 2005, 16:51
Hey! Now we can create more advanced DSP using Sox Audio Effect Filter !

dimzon
29th December 2005, 17:43
2 All
Hi! You can help BeHappy project!
I need:
New DSP scripts - Dinamyc Range Compression e.t.c
BeHappy logo & icons

tebasuna51
30th December 2005, 17:24
Now BeHappy works Ok with wav header and without extrabytes at end.

I make a test with a source 5.1, 48 KHz (ac3) > 132 min. and BeHappy works Ok for wav > 4 GB and for a transcode to aac.

Relevant info of input.ac3
SampleRate 0 : 48000 KHz.
BitRate 15 : 448 Kb/s.
Audio coding mode (acmod) 7 : 3/2 - L, C, R, SL, SR
Low Frequency Effects channel 1 : Present
FileSize : 444358656 bytes.
Frames : 247968
Duration : 7934.976 seconds ( 2 h. 12 m. 14.976 s.)

Relevant info of output.wav
FileSize ....: 4570546220
RiffLength...: 4294967040 (= 0xFFFFFF00) Error: ... (always with > 4GB)
NumChannels .: 6
SampleRate ..: 48000
OffsetData ..: 44
DataLength ..: 4294967040 (= 0xFFFFFF00) Warning: assumed Datalength = 4570546176 (FileSize - 44)
Duration ...: 7934.976 sec., (2h. 12m. 14.976 s.)
For aac transcode I use:
behappy.extension.encoder.nero7aac.exe -o "D:\...\132.mp4"
-rr 48000 -rb 16 -rc 6 -vbr_streaming
-aacprofile_he -codecquality_high

Relevant info of output.mp4 (from Foobar2000 v0.8.3)
bitrate = 191
samplerate = 48000
channels = 6
aac_profile = HE AAC
codec = AAC
tool = Nero AAC Codec 4.2.1.0
samples = 380878848
FileSize = 189,944,318 Bytes (181.15 MB)
Length = 2:12:14.976

As you can see the duration is preserved exactly. Congratulations Dimzon.

FredThompson
31st December 2005, 04:40
What ideas do you have for the logo? (colors, style, some logos you like, etc.)

To buttress the Hun's suggestion: http://www.digitalprosound.com/Htm/SoapBox/soap2_Apogee.htm

It deals with sample rate, not resolution but the concept still applies, expand to at 2x, preferably 4x, do the modifications, downsample.

tebasuna51
31st December 2005, 12:02
I don't know whether you are already doing this:

any_audiosurce()
ConvertAudioTo24bit() #or better float or 32bit
downmix() / upmix() / normalize()
ConvertAudioTo16bit()

this should effectively reduce rounding errors.
From AviSynth doc:

Starting from AviSynth v2.5. If some filters doesn't support a specific sample type, they are converted to the format preserving most quality (most often floats). Float samples are also automatically converted back to 16bit before delivering them as output.
SoxFilter converts audio to 32 bit integers.
Amplify: 8bit and 24bit Audio samples are converted to float in the process, the other audio formats are kept.
Normalize: The audio sample type is converted to float or is left untouched if it is 16 bits.
SSRC Shibata Sample Rate Converter is a resampler. Audio is always converted to float.
...

Then a first conversion to a specific format don't guarantee maintain this format along a DSP function.
We can analyze each DSP to search the optimum format.

scharfis_brain
31st December 2005, 12:31
since we are using several chained instances of mixaudio, we need to process in a higher bit depth than 16 bit.

Prodater64
2nd January 2006, 04:53
I don't understand how does it work.
I want to know how to do any format to ac3 output.
Could it be reached from command line?
Is ac3 output configurable (channels, hz, kbps, etc.)
Once the script is created, with which app i will obtain the final ac3 audio file?
TIA.

tebasuna51
2nd January 2006, 11:58
since we are using several chained instances of mixaudio, we need to process in a higher bit depth than 16 bit.
The Downmix DSP function's can be improved replacing the line 9 from file DownMix.extension:

c{2}=last

with:

c{2}=ConvertAudioToFloat(last)

All internal plugins used (GetChannel, MixAudio, Amplify and MergeChannels) support float format (also Normalize if you want use this DSP after the Downmix).

In a simple test the differences between the int16 and float methods are below 0.0001 (-80.76 dB)

Mr_Odwin
3rd January 2006, 15:22
ConvertAudioTo24bit() #or better float or 32bit
ConvertAudioTo16bit()

this should effectively reduce rounding errors.

A bit off topic I know, but what do those functions do? What is the difference between 16 bit, 24 bit, 32 bit and float? Is one 'more accurate' but more cpu-intensive? Google wouldn't tell me. :(

tebasuna51
8th January 2006, 14:30
BeHappy New Year!

I make some mod's to BeHappy and I have also a petition, all included in:
http://personal.telefonica.terra.es/web/burgosrosa/behappym.zip
Here is a brief description:

1) I don't know how generate UniqueID, then for new extension I copy the Downmix UniqueID and I make a little change. Works for me.

2) Downmix: Mod <AudioDSP> Append DPL I option and c{2}=ConvertAudioToFloat(last) in <ScriptPrologue>

3) SSRC: New <AudioDSP> multioption. The samplerate conversion utility.

4) Mono -> Stereo: New <AudioDSP> without comment.

5) TimeStretch: New <AudioDSP> Only to check this function with 'tempo' parameter and two common presets. Maybe we need a complex emergent window to select between the three parameters 'tempo', 'pitch' and 'rate' and their associate values (like Belight 'SoundTouch').
At last the most used 'tempo' need a capture box to put manualy exact values (a slider don't work). Maybe at 'Tweak' section?.

6) MPASource: New <AudioSource>: Tested this decoder plugin (avisynth.org) and work ok for mp3 and mp2 inputs.

7) ffmpeg MP2: New <AudioEncoder>: Tested ffmpeg like mp2 encoder.

8) TODO:
We can use avs input to emulate the BeSweet input .mux (6 mono wav like input), with this merge.avs:

m1 = WAVSource("D:\Test\Mono_FL.wav")
m2 = WAVSource("D:\Test\Mono_FR.wav")
m3 = WAVSource("D:\Test\Mono_C.wav")
m4 = WAVSource("D:\Test\Mono_LFE.wav")
m5 = WAVSource("D:\Test\Mono_SL.wav")
m6 = WAVSource("D:\Test\Mono_SR.wav")
MergeChannels(m1, m2, m3, m4, m5, m6)

But I don't know how split a multichannel wav in mono wavs with BeHappy.
Maybe Dimzon can include a new 'Destination' item 'Mono wavs Writer' inside BeHappy code, or anybody can make a 'decoder' with standar input support.
I think is easy to do, but out of my knowledge. I only can can write a simple standalone app to do this job with a multichannel wav file input, included (Wav2mono.zip) in behappym.zip.

I appreciate test and comment.

dimzon
10th January 2006, 11:35
BeHappy New Year!
I make some mod's to BeHappy and I have also a petition, all included in:
http://personal.telefonica.terra.es/web/burgosrosa/behappym.zip
Here is a brief description:

WOW, Thanx a lot!
Unfortunally I can't download it now :(


1) I don't know how generate UniqueID, then for new extension I copy the Downmix UniqueID and I make a little change. Works for me.

http://kruithof.xs4all.nl/uuid/uuidgen


7) ffmpeg MP2: New <AudioEncoder>: Tested ffmpeg like mp2 encoder.

Why ffmpeg and not tooLame? Does ffmpeg produce better quality?


or anybody can make a 'decoder' with standar input support.
I will write it a little later :)

tebasuna51
10th January 2006, 14:12
Thanks for the reply.
Why ffmpeg and not tooLame? Does ffmpeg produce better quality?
I don't know if there are quality differences, but TooLame don't work for me.
I tried TooLame v0.2k and v0.2l.

The unique partial success I get is with TooLame v0.2l and this parameters:
<ExecutableArguments>- "{0}"</ExecutableArguments>

Partial because:
- TooLame don't read the header and is treated as raw PCM, then there are a initial click and the data is treated as 44100 (default for TooLame)

- Insert a:
<UseRawPCM>true</UseRawPCM>
seems don't work for this kind of extension.

- Insert a parameter to override the default 44100 like:
<ExecutableArguments>-s 48000 - "{0}"</ExecutableArguments> or
<ExecutableArguments>- -s 48000 "{0}"</ExecutableArguments>
Produce a:
Error: Can't start encoder: Cannot process request because the process (1644) has exited.

- With TooLame v0.2k the parameters:
<ExecutableArguments>- "{0}"</ExecutableArguments>
work without errors but the encoded file is incorrect (a click and a short silence).

- Any other combination of parameters produce errors like:
Error: Abnormal encoder termination 1 OR
Error: Can't start encoder: Cannot process request because the process (596) has exited.

Maybe I don't found the correct method.

Prodater64
14th January 2006, 10:26
I asked a question on jan/2 http://forum.doom9.org/showthread.php?p=760695#post760695

Could somebody answer me, please.


I don't understand how does it work.
I want to know how to do any format to ac3 output.
Could it be reached from command line?
Is ac3 output configurable (channels, hz, kbps, etc.)
Once the script is created, with which app i will obtain the final ac3 audio file?
TIA.

tebasuna51
14th January 2006, 13:11
I don't understand how does it work.
Refer to original idea for a complete discussion:
http://forum.doom9.org/showthread.php?t=103069

Basically:
1) Open/Decode any audio source to obtain a uncompressed audio.
You can use a specific audio decoder plugin (NicAudio for dts/ac3, MpaSource for mp2/mp3) or the generic DirectShowSource then the adequate installed filter is used. If you have ffdshow installed you can use Audio decoder configuration facility.

2) Use any DSP or Tweak option to modify the uncompressed audio. Then you can: Delay, Split, Downmix, Resample (SSRC), Stretch, Amplify, Normalize, ...(the Upmix option don't work now).

3) Recompress the audio (or save as wav) with any of the tested encoders.

I want to know how to do any format to ac3 output.
1) Select the source and the appropriate decoder (or DirectShowSource).
2) Apply the desired DSP and/or Tweak options. (maybe nothing)
3) Select the output filename and ffmpeg ac3 encoder
4) Add to Job Control and run the job (in Job Control window)

Could it be reached from command line?
Then you need write the avs script (or use Export Avisynt Script from BeHappy), and use BePipe (see the related thread 'original idea')

Is ac3 output configurable (channels, hz, kbps, etc.)
The free encoder ffmpeg only accept, afaik, the bitrate parameter (like ac3enc with BeSweet). The channels and Hz are taken from the source (DownMix or Resample can modify this).

Once the script is created, with which app i will obtain the final ac3 audio file?
Add to Job Control and run the job (in Job Control window) and the ac3 is obtained.

tebasuna51
16th January 2006, 18:42
Tested TwoLAME 0.3.3 Release 2005-06-09, (The fork of the tooLAME project. ICL4.5), from http://www.rarewares.org/mp3.html

It work fine with BeHappy and is based in TooLAME 0.2mbeta, then can be used instead ffmpeg for mp2 encoder.

There are new version 0.3.4 and 0.3.5 (Last updated 29-Nov-2005) in http://www.twolame.org/ , but I don't found any Windows compiled exe.

Included in http://personal.telefonica.terra.es/web/burgosrosa/behappym.zip with other minor changes (interested see the readme inside the zip).

dimzon
16th January 2006, 18:47
Tested TwoLAME 0.3.3 Release 2005-06-09, (The fork of the tooLAME project. ICL4.5), from http://www.rarewares.org/mp3.html

It work fine with BeHappy and is based in TooLAME 0.2mbeta, then can be used instead ffmpeg for mp2 encoder.

There are new version 0.3.4 and 0.3.5 (Last updated 29-Nov-2005) in http://www.twolame.org/ , but I don't found any Windows compiled exe.

Included in http://personal.telefonica.terra.es/web/burgosrosa/behappym.zip with other minor changes (interested see the readme inside the zip).

can you reupload it to http://www.mytempdir.com

tebasuna51
16th January 2006, 18:55
@Dimzon
Upload bhappym.zip: http://www.mytempdir.com/388248

dimzon
16th January 2006, 19:05
@Dimzon
Upload bhappym.zip: http://www.mytempdir.com/388248

Ok, Thanx!
according documentation SSRC can't convert any samplerate to any another.
http://www.avisynth.org/SSRC

but You can use ResampleAudio http://www.avisynth.org/ResampleAudio

So I think better solution will be to write more intellectual function. It must check: does SSRC applicable to this samplerates and use ResampleAudio if not

tebasuna51
16th January 2006, 19:12
Also TimeStretch can do the job:
"Adjusting "Rate" is equivalent to using AssumeSampleRate and ResampleAudio, but at very high quality."

buttfacepoop
23rd January 2006, 07:16
great work dimzon. i switched over to behappy from besweet as encoding with nero 7's aac was becoming too difficult with besweet.

just one question - is it not possible to do 2-pass encoding with your tool because of the stdin input?

dimzon
23rd January 2006, 09:21
great work dimzon. i switched over to behappy from besweet as encoding with nero 7's aac was becoming too difficult with besweet.

just one question - is it not possible to do 2-pass encoding with your tool because of the stdin input?
Does you really need it? Can you post me link @ 2-pass audio encoder?

buttfacepoop
24th January 2006, 00:51
Does you really need it? Can you post me link @ 2-pass audio encoder?

sorry i mean normalizing.

dimzon
24th January 2006, 11:42
sorry i mean normalizing.
normalizing are possiible via AviSynth ( Normalize() )

NorthPole
29th January 2006, 01:02
Really liked the idea behind behappy and looking forward to the upmix option (if it is possible).

I had a question about the bepipe command line utility. Currently I am upmixing audio for recorded TV. I have been using fbr2k with a dsp plugin to convert and write the 6 channel wave. Then I was pluggin the wave into behappy to get the correct ac3 file. I tried to go directly from the mp2 to the ac3 in fb2k but can't because of the ac3 channel mapping problem. I had the idea of calling bepipe from fb2k to remap (i think its just frameserving) the audio and encode with ffmpeg.
To see if it could worked I tried to get bepipe working from the command prompt with the following command line:

BePipe.exe --script "WavSource(^incorrect.wav^) AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)),width=32,height=32,pixel_type=^RGB24^,fps=1000),last) 6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last AudioDubEx(Tone(),last)" | ffmpeg.exe -i - -y -acodec ac3 -ab 448 "correct.ac3" <incorrect.wav

No luck. runs fine but doesn't remap the channels. Any suggestions?

tebasuna51
29th January 2006, 03:28
I think Bepipe can't work from fb2k because you need the physical file "incorrect.wav" and can't be supplied by "< incorrect.wav".

Work ok with:
BePipe.exe --script "WavSource(^incorrect.wav^).GetChannel(1,3,2,5,6,4)" | ffmpeg.exe -i - -y -acodec ac3 -ab 448 "correct.ac3"

With your command line ffmpeg encode directly "incorrect.wav".

NorthPole
29th January 2006, 13:45
@tebasuna51

thanks for the reply.

I get a pipe error why I try your command line?

C:\Temp>BePipe.exe --script "WavSource(^incorrect.wav^).GetChannel(1,3,2,5,6,4)" | ffmpeg.exe -i - -y -acodec
ac3 -ab 448 "correct.ac3"
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
WavSource("incorrect.wav").GetChannel(1,3,2,5,6,4)
# END


ffmpeg version CVS, build 3277056, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-a52 --enable-gpl --enable-memalign-hack
built on Dec 8 2005 10:06:35, gcc: 3.4.2 (mingw-special)
Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Writing Header...
Writing Data...
0% pipe:: Error while opening file
Done!

Any ideas?
Tried 2 different builds of ffmpeg. The one above and the one from the ffmpeggui setup.

NorthPole
29th January 2006, 14:15
@tebasuna51

Runs ok when I use this command line but doesn't remap channels

C:\Temp>BePipe.exe --script "WavSource(^incorrect.wav^).GetChannel(1,3,2,5,6,4)" | ffmpeg.exe -i - -y -acodec
ac3 -ab 448 "correct.ac3" <incorrect.wav
ffmpeg version CVS, build 3277056, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-a52 --enable-gpl --enable-memalign-hack
built on Dec 8 2005 10:06:35, gcc: 3.4.2 (mingw-special)
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 4608 kb/s
Stream #0.0: Audio: pcm_s16le, 48000 Hz, 5:1, 4608 kb/s
Output #0, ac3, to 'correct.ac3':
Stream #0.0: Audio: ac3, 48000 Hz, 5:1, 448 kb/s
Stream mapping:
Stream #0.0 -> #0.0
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
WavSource("incorrect.wav").GetChannel(1,3,2,5,6,4)
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Writing Header...
Writing Data...
size= 957kB time=17.5 bitrate= 448.0kbits/s s/s
video:0kB audio:957kB global headers:0kB muxing overhead 0.000000%
Done!

Note: input says it is coming from pipe?
Running winxp operating system.

NorthPole
29th January 2006, 14:24
Final Note:

The version of bepipe that I am using was download from the link on the first post. Datestamp on the file is 11/25/05 even though the date on the website says 12/09/05. File version 1.0.2155.27457.

I believe I have the latest and perhap the only released version of bepipe.

tebasuna51
30th January 2006, 04:08
I have same versions:
fmpeg version CVS, build 3277056
Last Bepipe version 1.0.2155.27457

Yesterday work ok, and now I get the same error:
0% pipe:: Error while opening file

I test:
BePipe.exe --script "WavSource(^incorrect.wav^).GetChannel(1,3,2,5,6,4)" > correct.wav

and work. Maybe is a sync issue betwen bepipe and ffmpeg.
Sorry, I can't help you, maybe Dimzon ...

About:
"Note: input says it is coming from pipe?"

The chars "< | >" are called 'pipe' commands, the input file for ffmpeg is taken from "< incorrect.wav" and not from bepipe output, then the channels aren't remapped.

damrod
30th January 2006, 11:56
nice tool !

i will give it a try...

btw with nero aac can you make abr encoding?? if you specify bitrate it's cbr and vbr is not abr... i want to make true abr@64 for exemple...can find the parameters in cmdline for aacenc32.exe (i use it to attack nero7 dlls)

is nero aac he-aac v2 or v1...the v2 is aac+ with SP i think (same quality @44 than he-aac@64..if i remember right)

NorthPole
30th January 2006, 14:43
@tebasuna51
BePipe.exe --script "WavSource(^incorrect.wav^).GetChannel(1,3,2,5,6,4)" > correct.wav

works ok for me too.

Thanks for your efforts. Maybe I'll give the upmix option a shot.

NorthPole
31st January 2006, 04:08
Ok, I modified the upmix extension with the following and got some 6 channel upmixes.

<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>{0}</TitleFormatString>
<ScriptPrologue>
# Store clip in variable
Stereo_{2} = convertaudiotofloat(last)
</ScriptPrologue>
<Option>
<Name>Upmix Using SuperEQ Files</Name>
<Value>
# SuperEq files with 20ms delay
fl_{2} = SuperEQ(Stereo_{2}.getleftchannel,"c:\program files\behappy\front.feq")
fr_{2} = SuperEQ(Stereo_{2}.getrightchannel,"c:\program files\behappy\front.feq")
cc_{2} = SuperEQ(Stereo_{2}.ConvertToMono,"c:\program files\behappy\center.feq")
lfe_{2} = SuperEQ(Stereo_{2}.ConvertToMono,"c:\program files\behappy\lfe.feq")
sl_{2} = SuperEQ(Stereo_{2}.getleftchannel,"c:\program files\behappy\back.feq")
sr_{2} = SuperEQ(Stereo_{2}.getrightchannel,"c:\program files\behappy\back.feq")
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Upmix using Sox Filter</Name>
<Value>
# Sox filter with 20ms delay
Front_{2} = mixaudio(Stereo_{2}.soxfilter("filter 0-600"),mixaudio(Stereo_{2}.soxfilter("filter 600-1200"),Stereo_{2}.soxfilter("filter 1200-7000"),0.45,0.25),0.50,1)
Back_{2} = mixaudio(Stereo_{2}.soxfilter("filter 0-600"),mixaudio(Stereo_{2}.soxfilter("filter 600-1200"),Stereo_{2}.soxfilter("filter 1200-7000"),0.35,0.15),0.40,1)
fl_{2} = GetLeftChannel(Front_{2})
fr_{2} = GetRightChannel(Front_{2})
cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 65")
sl_{2} = GetLeftChannel(Back_{2})
sr_{2} = GetRightChannel(Back_{2})
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<ScriptEpilogue>
# Return result
MergeChannels( fl_{2}, fr_{2}, cc_{2}, lfe_{2}, sl_{2}, sr_{2})
ConvertAudioTo16Bit()
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

This is a pretty basic approach.

If you want to use the supereq option (built into avisynth) you need to run fb2k and save a equalizer frequency file from the dsp manager, equalizer tab. I saved one for the front, center, lfe and back. I would upload them but I don't know how or where to do that. (This is similar to kpexs' upmix program method). Note that you need to change the reference in the above code to point to your appropiate .feq files.

If you use the sox filter mentioned earlier in this thread (I think its page 1, near the bottom) you can find a link to the sox avisynth beta plugin. You have to copy that to your avisynth plugin subdirectory. That it.

If anybody has better ideas for the sox settings, let me know. Thanks.

@tebasuna51,
A while back you asked about the reverb function/program/option. It is a soxs' filter option that you can access with the sox plugin.

dimzon
31st January 2006, 11:23
@NorthPole
Nice. Can you post your EQ-files too?

tebasuna51
31st January 2006, 13:56
I would upload them but I don't know how or where to do that.
The .feq files are plain text and very short. You can use Notepad to Copy and Paste in the post directly.
@tebasuna51,
A while back you asked about the reverb function/program/option. It is a soxs' filter option that you can access with the sox plugin.
Thanks, but I think is Dimzon who ask about reverb.

I don't know very much about upmix procedures. Maybe if ursamtl read this post can help with their expert opinion about upmix.

Now I'm working with compand function from Sox, trying to do a Dynamic Range Compression DSP function for BeHappy. If anybody work about this, let me know.

dimzon
31st January 2006, 13:59
Now I'm working with compand function from Sox, trying to do a Dynamic Range Compression DSP function for BeHappy.
Sounds great! Please, keep me informed. I'm working on MeGUI right now and have no time for BeHappy

NorthPole
31st January 2006, 14:42
@dimzon

here are the feq files that I used

Front.feq
-96
-96
-96
-4
-4
-4
-4
-4
-4
-4
-4
-4
-4
-4
-4
-96
-96
-96

center.feq
-96
-96
-96
-96
-96
-96
3
3
3
3
3
3
3
3
3
3
3
3

lfe.feq
0
0
0
-96
-96
-96
-96
-96
-96
-96
-96
-96
-96
-96
-96
-96
-96
-96

back.feq
-96
-96
-96
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
-96
-96
-96

They are just text files that can be cut and pasted using notepad.
I didn't spend as much time on these as I did the sox filter because I thought the sox filter had better potential. However these do work fine. Both methods were geared toward more of a "surround sound" mix for dvd movies and recorded tv. I was trying to get the dialoge in the center channel and added a 20ms delay on the back channels.

dimzon
31st January 2006, 15:11
@NorthPole

sl_{2} = SuperEQ(Stereo_{2}.getleftchannel,"c:\program files\behappy\back.feq")
sr_{2} = SuperEQ(Stereo_{2}.getrightchannel,"c:\program files\behappy\back.feq")


Is'nt more efficient to use
temp{2} = SuperEQ(Stereo_{2}, "c:\program files\behappy\back.feq");
sl_{2} = temp{2}.getleftchannel()
sr_{2} = temp{2}.getrightchannel()

NorthPole
31st January 2006, 17:48
@dimzon

Yes, your code looks better, only one pass thru with the eq. then split.

2 comments on the sox method.

I think the lfe is either too loud or needs lower freq. setting. Currently at 65
for lowpass

May be more efficient to run sox mixaudio once on stereo source then split for left and right like it is currently but then instead of running sox filter again on stereo source for back channels, just reduce volume by a percentage from the front channels?

NorthPole
31st January 2006, 18:02
@dimzon

Is semicolon important at the end of you temp{2} line or is it a typo?

dimzon
31st January 2006, 18:56
@dimzon

Is semicolon important at the end of you temp{2} line or is it a typo?
typo ;)

NorthPole
31st January 2006, 19:06
@dimzon

I think the lfe is either too loud or needs lower freq. setting. Currently at 65
for lowpass


I think this is better

lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol 0.5")

NorthPole
31st January 2006, 19:20
May be more efficient to run sox mixaudio once on stereo source then split for left and right like it is currently but then instead of running sox filter again on stereo source for back channels, just reduce volume by a percentage from the front channels?

Tried to change volume and/or amplify front_{2} but doesn't work. Behappy terminated almost immediately. I think the sox filter crashes behappy in this situation.

dimzon
1st February 2006, 14:14
http://img64.imageshack.us/img64/7012/newpng5lg.png
new enc_aacplus.extension is avaluable @ BeHappy workspace

tebasuna51
2nd February 2006, 13:43
DynRanComp: New <AudioDSP> Dynamic Range Compression based in compand function from Sox.
Compression curves based in Anex C from Dolby Digital Professional Encoding Guidelines. There are a link for this document and graphs in:
http://forum.doom9.org/showthread.php?t=56020

This is a test release for discussion about the following problems:

1) The DSP function, outside the ac3 decoder, can't know the original ac3 Dialog Normalization and DRC method, then must be supplied by the user.
The DRC method can be selected in DSP configure, but the DialNorm can be set with:
- Another DSP multioption (31) to use before DynRanComp.
- With the 'Tweak' Amplify, but don't work with negative values (? to Dimzon).
- Editing DynRanComp.extension before run BeHappy. Method selected in this test release.

2) The Normalize() function don't work after Sox compand, maybe because:
"compand is very hard to control, and doesn't support restarts (crash)"
(in "Sox Audio Effect Filter for AviSynth" doc.)
Then maybe we need another set of 'normalized' curves to avoid the low volume problem.

3) The compand function don't work fine with segments 20:1.
For segment (-21,-21)-(0,-20) I obtain a output (-21,-21)-(0,-18)

4) The compand parameters (attack1,decay1,...,delay) may need optimization.

The DynRanComp.extension file is:
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="934f5ce0-9203-11da-a72b-0800200c9a66">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>DynRanComp - {0}</TitleFormatString>
<ScriptPrologue>
# Dialog Normalization. Amplify by: -31 -(DialNorm), 0 for DN=-31, -4 for DN=-27, -11 for DN=-20 ...
# AmplifydB(-4.0)
# Define transformation function
</ScriptPrologue>
<Option>
<Name>Film Standard</Name>
<Value>
# Film Standard. Segments: (Noise) +6dB 2:1 = 20:1
# Points: ------- ------- ------- ------- ------- -----
SoxFilter("compand 0.1,0.3 -90,-90,-70,-64,-43,-37,-31,-31,-21,-21,0,-20 0 0 0.1")
</Value>
</Option>
<Option>
<Name>Film Light</Name>
<Value>
# Film Light Segments: (Noise) +6dB 2:1 = 20:1
# Points: ------- ------- ------- ------- ------- -----
SoxFilter("compand 0.1,0.3 -90,-90,-70,-64,-53,-47,-41,-41,-21,-21,0,-20 0 0 0.1")
</Value>
</Option>
<Option>
<Name>Music Standard</Name>
<Value>
# Music Standard Segments: (Noise) +12dB 2:1 = 20:1
# Points: ------- ------- ------- ------- ------- -----
SoxFilter("compand 0.1,0.3 -90,-90,-70,-58,-55,-43,-31,-31,-21,-21,0,-20 0 0 0.1")
</Value>
</Option>
<Option>
<Name>Music Light</Name>
<Value>
# Music Light Segments: (Noise) +12dB 2:1 = 2:1
# Points: ------- ------- ------- ------- ------- -----
SoxFilter("compand 0.1,0.3 -90,-90,-70,-58,-65,-53,-41,-41,-21,-21,0,-11 0 0 0.1")
</Value>
</Option>
<Option>
<Name>Speech</Name>
<Value>
# Speech Segments: (Noise) +15dB 5:1 = 20:1
# Points: ------- ------- ------- ------- ------- -----
SoxFilter("compand 0.1,0.3 -90,-90,-70,-55,-50,-35,-31,-31,-21,-21,0,-20 0 0 0.1")
</Value>
</Option>
<ScriptEpilogue>
# Normalize recommended because volume is always less than -20 dB (except Music Light -11)
# Normalize() # But Normalize don't work after SoxFilter("compand...")
# SoxFilter work with 32 bit integer, and at last wav output is send 32 bit. Then maybe...:
# ConvertAudioTo16Bit()
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

dimzon
2nd February 2006, 13:54
@tebasuna51
Great!
Unfortunally I'm not DSP expert.
Why not to use Normalize() BEFORE Dynamic Range Compression?

tebasuna51
2nd February 2006, 15:54
Why not to use Normalize() BEFORE Dynamic Range Compression?
The decoder output (NicAudio) have the full dynamic range and can have samples with 0 dB, then the Normalize function do nothing with this signal.

We need, also, apply attenuation over the decoder output to compensate DialNorm (if distinct of -31 dB) for input correctly in DRC curves.

The solution is make alternate curves with normalized output. I'm work about this.

dimzon
2nd February 2006, 16:34
The decoder output (NicAudio) have the full dynamic range and can have samples with 0 dB, then the Normalize function do nothing with this signal.

Do not forget - we can use DRC on NON-AC3 input ;)

The solution is make alternate curves with normalized output. I'm work about this.
Yeah, it's the best

dimzon
2nd February 2006, 18:57
fresh beta is out

Dayvon
2nd February 2006, 19:34
2 All
Hi! You can help BeHappy project!
I need:
BeHappy logo & icons

I'd like to help with this Dimzon. You have any preferences or specifics in mind?

NorthPole
3rd February 2006, 04:34
Made some changes to the upmix extension I posted earlier...

Removed the option to use the avisynth equilizer because it is extremely slow in execution.

I added a second upix option that tries to remove most of the dialog from the left, right and surround speakers and sends it just to the center speaker.
Also, inverted the LFE, attenuated and delayed the surround speakers as before.

<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>{0}</TitleFormatString>
<ScriptPrologue>
# Store clip in variable
Stereo_{2} = convertaudiotofloat(last)
</ScriptPrologue>
<Option>
<Name>Upmix with equalizer adjustments</Name>
<Value>
# Sox filter using frequency selection, 20ms surround delay and attenuation
Front_{2} = mixaudio(Stereo_{2}.soxfilter("filter 0-600"),mixaudio(Stereo_{2}.soxfilter("filter 600-1200"),Stereo_{2}.soxfilter("filter 1200-7000"),0.45,0.25),0.50,1)
Back_{2} = mixaudio(Stereo_{2}.soxfilter("filter 0-600"),mixaudio(Stereo_{2}.soxfilter("filter 600-1200"),Stereo_{2}.soxfilter("filter 1200-7000"),0.35,0.15),0.40,1)
fl_{2} = GetLeftChannel(Front_{2})
fr_{2} = GetRightChannel(Front_{2})
cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol -0.5")
sl_{2} = GetLeftChannel(Back_{2})
sr_{2} = GetRightChannel(Back_{2})
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Upmix with center channel dialog</Name>
<Value>
# channel subtraction with sox filter, 20ms surround delay and attenuation
left_{2} = stereo_{2}.GetLeftChannel()
right_{2} = stereo_{2}.GetRightChannel()
fl_{2} = mixaudio(left_{2}.soxfilter("filter 0-24000"),right_{2}.soxfilter("filter 0-24000"),0.6,-0.5)
fr_{2} = mixaudio(right_{2}.soxfilter("filter 0-24000"),left_{2}.soxfilter("filter 0-24000"),0.6,-0.5)
cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol -0.5")
sl_{2} = mixaudio(left_{2}.soxfilter("filter 0-24000"),right_{2}.soxfilter("filter 0-24000"),0.5,-0.4)
sr_{2} = mixaudio(right_{2}.soxfilter("filter 0-24000"),left_{2}.soxfilter("filter 0-24000"),0.5,-0.4)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<ScriptEpilogue>
# Return result
MergeChannels( fl_{2}, fr_{2}, cc_{2}, lfe_{2}, sl_{2}, sr_{2})
ConvertAudioTo16Bit()
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

@tebasuna51

Nice dynamic range compression extension. I agree that it would be nice to be able to use negative values in tweak.

@Dimzon

I tried this code but it executed extremely slowly

left_{2} = last.GetLeftChannel()
right_{2} = last.GetRightChannel()
fl_{2} = mixaudio(left_{2},right_{2},0.6,-0.5)
fr_{2} = mixaudio(right_{2},left_{2},0.6,-0.5)
cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol -0.5")
sl_{2} = mixaudio(left_{2},right_{2},0.5,-0.4)
sr_{2} = mixaudio(right_{2},left_{2},0.5,-0.4)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)

dimzon
3rd February 2006, 11:07
I'd like to help with this Dimzon. You have any preferences or specifics in mind?
Just make it eyecandy ;)

Dayvon
3rd February 2006, 16:39
Just make it eyecandy ;)

Is this creative liberty you've given me? :D :devil:

dimzon
3rd February 2006, 16:45
Is this creative liberty you've given me? :D :devil:
Yes.
By the way - since BeHappy is avisynth based software maybe we can use portion of avisynth logo in it (just proposal, feel free not to do it)

Dayvon
3rd February 2006, 17:12
Yes.
By the way - since BeHappy is avisynth based software maybe we can use portion of avisynth logo in it (just proposal, feel free not to do it)

I'll look into it! :cool:

tebasuna51
4th February 2006, 12:59
@Dimzon
I get incorrect wav output (BlockAlign incorrect) with your last release (and also incorrect aac encodes).

Maybe there are a bug in Encoder.cs (now there are 2 writeHeader routines)

CORRECT:
private void writeHeader(Stream target ) {
...
target.Write(BitConverter.GetBytes(m_wavHeader.nBlockAlign),0,2);
target.Write(BitConverter.GetBytes(m_wavHeader.wBitsPerSample),0,2);
...
}

INCORRECT:
private void writeHeader(Stream target, AviSynthClip x ) {
...
target.Write(BitConverter.GetBytes(x.BitsPerSample/8),0,2); // ?????
target.Write(BitConverter.GetBytes(x.BitsPerSample),0,2);
...
}
BUG: BlockAlign = ChannelsCount * BitsPerSample/8

TheBashar
4th February 2006, 22:07
Can someone please give me a sanity check with this scheme? I like to cut out the opening and ending credits of my TV series encodes with something like Trim(90,6000)+Trim(9000,61000) for the video. Cutting, merging, and muxing the audio is ehh okay, but I've always struggled with some synch issues.

I'd like to try avisynth processing via BeHappy to see if I can use the same Trim statements to manipulate the audio as I do with the video so maybe I can avoid or eliminate the synch issues.

I set up BeHappy to do an ac3 -> aac conversion and exported the avs to look at. I was wondering if this would work.


audio = DirectShowSource("audio.ac3")
audio = EnsureVBRMP3Sync(audio)
# Above same as BeHappy Generated:
video = MPEG2Source("video.d2v")
AudioDeubEx(video, audio)
# Use same trim arguments as in video encoding script:
Trim(90,6000)+Trim(9000,61000)
AudioDubEx(Tone(), last)
# Below same as BeHappy Generated:
AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=320,height=32,pixel_type="RGB24",fps=1000), last)
Normalize...
Encode...
Kill Video again...

So in essence I'd bring in the audio, apply the vbrsynch black magic, dub it to the actual video clip, trim with the video trim settings, kill the real video, dub it to the 1000 fps blank video, normalize, encode, and kill the blank video.

Is this a sane way to go about this task?

Thanks!

tebasuna51
5th February 2006, 01:37
You don't need:

AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=320,height=32,pixel_type="RGB24",fps=1000), last)
...
Kill Video again...

Because this AudioDubEx sentence is only to use Trim in ms. (fps=1000), and Trim is used before based in video fps.

If you want maintain the ac3 without re-encode there are other method to trim the audio with DelayCut:

You want a first segment like this: Trim(90,6000)
If fps is 25 (replace 25 with your appropriate fps) you want a segment between 90/25 = 3.6 sec and 6000/25 = 240 sec. Then open DelayCut and Cut your original ac3 between Start = 3600 and End = 240000 ms.

For the second segment Cut between 360000 ms (9000/25 sec) and 2440000 ms. (61000/25 sec).

After join the two segments with:

> copy /B first.ac3 + second.ac3 full.ac3

dimzon
6th February 2006, 11:56
BUG: BlockAlign = ChannelsCount * BitsPerSample/8
Are you 100% shure? (this will affect MeGUI too)

tebasuna51
6th February 2006, 13:06
Are you 100% shure? (this will affect MeGUI too)
With this kind of wavheader (PCM 16 or 32 bits int) always:

BlockAlign = ChannelsCount * BitsPerSample/8

dimzon
6th February 2006, 13:09
With this kind of wavheader (PCM 16 or 32 bits int) always:

BlockAlign = ChannelsCount * BitsPerSample/8
Thanx a lot, will be fixed soon

dimzon
6th February 2006, 14:34
http://forum.doom9.org/showthread.php?t=83752 - additional info about 5.1 upmix

3dsnar
7th February 2006, 15:27
Hi Dimzon. I have prepared the pseudosurround DLL for ya :D

I cannot attach it to this post, cause it is to big.
Please drop me an email: programmers AT aud-x.com
and I will reply and send you the attachement.

(ie. the DLL, and the complete project. Maybe it will be useful)

After downloading, please let me know, and I will remove it.
I will be happy to answer all your questions (if you have any).

shon3i
7th February 2006, 15:33
@Dimzon how to boost 6ch audio aac like hibridgain in besweet or autogk with mp3 ,with behappy

grokwik
14th February 2006, 00:11
Dimzon, thanks a lot for this awsome tool !
I can now transcode audio from multiple avi quickly. Every thing works fine.
I have noticed that nero aac encode works with or without neroipp.dll without any difference. Is this dll really necessary ?

dimzon
14th February 2006, 12:23
I have noticed that nero aac encode works with or without neroipp.dll without any difference. Is this dll really necessary ?
It's really necessary if you does not have Nero installed

JoeBG
14th February 2006, 19:44
I cant get work
- upmix (is it still not supportet) (invalid arguments to function "SuperEq"
- normalize (nothing happens)

Do I need some special software packages?

tebasuna51
14th February 2006, 20:05
- Upmix is in experimental stage by NorthPole, and need Sox Audio Effect Filter ( http://forum.doom9.org/showthread.php?t=104792 ), see the post:
http://forum.doom9.org/showpost.php?p=779538&postcount=66

- Normalize works fine (amplify the signal until the required level).

JoeBG
14th February 2006, 20:50
- Upmix is in experimental stage by NorthPole, and need Sox Audio Effect Filter ( http://forum.doom9.org/showthread.php?t=104792 ), see the post:
http://forum.doom9.org/showpost.php?p=779538&postcount=66

Works fine now, many thanks ;)



- Normalize works fine (amplify the signal until the required level).

What means "amplify the signal until the rquired level

I told the tool to normalize to 100 %. Is this not ok?

tebasuna51
15th February 2006, 01:23
What means "amplify the signal until the rquired level
I told the tool to normalize to 100 %. Is this not ok?
I say "required level" only because you can select other value than 100% with the Configure button.

But, is true, the Normalize() function don't work after the upmix because do a second pass (the first to know the max value) to amplify the sound. And some Sox filters doesn't support restarts (crash), like say the documentation.

I have the same problem with the Dynamic Range Compession function and the compand Sox filter.

NorthPole
16th February 2006, 01:43
Well here is the latest revision on the upmix extension

<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>5.1 Upmix - {0}</TitleFormatString>
<ScriptPrologue>
# Store clip in variable
Stereo_{2} = convertaudiotofloat(last)
</ScriptPrologue>
<Option>
<Name>Audio with mostly dialog (ie. Comedy, Drama)</Name>
<Value>
# Profile to use with audio sources that has mostly mono content. 20ms delay and -2db attenuation on surround
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.794,-0.794)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.794,-0.794)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.224,0.224)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.562")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.631,-0.631)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.631,-0.631)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Audio with a mix of sounds (ie. Action, Adventure)</Name>
<Value>
# Profile to use with audio sources that more range of sound content. 20ms delay and -2db attenuation on surround
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.668,-0.668)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.668,-0.668)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.398,0.398)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.447")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.531,-0.531)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.531,-0.531)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<ScriptEpilogue>
# Return result
MergeChannels( fl_{2}, fr_{2}, cc_{2}, lfe_{2}, sl_{2}, sr_{2})
ConvertAudioTo16Bit()
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

changes are as follows:
- removed the frequency adjustment option because the quality was not very good.
- optimized sox filter usage to speed up execution.
- created 2 different sound profiles to use on different types of audio.

Notes on Usage:
1. You need to have the avisynth sox filter in the avisynth plugin subdirectory. See tebasuna51s' post above for the link.
2. Normalize you audio before upmix.
3. Choose a profile to upmix with from the 5.1 upmix config button.

If after upmixing, you can't hear the center channel dialog because the L & R channels are drowning it out, then try the other profile.
Also, you can add your own profile or change the above ones as needed.

@dimzon

Small feature request...

When you add a file to convert, the name of the destination file is shown as the same as the input file (excluding the dot extension) which is good. But when you add a 2nd file to convert, the destination file name doesn't change (it remains the same as the first). Therefore, you have to type in the destination file name.

Not a big deal if its a problem to change... I hope I explained that clearly enough?

iceborne
16th February 2006, 03:03
does downmixing dts to DLP II wav really work in behappy? wanted to know cause i like to trancode DLP II wav to itunes's aac format.

could you also clarify between DPL II and DPL II(lfe)?
which one is equivalent to "-azid( -s dplii -c normal -L -3db )"?

tebasuna51
16th February 2006, 17:53
DPL II is equal to "-azid( -s dplii )" (copied matrix).
DPL II(lfe) equivalent to "-azid( -s dplii -L -3db )".
The "-azid( -c normal )" switch is for Dynamic Range Compression not yet implemented in BeHappy (problem with compand Sox Filter and Normalice see: http://forum.doom9.org/showpost.php?p=779165&postcount=60 ).

If you have ffdshow like default directshow filter to play dts files you can use DirectShow input instead NicDtsSource, and use ffdshow Audio Decoder Configuration to set:
- Codecs -> Dtd - libdts, Dynamic range compression (Checked)
- Mixer -> Dolby Prologic II, LFE (Unchecked)
-Output -> Output sample - only checked 16 bit integer, Don't use WAVEFORMATEXTENSIBLE ...(Checked)

This is equivalent to "-azid( -s dplii -c normal -L -3db )". After use the Normalice DSP function in BeHappy and select your desired encoder.

I test this method with ac3 source, I hope works also with dts.

Edit: I make a test with dts source:
- Same volume output with NicDtsSource and with ffdshow (drc checked and drc unchecked) (?).
- The output length with NicDtsSource is 2:06.688 (like input) and with ffdshow is cut at 1:50.851 (?)

iceborne
16th February 2006, 23:39
from this thread
http://forum.doom9.org/showthread.php?s=&threadid=27936

"Pro Logic II with LFE (Not recommended by Dolby)"

... so i shouldn't even be using "-azid( -s dplii -L -3db )" anyways, correct?


For downmix you ever have to use DRC because more acoustic power will be concentrated in less channels!
what is frank trying to say? not use dynamic range or to use dynamic range on downmix?

tebasuna51
17th February 2006, 01:55
See also http://forum.doom9.org/showthread.php?t=57988 with the definitive matrix used in azid 1.9 and in DPL II in BeHappy.

... so i shouldn't even be using "-azid( -s dplii -L -3db )" anyways, correct?
From "214_Mixing with Dolby Pro Logic II Technology.pdf" :
"There are other concerns when adding an LFE signal to the mix. If the LFE is simply redistributed within the other channels of the mix, they will usually be subject to some low-frequency bandpass filtering. This filtering causes phase shifts of the LFE signal. When they are acoustically added within a room, these phase shifts are fairly subtle and often go unnoticed. However, when they are electronically added together with the five main channels in the encoder, they may produce less than desirable results at certain frequencies. For this reason, it is recommended that the LFE signal not be used in a Dolby Pro Logic II downmix unless it contains unique information that is not repeated in any of the five main channels."
Is your choice, possible artifacts/lose unique info (my choice is don't include LFE).
"For downmix you ever have to use DRC because more acoustic power will be concentrated in less channels!"
what is frank trying to say? not use dynamic range or to use dynamic range on downmix?
I think not use DRC. But isn't my opinion.

You must use DRC to decrease the original signal Dynamic Range if:
1) The source have a wide Dynamic Range (dialogs at -30 dB and explosions at 0 dB).
2) You have a bad/normal audio equipment without support for this wide range (noise with dialogs or explosions distorted) or you don't want disturb the neighbors.
3) You want reencode to a format without support for DRC in play time (mp3, aac, ...)

The DRC is independent and must be do before any downmix.

JoeBG
17th February 2006, 13:04
Hi,

upmix to 5.1 aac works great now for me. :) Many thanks.

What not works is AC3. Do I need any special plugins? ffmpeg or something like this? Can someone give a small HowTo? Thanks :)

dimzon
17th February 2006, 13:21
Hi,

upmix to 5.1 aac works great now for me. :) Many thanks.

What not works is AC3. Do I need any special plugins? ffmpeg or something like this? Can someone give a small HowTo? Thanks :)
You must place ffmpeg.exe into BeHappy folder
Warning! Some ffmpeg versions has buggy stdin support - such versions doesn't work with BeHappy. This version works fine:
ffmpeg version CVS, build 3211776, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-theora --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad --e
nable-faac --enable-xvid --enable-x264 --enable-mingw32 --enable-a52 --enable-dts --enable-pp --enab
le-gpl --enable-memalign-hack --enable-amr_nb --enable-amr_wb
built on Sep 9 2005 04:00:51, gcc: 3.4.4 (mingw special)

NorthPole
18th February 2006, 02:29
I found some additional information on upmix profiles from a couple of other threads

http://forum.doom9.org/showthread.php?p=442997#post442997

http://forum.doom9.org/showthread.php?p=558760#post558760

So I added them to the upmix extension:

<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>5.1 Upmix - {0}</TitleFormatString>
<ScriptPrologue>
# Store clip in variable
Stereo_{2} = convertaudiotofloat(last)
</ScriptPrologue>
<Option>
<Name>Audio with mostly dialog (ie. Comedy, Drama)</Name>
<Value>
# Profile to use with audio sources that have mostly mono content. 20ms delay and -3db attenuation on surround
# Note: the center channel is very weak for this profile
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.794,-0.794)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.794,-0.794)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.224,0.224)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.596")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.562,-0.562)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.562,-0.562)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Audio with a mix of sounds (ie. Action, Adventure)</Name>
<Value>
# Profile to use with audio sources that have a wider range of sound content. 20ms delay and -3db attenuation on surround
# Note: General purpose profile
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.668,-0.668)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.668,-0.668)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.398,0.398)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.447")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.473,-0.473)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.473,-0.473)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Gerzen Profile</Name>
<Value>
# Gerzen approach Profile modified with 20ms delay and some attenuation on surround
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.885,-0.115)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.885,-0.115)
cc_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel,0.4511,0.4511)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.668,-0.668)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.668,-0.668)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Farina Profile</Name>
<Value>
# Farina/Sursound approach Profile M=L+R, S=L-R, c=0.75, L' = (1-c/4)*M+(1+c/4)*S, C' = c*M, R' = (1-c/4)*M-(1+c/4)*S
# also added with 20ms delay and some attenuation on surround
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,0.500),mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,-0.500),0.8125,1.1875)
fr_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,0.500),mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,-0.500),0.8125,-1.1875)
cc_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel,0.375,0.375)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.668,-0.668)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.668,-0.668)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Multisonic Profile</Name>
<Value>
# Multisonic approach Profile modified with 20ms delay and some attenuation on surround
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),1,-0.5)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),1,-0.5)
cc_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel,0.5,0.5)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.668,-0.668)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.668,-0.668)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<Option>
<Name>Sound On Sound Profile</Name>
<Value>
# SOS approach Profile with 20ms delay and some attenuation on surround
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
fl_{2} = stereo_{2}.GetLeftChannel()
fr_{2} = stereo_{2}.GetRightChannel()
cc_{2} = mixaudio(stereo_{2}.GetRightChannel(),stereo_{2}.GetLeftChannel,0.5,0.5)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.668,-0.668)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.668,-0.668)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
</Value>
</Option>
<ScriptEpilogue>
# Return result
MergeChannels( fl_{2}, fr_{2}, cc_{2}, lfe_{2}, sl_{2}, sr_{2})
ConvertAudioTo16Bit()
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

JoeBG
18th February 2006, 05:13
@ dimzon

I took the one from 15.02.2006 from celtic druid, works very good

@ northpole

I´ll try it immediatly

NorthPole
19th February 2006, 00:59
Sorry about so many revision on this upmix extension...

This pretty much finishes what I have been able to come up with so here it is

<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
<Plugin>
<MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
<TitleFormatString>5.1 Upmix - {0}</TitleFormatString>
<ScriptPrologue>
# Store clip in variable
stereo_{2} = convertaudiotofloat(last)
front_{2} = stereo_{2}.soxfilter("filter 20-20000")
back_{2} = stereo_{2}.soxfilter("filter 100-7000")
</ScriptPrologue>
<Option>
<Name>Balanced Center Channel Profile</Name>
<Value>
# Balanced approach L' = (L-R)*0.668 R' = (R-L)*0.668 C' = (L-L')*0.398 + (R-R')*0.398
# Profile for general purposes to use with audio sources that have a wide range of sound content
# Attempts to balance sound levels of L', R' and C' with common mono content in center only
# 20ms delay and -2db attenuation on surround SL' = (L-R)*0.531 SR' = (R-L)*0.531
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.668,-0.668)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.668,-0.668)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.398,0.398)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.500")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.531,-0.531).DelayAudio(0.02)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.531,-0.531).DelayAudio(0.02)
</Value>
</Option>
<Option>
<Name>Decreased Center Channel Profile</Name>
<Value>
# Decreased center approach L' = (L-R)*0.668 R' = (R-L)*0.668 C' = (L-L')*0.224 + (R-R')*0.224
# Profile to use for older movies or videos with mostly mono content.
# Same as balanced approach but with significally reduces C' power
# 20ms delay and -2db attenuation on surround SL' = (L-R)*0.531 SR' = (R-L)*0.531
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.668,-0.668)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.668,-0.668)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.224,0.224)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.596")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.531,-0.531).DelayAudio(0.02)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.531,-0.531).DelayAudio(0.02)
</Value>
</Option>
<Option>
<Name>Increased Center Channel Profile</Name>
<Value>
# Increased center approach L' = (L-R)*0.596 R' = (R-L)*0.596 C' = (L-L')*0.473 + (R-R')*0.473
# Profile to use with audio sources where quieter dialog or lots of loud sound effects.
# Same as balanced approach but with slightly higher C' power and slightly lower L' and R' power
# 20ms delay and -2db attenuation on surround SL' = (L-R)*0.473 SR' = (R-L)*0.473
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.596,-0.596)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.596,-0.596)
cc_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),fl_{2},1,-1),mixaudio(front_{2}.GetRightChannel(),fr_{2},1,-1),0.473,0.473)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.473")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.473,-0.473).DelayAudio(0.02)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.473,-0.473).DelayAudio(0.02)
</Value>
</Option>
<Option>
<Name>Gerzen Profile</Name>
<Value>
# Gerzen approach L' = (0.885*L)-(0.115*R) C' = (L+R)*0.4511 R' = (0.885*R)-(0.115*L)
# Modified by adding 20ms delay and some attenuation on surround SL' = (L-R)*0.531 SR' = (R-L)*0.531
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.885,-0.115)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.885,-0.115)
cc_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel,0.4511,0.4511)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.531,-0.531).DelayAudio(0.02)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.531,-0.531).DelayAudio(0.02)
</Value>
</Option>
<Option>
<Name>Farina Profile</Name>
<Value>
# Farina/Sursound approach M=L+R, S=L-R, c=0.75, L' = (1-c/4)*M+(1+c/4)*S, C' = c*M, R' = (1-c/4)*M-(1+c/4)*S
# Modified by adding 20ms delay and some attenuation on surround SL' = (L-R)*0.562 SR' = (R-L)*0.562
fl_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,0.500),mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,-0.500),0.8125,1.1875)
fr_{2} = mixaudio(mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,0.500),mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.500,-0.500),0.8125,-1.1875)
cc_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel,0.375,0.375)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.562,-0.562).DelayAudio(0.02)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.562,-0.562).DelayAudio(0.02)
</Value>
</Option>
<Option>
<Name>Multisonic Profile</Name>
<Value>
# Multisonic approach L' = L-(0.5*R) C' = (L+R)*0.5 R' = R-(0.5*L)
# Reduced above formula by 10% to eliminate potential clipping on L' and R'
# Modified by adding 20ms delay and some attenuation on surround SL' = (L-R)*0.596 SR' = (R-L)*0.596
fl_{2} = mixaudio(front_{2}.GetLeftChannel(),front_{2}.GetRightChannel(),0.9,-0.45)
fr_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel(),0.9,-0.45)
cc_{2} = mixaudio(front_{2}.GetRightChannel(),front_{2}.GetLeftChannel,0.45,0.45)
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 120","vol -0.5")
sl_{2} = mixaudio(back_{2}.GetLeftChannel(),back_{2}.GetRightChannel(),0.596,-0.596).DelayAudio(0.02)
sr_{2} = mixaudio(back_{2}.GetRightChannel(),back_{2}.GetLeftChannel(),0.596,-0.596).DelayAudio(0.02)
</Value>
</Option>
<ScriptEpilogue>
# Return result
MergeChannels( fl_{2}, fr_{2}, cc_{2}, lfe_{2}, sl_{2}, sr_{2})
ConvertAudioTo16Bit()
</ScriptEpilogue>
</MultiOptionDSP>
</Plugin>
</AudioDSP>
</BeHappy.Extension>

Changes:
- Tweaked most of the surround levels to try and match the particular profile.
- Nuked the sound on sound profile (the last one) because it was just the alot of same sound from the L, R & C (not much channel or dialog separation).
- Changed the names on the first 2 profiles to better explain what they are trying to do.
- Added another profile to increase the center channel levels.
- Added some notes, etc.

Thanks again dimzon for this slick audio convertion tool.

dimzon
19th February 2006, 12:40
@NorthPole
Thanx for Your investigations.
I just wrote a tool, but You and tebasuna51 fill it life

By the way - future of BeHappy
I'm really waitng when MeGUI refacoring done. Probably BeHappy will be assimilated by MeGUI completly (currently it share same code but MeGUI has subset of BeHappy functionality)

JoeBG
19th February 2006, 19:54
@NorthPole
Thanx for Your investigations.
I just wrote a tool, but You and tebasuna51 fill it life

By the way - future of BeHappy
I'm really waitng when MeGUI refacoring done. Probably BeHappy will be assimilated by MeGUI completly (currently it share same code but MeGUI has subset of BeHappy functionality)

Please leave it as a standalone tool :)

dimzon
19th February 2006, 20:29
Please leave it as a standalone tool :)
Why? Why does not combine them with MeGUI (preserving BeHappy functionality/flexibility)

JoeBG
20th February 2006, 20:08
Why? Why does not combine them with MeGUI (preserving BeHappy functionality/flexibility)

OK, this makes sense. :) I just want to be able to use it without MeGUI for quick encoding decisions.

dimzon
1st March 2006, 14:45
The solution is make alternate curves with normalized output. I'm work about this.
Hi! Any progress with it?

tebasuna51
1st March 2006, 17:50
No progress. I make many test, but there are unpredictable peaks in sudden volume changes and are clipped with normaliced curves.

After a DRC film standard (with a theoretic max output -20 dB) is sure amplify +10 dB, but some sources go to 0 dB and others remains at -10 dB or less.

For ac3 decode, this problem (Normalize don't work after a DRC based in Sox filter), and don't now Dialog Normalization and DRC recommended in ac3 stream, make unusable this function.

If we need DRC decoding ac3 we can use ffdshow (with DirectShowSource). The output is equivalent to BeSweet-azid settings: -azid( -n1 -c normal)
After we can use Normalize without problems.

dimzon
1st March 2006, 17:52
@tebasuna51
brrr... seems like i realy misunderstood... maybe i need to read theoretical materials?
or i need step-by step explanation in easy english

tebasuna51
1st March 2006, 18:10
brrr... seems like i realy misunderstood... maybe i need to read theoretical materials?
or i need step-by step explanation in easy english
About peak problems or about correct method to apply DRC?

dimzon
1st March 2006, 18:15
About peak problems or about correct method to apply DRC?
About DRC itself. Sorry, I'm really far from DSP, and I even have very superfictial knowledge what is dB itself... I'm very confused, sorry..
Can you comment this post: http://forum.doom9.org/showthread.php?p=792680#post792680

tebasuna51
1st March 2006, 19:15
Can you comment this post: http://forum.doom9.org/showthread.php?p=792680#post792680
Yes is something like this. But:
"This transformation will increase volume for low-volume samples and keep volume untoched for hi-value samples."
is not exact, can be:
Low-volume increased, certain mid-range untouched and hi-volume decreased.

The Dolby defined curves are these. (http://pages.sbcglobal.net/wilsondr/ddcompprof.gif)

These curves are implemented in my initial post and can be used. But there are problems:

- The mid-range untouched is defined by Dialog Normalization in ac3 header:
the input audio (x-axis) must be attenuated before by 31 - (DialNorm) dB. For instance if DialNorm = -27 dB we need apply a Amplify(-4 dB) before use the appropriate curve.

- We don't know the appropriate curve. In ac3 stream each audio block have the needed amplify (+ or -) or don´t have nothing because this audio stream don't need DRC (option None in encoder).

- The theoretic max output is -20 dB (10% maxint, music & film standard), too low for standard audio equipments. And Normalize don't work after compand Sox function.

My first attempt to do "normalized" curves is similar to your curve: 100% (0 dB) input -> 100% output, "untouched for hi-value samples". Then I get another problem: "unpredictable peaks in sudden volume changes are clipped with normaliced curves".

To explain this problem a need a image. Maybe in other post.

dimzon
1st March 2006, 19:24
Yes is something like this. But:
"This transformation will increase volume for low-volume samples and keep volume untoched for hi-value samples."
is not exact, can be:
Low-volume increased, certain mid-range untouched and hi-volume decreased.

The Dolby defined curves are these. (http://pages.sbcglobal.net/wilsondr/ddcompprof.gif)

Hmm. Shifting this curves up we will transfer from "Low-volume increased, certain mid-range untouched and hi-volume decreased." to "Low-volume increased more, certain mid-range increased less and hi-volume untouched"...


These curves are implemented in my initial post with and can be used. But there are problems:

- The mid-range untouched is defined by Dialog Normalization in ac3 header:
the input audio (x-axis) must be attenuated before by 31 - (DialNorm) dB. For instance if DialNorm = -27 dB we need apply a Amplify(-4 dB) before use the appropriate curve.

- We don't know the appropriate curve. In ac3 stream each audio block have the needed amplify (+ or -) or don´t have nothing because this audio stream don't need DRC (option None in encoder).

- The theoretic max output is -20 dB (10% maxint, music & film standard), too low for standard audio equipments. And Normalize don't work after compand Sox function.

Brrr... Does I understand you right - you need actual mid-range magic value from AC3 header bcz this is not actual middle sound value == Int16.MaxValue/2 for Normalized audio but some another value?


To explain this problem a need a image. Maybe in other post.
Yes, picture, please!!!

dimzon
1st March 2006, 19:37
- The theoretic max output is -20 dB (10% maxint, music & film standard), too low for standard audio equipments. And Normalize don't work after compand Sox function.
Just one stupid question. Dosn't theoretic max output is -20 dB become actual max output is -20 dB when we using normalized audio as input? In this case (predictable max output) we doesn't need normalize AFTER, we must just Amplify to transfer actual max output is -20 dB to good value (i doesn't know wich value is equal to maxint for 16bit audio)

tebasuna51
1st March 2006, 20:18
Brrr... Does I understand you right - you need actual mid-range magic value from AC3 header bcz this is not actual middle sound value == Int16.MaxValue/2 for Normalized audio but some another value?
You can see in the picture. The mid-range is the linear part (1:1) in the curve and we need know DialNorm to apply the linear part to dialog values.

Imagine you have the dialog at -10 dB and apply the curve directly (20:1 near horizontal line), then the dialog are distorted. If you apply before -21 dB the dialog go to linear part and is not distorted (output at -31 dB).

Well, I don't like this obsolete Dolby system based in normalize the audio dialog at -31 dB, but ... work so.
The goal is maintain constant the volume across any source, but don't work because cheap audio equipment don't support this wide dynamic range and other sources (mp3, CD Audio, commercials in TV, ...) works with narrow dynamic range near the 0 dB.

tebasuna51
1st March 2006, 20:22
Just one stupid question. Dosn't theoretic max output is -20 dB become actual max output is -20 dB when we using normalized audio as input? In this case (predictable max output) we doesn't need normalize AFTER, we must just Amplify to transfer actual max output is -20 dB to good value (i doesn't know wich value is equal to maxint for 16bit audio)
I say:

"After a DRC film standard (with a theoretic max output -20 dB) is sure amplify +10 dB, but some sources go to 0 dB and others remains at -10 dB or less."

This is the peaks problem, be patient.:)

dimzon
1st March 2006, 21:30
After a DRC film standard (with a theoretic max output -20 dB) is sure amplify +10 dB, but some sources go to 0 dB and others remains at -10 dB or less.
Does it mean

Normalize()
DrcFilmStandard()


can go to 0 dB

tebasuna51
2nd March 2006, 02:26
"After amplify +10 dB"

For instance, my test_channels.ac3 (only voice) after
Normalize()
DrcFilmStandard()
Amplify(10 dB)

go to 0 dB (can't accept further amplify without clipping)

dimzon
2nd March 2006, 08:05
@tebasuna51
ok, i realize the problem, seems like i need to perform modification of NicAc3Source in order to implement build-in DRC control...
Shit, I hate C/C++ and I have not enought knowledge about AC3...
Will You help me with theory/math ?

Edit: Will try to asc Nic first: http://forum.doom9.org/showthread.php?t=108066

tebasuna51
2nd March 2006, 13:48
ok, i realize the problem, seems like i need to perform modification of NicAc3Source in order to implement build-in DRC control...
I think this is the correct way.

Maybe is easy modify NicAudio.dll:

From a52dec-0.7.4/doc/liba52.txt
Dynamic range compression
-------------------------

void a52_dynrng (a52_state_t * state,
sample_t (* call) (sample_t, void *), void * data);

This function is purely optional. If you dont call it, liba52 will
provide the default behaviour, which is to apply the full dynamic
range compression as specified in the A/52 stream. This basically
makes the loud sounds softer, and the soft sounds louder, so you can
more easily listen to the stream in a noisy environment without
disturbing anyone.

If you do call this function and set a NULL callback, this will
totally disable the dynamic range compression and provide a playback
more adapted to a movie theater or a listening room.

If you call this function and specify a callback function, this
callback might be called up to once for each block, with two
arguments: the compression factor 'c' recommended by the bitstream,
and the private data pointer you specified in a52_dynrng(). The
callback will then return the amount of compression to actually use -
typically pow(c,x) where x is somewhere between 0 and 1. More
elaborate compression functions might want to use a different value
for 'x' depending wether c>1 or c<1 - or even something more complex
if this is what you want.

From NicAudio/m2_audio_ac3.cpp
bool m2AudioAC3Source::DecodeFrame() {
...
// Dynamic range compression
a52_dynrng(State, 0, 0);
AFAIK NicAudio cancel the default Dynamic range compression from liba52.
For test pourpose, only if you comment the a52_dynrng line and compile NicAudio.dll, I can test if default DRC from liba52 works ok.

After we can add a new parameter to NicAc3Source call, like DRC true/false and use:
if (!DRC) { a52_dynrng(State, 0, 0) };

dimzon
2nd March 2006, 14:10
try http://www.mytempdir.com/487451

dimzon
2nd March 2006, 14:41
btw
now I have perfect sample how to write AviSynth input audio plugins... Maybe I can join yet another MPASource into nicaudio and even add somethig like faadSource ;)

tebasuna51
2nd March 2006, 16:40
try http://www.mytempdir.com/487451
Work!

Wait for complete test ...

dimzon
2nd March 2006, 16:59
btw
there are
// Dynamic range compression
dts_dynrng(State, 0, 0);

in m2audio_dts.cpp

what does you know about DRC for DTS ?

tebasuna51
2nd March 2006, 17:56
what does you know about DRC for DTS ?
Sorry, I don't know DTS format.

First test with new NicAc3Source: the DRC info in ac3 stream is applied, now work exactly like BeSweet -azid( -c normal )

Seems OK.

dimzon
2nd March 2006, 19:23
Sorry, I don't know DTS format.
Ok

First test with new NicAc3Source: the DRC info in ac3 stream is applied, now work exactly like BeSweet -azid( -c normal )

Seems OK.
Very well. Any idea how to implement other DRC modes?

tebasuna51
2nd March 2006, 21:26
Very well. Any idea how to implement other DRC modes?
AFAIK liba52 only apply the attenuation found in ac3 stream, don't have any algorithm to do DRC, remember (previous post):
"If you call this function and specify a callback function, this callback might be called up to once for each block, with two arguments ..."

But I think is not necesary, now work like ffdshow, Cyberlink PowerDVD 6, ...

dimzon
2nd March 2006, 22:20
But I think is not necesary, now work like ffdshow, Cyberlink PowerDVD 6, ...
I really want to cover all besweet functionality. Seems like I must write some custom callback to realize additional DRC modes. Can You help me to write it (i need math and valid coefficients)

Talking about DRC in DTS, maybe it's possible to use same function in it? Does You have DTS samples for testing (i have not)

dimzon
3rd March 2006, 12:06
http://forum.doom9.org/showthread.php?p=793573#post793573

tebasuna51
3rd March 2006, 13:08
I really want to cover all besweet functionality.
Nice. The most important for me is accept any kind of wav input and split in mono waves (to send after to good ac3 encoders).
Maybe also cover WaveWizard functionality accepting wav > 4GB and WAV_FORMAT_EXTENSIBLE headers.

Seems like I must write some custom callback to realize additional DRC modes. Can You help me to write it (i need math and valid coefficients)
I think you need not easy algorithms. Just I learn a few with Compand Sox function and there are involved parameters like attack, dekay, delay, ... and I don't understand very much how work. See this image (http://www.mytempdir.com/489584)

I think is not a priority, with your new NicAudio.dll is enough for MeGUI.

About NicAc3Source I detect a bug decoding 5.0 (without LFE) ac3 streams. Make a wav 6 channels (with LFE empty) but wrong mapping C_SL_FR_FL_SR_LFE, need Getchannels(4,3,1,6,2,5).

Talking about DRC in DTS, maybe it's possible to use same function in it? Does You have DTS samples for testing (i have not)
I have a swedish test channel but decoded with NicAudio, foobar, Tranzcode or ffdshow (with errorrs) is always the same. Maybe don't have DRC (optional in DTS, like in Ac3).
I can't test DTS because I don't own a DTS encoder. Maybe other user can test your new NicAudio.dll.

tebasuna51
3rd March 2006, 14:23
I still have problems with BeHappy new version.

Using like input this Test1.avs (3 stereo wav's to wav 6 channels)
flfr = WavSource("g:\Test_FL_FR1.wav")
fl = GetChannel(flfr, 1)
fr = GetChannel(flfr, 2)
clfe = WavSource("g:\Test_C_LFE1.wav")
c = GetChannel(clfe, 1)
lfe = GetChannel(clfe, 2)
slsr = WavSource("g:\Test_SL_SR1.wav")
sl = GetChannel(slsr, 1)
sr = GetChannel(slsr, 2)
MergeChannels(fl, fr, c, lfe, sl, sr)

With BeHappy v0.1.0.30756 (20051229) work fine, but with BeHappy v0.1.0.28107 (20060206) don't work, I get:
Starting job Test1.avs->Test.wav
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: BeHappy.AviSynthException: AudioStreamSource
at BeHappy.Encoder.encode()

Please, if you need make a new BeHappy version for include NicAudio options, and is easy to modify:
- Don't include EnsureVBRMP3Sync(), or make it optional with a checkbox in Tweak section.
- Don't include the two AudioDubEx() if the checkbox Split is not marked.
- Accept negative values in Amplify.

Thanks.

dimzon
3rd March 2006, 15:16
Maybe also cover WaveWizard functionality accepting wav > 4GB and WAV_FORMAT_EXTENSIBLE headers.
Isn't possible to accept such files just using DirectShowSource instead WavSource?

split in mono waves (to send after to good ac3 encoders).
I'm planning to perform some reverse-engineering of Dolby AC3 encoder Dll's in order to write my own CLI frontend for it (acceptable to encode 6ch WAV directly) but I plan to do it much more later...


I think you need not easy algorithms. Just I learn a few with Compand Sox function and there are involved parameters like attack, dekay, delay, ... and I don't understand very much how work. See this image (http://www.mytempdir.com/489584)
I'm just talking about standart DRC in addition to normal: Neavy/Normal/Light/Inverse


About NicAc3Source I detect a bug decoding 5.0 (without LFE) ac3 streams. Make a wav 6 channels (with LFE empty) but wrong mapping C_SL_FR_FL_SR_LFE, need Getchannels(4,3,1,6,2,5).
Seems like I found bug:
case A52_3F2R:
LFE = Flags && A52_LFE;
DecFlags = A52_3F2R;
if (LFE)
DecFlags |= A52_LFE;
ChannelCount = 6;
break;

In this case LFE variable is always = true.
Replaced to
LFE = 0!=(Flags &A52_LFE);
Same for DTS, try this binary: http://www.mytempdir.com/489796

I still have problems with BeHappy new version.
I have found same problem just 3 days ago. Unfortunally I can't say nothing about it except it's internal AviSynth problem (exeption is thrown by AviSynth) and it will occured sometimes (not every time). Try to open yor avs script using Import, not WavSource...


Please, if you need make a new BeHappy version for include NicAudio options, and is easy to modify:
- Don't include EnsureVBRMP3Sync(), or make it optional with a checkbox in Tweak section.
- Don't include the two AudioDubEx() if the checkbox Split is not marked.
- Accept negative values in Amplify.

All Your suggestions will be implemented in next build BUT I'm not planning to release new BeHappy version during at least next 2 weeks, sorry...

dimzon
3rd March 2006, 16:47
Sorry, I don't know DTS format.

The DTS Coherent Acoustics standard (ETSI 102 114 v1.2.1), as published by the ETSI, is available here (http://pda.etsi.org/pda/queryform.asp) (search for DTS Coherent Acoustics)

tebasuna51
5th March 2006, 05:00
The DTS Coherent Acoustics standard (ETSI 102 114 v1.2.1), as published by the ETSI, is available here (http://pda.etsi.org/pda/queryform.asp)[/COLOR][/B])
After read this I check my test.dts and is encoded without DRC.

Then if anybody want do the test before a new BeHappy version support this issue, can create a new file in BeHappy folder:

NicAudioDRC.extension
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioSource Name="NicAc3SourceDRC" UniqueID="79c27720-ab72-11da-a746-0800200c9a66">
<Script>NicAc3Source("{0}", DRC=1)</Script>
<SupportedFileExtension>ac3</SupportedFileExtension>
</AudioSource>
<AudioSource Name="NicDtsSourceDRC" UniqueID="880150e0-ab72-11da-a746-0800200c9a66">
<Script>NicDtsSource("{0}", DRC=1)</Script>
<SupportedFileExtension>dts</SupportedFileExtension>
</AudioSource>
</BeHappy.Extension>
With this there are two new input source methods:
NicAc3SourceDRC
NicDtsSourceDRC

The ac3 method work fine, and the bug with ac3 5.0 is also corrected.

Isn't possible to accept such files just using DirectShowSource instead WavSource?
Yes, configuring ffdshow Audio Decoder -> Codecs -> WAV -> All supported, I can open wav 32bit float, WAVE_FORMAT_EXTENSIBLE, ... (still not tested > 4 GB).
Is not a easy way, because I need uncheck other functions used for play and after do the conversion recheck them, but work.

I have found same problem just 3 days ago. Unfortunally I can't say nothing about it except it's internal AviSynth problem (exeption is thrown by AviSynth) and it will occured sometimes (not every time). Try to open yor avs script using Import, not WavSource...
Yes sometimes work. If you think the problem is solved using Import maybe we need a new source method:

AvsSource.extension
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioSource Name="AvsSource" UniqueID="0aa78710-aafd-11da-a746-0800200c9a66">
<Script>Import("{0}")</Script>
<SupportedFileExtension>avs</SupportedFileExtension>
</AudioSource>
</BeHappy.Extension>
and disable .avs like extension for WavSource.

I'm planning to perform some reverse-engineering of Dolby AC3 encoder Dll's in order to write my own CLI frontend for it (acceptable to encode 6ch WAV directly) but I plan to do it much more later...
Great notice. We need a good free ac3 encoder better than ffmpeg, ac3enc, ...

But split in mono wavs is also needed for other reasons and I think is really easy to do, don't forget this please.

And at last, but not the last, thanks for accept my suggestions for new BeHappy release.

dimzon
5th March 2006, 10:31
@tebasuna51
does you tested new binary (5.0 issue)?

scharfis_brain
5th March 2006, 10:58
Without having read the whole thread: is nicaudio capable of putting out more than 16bit audio sampling precision?

tebasuna51
5th March 2006, 11:22
does you tested new binary (5.0 issue)?
Yes:
"The ac3 method work fine, and the bug with ac3 5.0 is also corrected."

tebasuna51
5th March 2006, 11:38
Without having read the whole thread: is nicaudio capable of putting out more than 16bit audio sampling precision?
Ac3 is a old codec and, AFAIK, internal precision is not greater than 16 bit, you can convert the output to any precision for further conversions.

scharfis_brain
5th March 2006, 12:29
internal precision 'may' be only 16bit, but due to the internal dynamic range control of AC3 (in German it is "Hüllkurve") you won't loose precision in silent scenes when decoding to 24bit.

Also you may decode every psycoacoustic coding to arbitary bit depths because of its frequency nature. Of couse this precision is faked a bit, but it is much better than going from 16bit to 24 (or higher) bit after decoding.

dimzon
5th March 2006, 14:08
Yes:
"The ac3 method work fine, and the bug with ac3 5.0 is also corrected."
Oh sorry, thanx a lot for testing. Does it mean I can do new stable release of NicAudio?

Talking about AC3 compression - I have not plans to do it right now but can you tell me wich AC3 encoder does You prefer?

tebasuna51
5th March 2006, 14:44
Does it mean I can do new stable release of NicAudio?
Yes for me. Maybe any dts test, but seems dts_dynrng work like the equivalent ac3.

Talking about AC3 compression - I have not plans to do it right now but can you tell me wich AC3 encoder does You prefer?
About free encoders you can see: http://forum.doom9.org/showthread.php?p=759503#post759503

- DarkAvenger (HeadAC3he) seems solve the low volume issue (50%) in their ac3enc.dll.

- DRC info must be generated in ac3 stream.

- Others parameters: DialNorm, MixLevels, ... must be user defined.

With non-free encoders, I only test the old and slow Sonic Foundry SoftEncode.

dimzon
7th March 2006, 14:45
@tebasuna51
FYI
fresh NicAudio http://forum.doom9.org/showthread.php?t=108112
fresh BassAudio http://forum.doom9.org/showthread.php?t=108254

Can You play with / test BassAudio ?

NorthPole
7th March 2006, 15:12
@tebasuna51

I read your post in this thread http://forum.doom9.org/showthread.php?p=759503#post759503

Thanks for the work...very interesting. What program did you use to test the ac3 output levels?

Did you use wavewizard with the dark avenger ac3enc.dll or were you using the headAC3he frontend?

tebasuna51
7th March 2006, 18:54
What program did you use to test the ac3 output levels?
We need decode to wav the ac3 stream with BeHappy-NicAudio or BeSweet-Azid without DRC, ota-normalize, downmix,...
After any wav editor Audacity, Goldwave, Audition...

Did you use wavewizard with the dark avenger ac3enc.dll or were you using the headAC3he frontend?
The HeadAC3he frontend is needed because have the Gain parameter. The ac3enc.dll from HeadAC3he don't work with WaveWizard, but the used is supplied for Dark Avenger to Johnman.

AFAIK the problem is how send this Gain parameter to ac3enc.dll, because is applied internally.

NorthPole
8th March 2006, 01:19
@tebasuna51

Thanks for the reply. Sorry about the off thread topic. I have been doing the same as you. Decoding to wave and checking the levels with cooledit. I have been using ffmpeg from http://celticdruid.no-ip.com/xvid/

@Dimzon or maybe @Dayvon

The new logo looks good.

I'll try the bassAudio decoder and let you know if I have any problems.

tebasuna51
10th March 2006, 03:16
BASSAUDIO TEST

Seems work ok with mp2, mp3, ogg, wma and stereo aac (LC, HE and PS)
Also work with ac3 5.1 (without DRC), 6 channel ogg and wma.
And with wav stereo and multichannel int16, int32, float32 with canonical or WAVE_EXTENSIBLE_FORMAT headers.

Now is not necesary DirectShowSource for wav, wma, ogg or stereo aac files.

PROBLEMS

With ac3 2.0 make a wav 6 channels R_e_e_L_e_e (e=empty channel).

With aac 5.1 sometimes make a wav6 with all channels equal to a distorted Center channel, and sometimes:
Starting job Test6.aac->Test6.wav
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at BeHappy.AviSynthClip.dimzon_avs_getaframe(IntPtr avs, IntPtr buf, Int64 sampleNo, Int64 sampleCount)
at BeHappy.Encoder.encode()

or

Error: System.NullReferenceException: Object reference not set to an instance of an object.
at BeHappy.AviSynthClip.dimzon_avs_destroy(IntPtr& avs)
at BeHappy.AviSynthClip.System.IDisposable.Dispose()
at BeHappy.Encoder.encode()

dimzon
10th March 2006, 08:33
PROBLEMS

With ac3 2.0 make a wav 6 channels R_e_e_L_e_e (e=empty channel).

With aac 5.1 sometimes make a wav6 with all channels equal to a distorted Center channel...

Hm. Thanx a lot, seems like this is BASS problem



and sometimes
How often does this bug reproducable. Does it only for 5.1 AAC decoding via bassAudio?

dimzon
10th March 2006, 12:01
With aac 5.1 sometimes make a wav6 with all channels equal to a distorted Center channel, and sometimes
Can you provide small samples to send it to BASS developers?

dimzon
10th March 2006, 13:25
I'm planning to write AudioLimiter plugin

output = tahh(input*factor) / tanh(factor)

http://img64.imageshack.us/img64/3035/tmp1141993187p629f25xl.gif
factor = 1
factor = 1.5
factor = 2
factor = 3
factor = 4


Does anybody know another sutable formulas?

dimzon
10th March 2006, 15:31
Yet another filter to play with / test - AudioLimiter
http://forum.doom9.org/showthread.php?t=108470

tebasuna51
10th March 2006, 16:45
Can you provide small samples to send it to BASS developers?
Here is: Test6HE.7z (http://www.mytempdir.com/506506)
The source Test6HE.aac is decoded ok by Foobar v0.8.3 for instance.

dimzon
10th March 2006, 17:53
Here is: Test6HE.7z (http://www.mytempdir.com/506506)
The source Test6HE.aac is decoded ok by Foobar v0.8.3 for instance.
please test this binary with your AAC
http://www.un4seen.com/filez/2/bass_aac.dll

tebasuna51
10th March 2006, 23:08
please test this binary with your AAC
http://www.un4seen.com/filez/2/bass_aac.dll
Sorry, same output.
Works for you?

gino25
11th March 2006, 14:39
i try to transcode a file wav (44100 hz, mono) into a aac+ 16kbps.

In [1] i select my wav file as "Wavsource", in [2] and [3] all are empty. In [4] i select aac+ 16kbps as adts aac

but i have this error

Starting job bri.wav->bri.aac
Error: BeHappy.AviSynthException: Script error: there is no function named "AudioDubEx"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

gino25
11th March 2006, 14:39
ah this is the avc generated by behappy

########################################
#Created by BeHappy v0.1.0.28107
#Creation timestamp: 11/03/2006 14.39.50
########################################
#Source FileName:C:\Documents and Settings\Enea\Desktop\bri.wav
#Target FileName:C:\Documents and Settings\Enea\Desktop\bri.aac
########################################

########################################
# [Source: WavSource]
########################################
WavSource("C:\Documents and Settings\Enea\Desktop\bri.wav")

EnsureVBRMP3Sync() # Some black magic to avoid desync

########################################
# [BeHappy: Create fictive 1000fps video for triming]
########################################
AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=1000), last)

########################################
# [Encoder: Coding Technologies AAC+ @ 16 kbps as ADTS AAC]
########################################


########################################
# [BeHappy: Kill video]
########################################
AudioDubEx(Tone(), last)

dimzon
11th March 2006, 15:09
@gino25
instal AviSynth 2.56

gino25
12th March 2006, 17:38
@gino25
instal AviSynth 2.56

thank you

3dsnar
14th March 2006, 07:26
I'm planning to write AudioLimiter plugin

output = tahh(input*factor) / tanh(factor)

http://img64.imageshack.us/img64/3035/tmp1141993187p629f25xl.gif
factor = 1
factor = 1.5
factor = 2
factor = 3
factor = 4


Does anybody know another sutable formulas?
Dimzon, I will send you a code for a limiter constructed from a sine glued with a linear section. It also has a limiting
knee that can be adjusted. Morover, this always limits to [-1, 1] range and up to some signal level is linear (no harmonic distortion).

dimzon
15th March 2006, 15:49
@tebasuna51
Please, test my AudioLimiter filter http://forum.doom9.org/showthread.php?t=108470

What does You think, does it acceptable to use it for DRC?

tebasuna51
16th March 2006, 03:52
@tebasuna51
Please, test my AudioLimiter filter http://forum.doom9.org/showthread.php?t=108470

What does You think, does it acceptable to use it for DRC?
I'm not a expert in DRC, but I think if DRC algorithms use parameters like attack and dekay is for good reasons.

A instant volume conversión with simple math formulas produce distort output like you can see in this image. (http://www.mytempdir.com/519521)

With a frequency analysis you can see the audible overtones, not present using more sophisticated algorithms:
Frequency Analysis. (http://www.mytempdir.com/519529)

For me the DRC is only useful with ac3 or dts sources, and this work ok with your modified NicAaudio.dll. For others uses the compand Sox function still work better than this AudioLimiters.

3dsnar
16th March 2006, 07:08
I'm not a expert in DRC, but I think if DRC algorithms use parameters like attack and dekay is for good reasons.

A instant volume conversión with simple math formulas produce distort output like you can see in this image. (http://www.mytempdir.com/519521)

With a frequency analysis you can see the audible overtones, not present using more sophisticated algorithms:
Frequency Analysis. (http://www.mytempdir.com/519529)

For me the DRC is only useful with ac3 or dts sources, and this work ok with your modified NicAaudio.dll. For others uses the compand Sox function still work better than this AudioLimiters.
Tebasune51 is right. The limiter (or also called soft clipper) is usually used to make the hard clipping effect more listenable. It is a useful tool, so it is good to have it. It also can be viewed as the simplest form of compressor.
---------------------------
However, for compressing the amplitude of the signal, usually a dynamic compressor is used (with the attack phase, release phase, compression ratio, and other parameters).
---------------------------
Dimzon, I have implemented in the past a very high quality (very low harmonic distortions) compressor for some pro-audio applications, and the code belongs to me (personally). I will have to just clean it a bit and will provide you with it. So you will be able to use it as open source, or in whaterver way you prefer. So I will get back with this to you soon.

dimzon
16th March 2006, 09:31
@3dsnar
Thanx a lot

@3dsnar, @tebasuna51
http://en.wikipedia.org/wiki/Amplitude_compression
I'm just trying to reproduce BeSweet's custom boost modes (LigH/Tera/DSPGuru) - there are no attac/decay parameters for it, seems like they are just limiters. Custom boost modes + additional AC3 DRC is last to cover all BeSweet functionality...

tebasuna51
16th March 2006, 17:38
I'm just trying to reproduce BeSweet's custom boost modes (LigH/Tera/DSPGuru) - there are no attac/decay parameters for it, seems like they are just limiters. Custom boost modes + additional AC3 DRC is last to cover all BeSweet functionality...
Really I never use the Boost BeLight section. I make some test with default values in BeLight:
- DSPguru method -boost( /b2=4 /l=0.95 ): Broken for input values > -7.16 dB. Don't need emulate.
- Tera method -boost( /b3=5 /l=0.95 ): low range values very amplified. Not similar behavior with your AudioLimiter functions.
- LigH method -boost( /b=3 /l=0.95 ): This method can be emulated with ExpotencialLimiter(2.4) with light differences.
All values are peak (-) dB

Met\Input 46.6 40.8 36.0 31.2 26.4 21.6 16.8 12.0 10.45 7.2 2.40
--------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- -----
Tera_norm 30.3 25.6 21.1 16.8 12.7 9.1 6.0 3.5 2.85 1.7 0.45
LigH_norm 37.3 31.2 26.4 21.6 16.9 12.2 7.7 3.9 2.85 1.2 0.14
Expot 2.4 37.6 32.6 27.5 22.2 16.8 11.4 6.7 3.2 2.44 1.2 0.24
Expot 2.0 39.0 34.1 29.1 23.9 18.6 13.4 8.5 4.6 3.60 1.9 0.43
Expot 3.0 35.6 30.5 25.3 19.9 14.3 8.9 4.6 1.9 1.33 0.6 0.10

dimzon
16th March 2006, 17:58
@tebasuna51
Thanx a lot

Does anybody know good free math-modeling software (free MathLab analogue)?

dimzon
16th March 2006, 18:02
found very interesting site
http://musicdsp.org/

dimzon
16th March 2006, 18:18
Yet another fine link http://www.dspguru.com/sw/opendsp/mathclo2.htm

dimzon
16th March 2006, 18:29
fine, found some free matlab replacement
http://www.scilab.org/

will try it tonight

dimzon
17th March 2006, 00:17
Ok, second name for this Effect is Wavesharper
There are big amount of such formulas
http://musicdsp.org/archive.php?classid=4#207
http://www.google.com/search?lr=&ie=UTF-8&oe=UTF-8&q=Waveshaper

and finally found good approximation
http://img217.imageshack.us/img217/1803/testnew6pc.png
yellow is tera
pink is .55 * Math.Atan(6*x)

sasam
18th March 2006, 12:17
Hi dimzon,
That's a nice logo for behappy you have, looking like Google...
What do you think about this:
http://img112.imageshack.us/img112/6431/behappy4nd.png

tebasuna51
18th March 2006, 12:21
About new Bass_ac3.dll (http://www.maresweb.de/forums/index.php?showtopic=98#)
I don't know if you need make some modification to use with BeHappy, but a simple dll replace produce this wav output:

- Ac3 2.0: ok now
- Ac3 5.0: wrong channelmapping C_SL_FR_FL_SR_e (empty)
- Ac3 5.1: same wrong channelmapping C_SL_FR_FL_SR_e (empty), LFE missing.

I know bass_ac3 is not necessary for BeHappy (you have NicAudio), but bass_aac is really interesting and I hope maresweb developers can help us.

dimzon
23rd March 2006, 11:43
BeHappy in TOP 5 @ GotDontNet !

http://www.gotdotnet.com/workspaces/directory.aspx

http://img67.imageshack.us/img67/7726/bh0pz.th.png (http://img67.imageshack.us/img67/7726/bh0pz.png)

Congratulations :cool: :cool: :cool:

shon3i
23rd March 2006, 12:02
Congratulations to you dimzon and rockaria for very good app

3dsnar
23rd March 2006, 12:15
Congrats!!
Keep up the good work!

mxms
25th March 2006, 03:51
My appologies, I'm new to this thing but here is what I'm trying to do.

I have a 5.1 AAC file I converted to WAVE in 6 channels. I'm now trying to use BeHappy to conver from WAVE - AC3. Which when I try I get:


Starting job Track2.wav->Track2.ac3
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 448 "C:\Documents and Settings\Nick\Desktop\ergo2\Track2.ac3"
Error: System.ApplicationException: Can't start encoder: The system cannot find the file specified ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()


What does it mean "The system cannot find the file specified ---> System.ComponentModel.Win32Exception" and how do I fix it?

What do I need to get this working properly?

tebasuna51
25th March 2006, 10:31
Maybe you need the encoder
ffmpeg (http://kurtnoise.free.fr/ffmpeg.7z)
uncompressed in BeHappy folder.

dimzon
29th March 2006, 09:06
future plans

Hi!
Since BeHappy is experimental application I decide to perform some experiments.
I'm planning to perform complete GUI redesign using Inductive UI paradigm (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/iuiguidelines.asp)
I'm planning to use HTMLayout (http://www.terrainformatica.com/htmlayout/) to create multilanguage skinable UI
I'm planning to use TIScript (http://www.terrainformatica.com/tiscript/) (JavaScript-like) to provide ability to create more complex and flexible extensions

dimzon
29th March 2006, 14:53
Ok, new GUI layout prototype is here
http://www.mytempdir.com/553286

please, post your comments and suggestions

sasam
29th March 2006, 15:25
It looks nice, but there is nothing wrong the old one. This one looks like some newbie "1click encoder".
In the old one we can see all in one screen and in the new one we have to click on the task to open it.

New users would probably love the new interface but I don't know about experienced...;)

3dsnar
29th March 2006, 15:38
I like it.
Very good for new users indeed.
Experienced users know already how to use it,
so it should not discourage them to continue using this app.

dimzon
29th March 2006, 15:43
New users would probably love the new interface but I don't know about experienced...;)
As I said before I'm planning to make BeHappy skinable - there will be special skin wich will look & feel mostly like current BeHappy

Unfortunally I'm not a designer so I need feedback & suggestions.

Please, post here Your ideas, draft design and sketches - everything are welcome ;)

Let's create ultimate easy-to-use interface together.

sasam
29th March 2006, 16:32
Here is a fast sketch I made... What do you think?

http://img149.imageshack.us/img149/6679/behappy0aa.png

dimzon
29th March 2006, 16:36
Here is a fast sketch I made... What do you think?

http://img149.imageshack.us/img149/6679/behappy0aa.png

Thanx for participation.
Unfortunally Queue is too narrow - there are many columns in Queue list. I believe we must make Queue 100% width...
And do not forget - we need some place for progress bar and log...

sasam
29th March 2006, 16:50
Maybe you could put expand button or something:) :

http://img138.imageshack.us/img138/802/behappy2qs.th.png (http://img138.imageshack.us/my.php?image=behappy2qs.png)

Users don't have to see all columns...(Only when they click expand button) As you said it is supposed to be for easy using. ;)

dimzon
29th March 2006, 16:53
Maybe you could put expand button or something:) :

http://img138.imageshack.us/img138/802/behappy2qs.th.png (http://img138.imageshack.us/my.php?image=behappy2qs.png)

Hmmm... Looks better.
So let's wait a little, maybe somebody provide another sketches...

dimzon
29th March 2006, 17:19
Just addition - current BeHappy implementation opens Decoder/DSP/Encoder configuration in modal dialog
In new UI layout I want to place it @ main form to avoid ModalDialogs

dimzon
29th March 2006, 17:57
Queue
http://img225.imageshack.us/img225/738/11115ce.th.png (http://img225.imageshack.us/my.php?image=11115ce.png)

stax76
29th March 2006, 18:39
How about a side bar like in so many MS UIs (e.g. 'Windows Movie Maker'), this gives you much more room.

AW-
31st March 2006, 20:18
Hello
I was wondering if BeHappy - AviSynth-based audio transcoding tool would help me with this problem.
I had made a backup of one of my Music Dvd's and I must have chose 6ch or dts and my brother cracked the original dvd taking it out of the case it came in, So the origanal is broke (cheap plastic) now i would like to encode the dts back to normal if i can, so i can play it without a digital reciever.
Thanks

NorthPole
2nd April 2006, 01:33
Hmmm... Looks better.
So let's wait a little, maybe somebody provide another sketches...

If you're looking for input, microsoft has a conversion utility included in some versions of xp. It is a 4 step process consisting of the following images:

step 1-

http://img216.imageshack.us/my.php?image=step10iu.png

step 2-

http://img90.imageshack.us/my.php?image=step23jc.png

step 3-

http://img118.imageshack.us/my.php?image=step37af.png

step 4-

http://img90.imageshack.us/my.php?image=step41ji.png

Just another option for you... Although I do like the current format better because it is a little less "newbie" like sasam said.

dimzon
2nd April 2006, 09:22
@NorthPole
Thanx, looking good for newbie

Mr_Odwin
5th April 2006, 09:34
Having looked at the downmixing that BeHappy does for 5.1 to stereo I have a question.

fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
c = GetChannel(a, 3)
lfe = GetChannel(a, 4)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l_sl = MixAudio(fl, sl, 0.2929, 0.2929)
c_lfe = MixAudio(lfe, c, 0.2071, 0.2071)
r_sr = MixAudio(fr, sr, 0.2929, 0.2929)
l = MixAudio(l_sl, c_lfe, 1.0, 1.0)
r = MixAudio(r_sr, c_lfe, 1.0, 1.0)
return MergeChannels(l, r)

I have a 5.1 ac3 file and according to the Avisynth documentation (http://www.avisynth.org/GetChannel) the front center channel should be channel 2, but this doesn't seem to be the case and the above BeHappy generated code seems to be right. (If I do downmixing using the channel mapping from the documentation I get no dialogue in the resulting right stereo channel.)

Why is this?

dimzon
5th April 2006, 10:03
I have a 5.1 ac3 file and according to the Avisynth documentation (http://www.avisynth.org/GetChannel) the front center channel should be channel 2, but this doesn't seem to be the case and the above BeHappy generated code seems to be right. (If I do downmixing using the channel mapping from the documentation I get no dialogue in the resulting right stereo channel.)

Why is this?

Seems like NicAc3Source has build-in channel mapper wich map output to WAV 5.1 channel order
And any DirectShow decoder (by definition) must perform same mapping too

Actually I believe every valid multichannel decoder must provide WAV 5.1 channel order

Mr_Odwin
5th April 2006, 10:31
Cool. But it then seems a little redundant to mention other channel mappings in the documentation. Odd.
You've answered my question though.:thanks:

dimzon
5th April 2006, 12:59
Cool. But it then seems a little redundant to mention other channel mappings in the documentation. Odd.
You've answered my question though.:thanks:

Anycase You must look @ concrete decoder documentation (what channel mapping does it produce) rather this abstract documentation

thuongshoo
11th April 2006, 04:39
hi ! I want to use winamp encoder and but this encoder can't make a HC file , how can I do ?
I used Nero7WA but error , Perhaps I don't have nero7WA.exe .I searched it by google.com but I have no result . Where do I download it ?
Thanks !

chros
14th April 2006, 20:55
Ok, new GUI layout prototype is here
http://www.mytempdir.com/553286

please, post your comments and suggestions

I don't like the concept of these guis. (But this shouldn't put you out of concei :) ) . It's so Microsoft-ish ... which is (I think): the user shouldn't know how the app is working (of course it's not relying to you). The user must clicking so much to achive the result. (And these guis take time away from the developer !!!)
I prefer your app that way it was: simple, it stand in full view (!).

And last: if you remember the first public release of MPC, Gabest said: "feature: - no skin support" !!! :)

Keep up the good work !

thuongshoo
15th April 2006, 17:08
Behappy say that "... can not configure bsn ! .."
I don't know !. Belight still works well with bsn.dll which Behappy can't .
Can you give me your good bsn.dll ? thank you !
me email : yuyoonshoo@gmail.com

shon3i
15th April 2006, 17:50
You don't need to copy bsn.dll to behappy folder, than Aac.dll aacenc32.dll from belight or nero comon files folder.

thuongshoo
26th April 2006, 02:53
Thank shon3i ! :D
Can Nero encoder make a He-llc- file ?
http://img125.imageshack.us/img125/2651/aache0wx.th.png (http://img125.imageshack.us/my.php?image=aache0wx.png)

dimzon
26th April 2006, 13:31
Thank shon3i ! :D
Can Nero encoder make a He-llc- file ?
http://img125.imageshack.us/img125/2651/aache0wx.th.png (http://img125.imageshack.us/my.php?image=aache0wxpng)
This is mediaInfo bug, use Foobar0.9 instead

thuongshoo
28th April 2006, 11:58
I installed Foobar but What must I do ?
Foobar can't open my wav file. It is a wav file which made by VD. Foobar can't also display properties of media file
Gspot also says like MediaInfo ..

dimzon
5th May 2006, 10:14
BeHappy extension to support this (http://forum.doom9.org/showthread.php?p=823788&posted=1#post823788)perfect cli encoder is uploaded @ BeHappy Workspace @ gotDotNet (http://gotdotnet.com/Workspaces/Workspace.aspx?id=1bb59ddf-901b-43a5-bd54-b0999e8e223e)

shon3i
5th May 2006, 10:24
dimzon what about 2pass and other options like choosing betwen LC,HE,HEv2.

dimzon
5th May 2006, 10:52
dimzon what about 2pass and other options like choosing betwen LC,HE,HEv2.
for 2pass I need additional featiures (http://forum.doom9.org/showthread.php?p=823740#post823740) in Nero binary
other options working in automatic implicit mode, I will add explicit options much later (it reques some coding for me and I'm too busy IRL now)

dimzon
5th May 2006, 11:11
2 ALL
I'm planing to release fresh BeHappy beta in this month.
No new GUI yet (I'm too busy to do it) but new .NET Runtime (2.0) + some fixes/improvements

Future plans

Disable .avs like extension for WavSource
Separate source for .avs files (via Import)
Make EnsureVBRMP3Sync optional with a checkbox in Tweak section
Don't include the two AudioDubEx() if the checkbox Split is not marked
Move Amplify from Tweak section to DSP section, accept negative values in Amplify, allow to switch between AmplifyDB and Amplify
Multipupose multi-option Source to allow tweaks in sources (NicAc3Source/NicDtsSource w/wo DRC)
ND AAC encoder - completly new & flexible configuration dialog (+removing old Nero7 AAC one based on AAC.DLL)
OggVorbis encoder - additional controls in configuration dialog for advanced settings
CT AAC encoder - completly new & flexible configuration dialog
Collect fresh 3rd-party extentions
Create All-in-One bundle including BeHappy+Extensions+Encoders ( oggenc, ffmpeg, faac, enc_aacplus {w/o winamp dll itself}, wavpack, flac, twolame, lame)+Filters (NicAudio,SoX)


If You need some fix/improvement please let me know ASAP!

tebasuna51
5th May 2006, 12:42
Nice!.
Really I don't need new GUI, I prefer all of your "Future plans" before, and:

Don't forget BassAudio, is very useful to decode ogg, wma, stereo aac, and any kind of wav's. Now, for habitual formats, only aac 5.1 need DirectShowSource.

In order to reproduce all important (for me) BeSweet's features, remember my old petition to split multichannel wav's in mono wav's.

Thanks!

dimzon
6th May 2006, 00:48
New ND AAC dialog in action
http://img522.imageshack.us/img522/5394/untitled4dp2.jpg

Kostarum Rex Persia
6th May 2006, 01:24
Very very nice, Dimzon.

Can you give me download link to newest BeHappy beta with this new ND AAC dialog? Direct link, if possible.

Thank you.

tebasuna51
6th May 2006, 01:48
To avoid the problem for wav's > 4GB and neroAacEnc
http://forum.doom9.org/showthread.php?p=823985#post823985

"I check wav's > 4GB with any value in DataLength and +36 in RiffLength and always work with neroAacEnc -ignorelength, then the problem is use same value for the two fields.

For BeHappy the solution is fill DataLength with 0xFFFFFEDC (0xFFFFFF00 - 36)."

dimzon
6th May 2006, 06:31
Very very nice, Dimzon.

Can you give me download link to newest BeHappy beta with this new ND AAC dialog? Direct link, if possible.

Thank you.
It is not complete yet, wait for 1-2 week...

shon3i
7th May 2006, 12:42
@dimzon i founded one small bug into enc_aacPlus.exe. When use LC-AAC and MP4 container i get fake SBR which have 88.2kHz instead 44kHz and in foobar says that is SBR present but insn't when i remuxed this file with YAMB everything is fine, that is probably because you forgot to clear switch -sbr in mp4box comandline for LC-AAC.

tebasuna51
7th May 2006, 15:44
@Dimzon
Good news at http://forum.doom9.org/showthread.php?p=824472#post824472

New ffmpeg CVS_2006-04-28 works with BeHappy and preserve the 100% original wav volume. In my first test new ffmpeg is better than HeadAC3he v0.24-a13 with 6 db gain.

thuongshoo
8th May 2006, 08:37
HI dimzon! http://img135.imageshack.us/img135/2531/neroheaac6qk.th.png (http://img135.imageshack.us/my.php?image=neroheaac6qk.png). No program can know He-AAC

jjseth
8th May 2006, 10:12
Here is a simply and basic BeHappy MusePack extension.

http://d.turboupload.com/d/584079/mpcextension.rar.html

The extension and the mppenc.exe from www.musepack.net must be in the BeHappy folder of course.

@dimzon:
Maybe you want improve the extension (change the uniqueID, or add a logo), or reject it ;)

shon3i
8th May 2006, 10:21
HI dimzon! http://img135.imageshack.us/img135/2531/neroheaac6qk.th.png (http://img135.imageshack.us/my.php?image=neroheaac6qk.png). No program can know He-AAC
That is everything fine, that is MP4 container bug.

tebasuna51
8th May 2006, 11:24
Here is a simply and basic BeHappy MusePack extension.
...

Hi Shet!. Nice to meet you here.

Thanks for your contribution. Works fine, and also .mpc decode is well supported by BassAudio.

jjseth
8th May 2006, 11:37
Hi Shet!. Nice to meet you here.

Thanks for your contribution. Works fine, and also .mpc decode is well supported by BassAudio.

Hi tebasuna51!!! Nice to meet you too.
My posts in Doom9 are a rara avis cause my english is ż?ˇ?żT?żˇ()((... but i'm an "always on" reader.:D

NorthPole
9th May 2006, 02:08
If You need some fix/improvement please let me know ASAP!

Just had a couple of suggestions if you have a chance.

Anyway to get a "Clear All Jobs" on the job control page.
(now you have to delete jobs one at a time)

Also, have the destination filename change to match the source filename anytime it changes after the inital selection.
(I usually convert 3 - 5 files at a time.)

Otherwise, I like it the way it is now. Thanks again.

NorthPole
9th May 2006, 02:10
New ffmpeg CVS_2006-04-28 works with BeHappy and preserve the 100% original wav volume. In my first test new ffmpeg is better than HeadAC3he v0.24-a13 with 6 db gain.

Thanks for the tip.

thuongshoo
9th May 2006, 05:56
That is everything fine, that is MP4 container bug. really ? shon3i! What do you base on when you say that ? :D
I regret a thing that I dont know any program which can read AAC files except Gspot. Zen( author of MediaInfo) says that reading AAC files is a request :D

buzzqw
10th May 2006, 13:22
Hi Dimzon !

I would like to know if there is any update to BePipe ! i would use it in my mkvmagic (if you agree)

thanks

BHH

buzzqw
10th May 2006, 19:27
sorry to bother but i have some problem with enc_AudX_CLI.exe


C:\Programmi\PureBasic\Prove>BePipe.exe --script "import(^test.avs^)" | enc_AudX_CLI.exe - qqq.mp3
--q 2
##################################################################
Aud-X multichannel encoder CLI frontend
this algorithm has been prepared by: [Aud-X Team www.aud-x.com]
##################################################################
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
import("test.avs")
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=32, SampleRate=48000Hz
Writing Header...
Writing Data...
0% System.NotSupportedException: Il flusso non supporta la ricerca. ---> "stream doesn't support seek" i can translate
in System.IO.__Error.SeekNotSupported()
in System.IO.__ConsoleStream.get_Position()
in enc_AudX_CLI.WaveFormat.ReadWavHeader(BinaryReader reader)
in enc_AudX_CLI.Main(String[] args)
Done!

C:\Programmi\PureBasic\Prove>


this is my test.avs

loadplugin("C:\Programmi\PureBasic\Prove\exe\filter\nicaudio.dll")
nicac3source("C:\Programmi\PureBasic\Prove\aaa.ac3")

the same script is fine wth oggenc/lame/neroaacenc.exe

any suggestion ?

thanks

BHH

Edit: typos

shon3i
10th May 2006, 19:54
Did you have installed lastest Aud-X codec.

buzzqw
10th May 2006, 20:19
i use audxlib.dll and enc_AudX_CLI.exe present in enc_AudX_CLI.zip on dimzon gotnet page.

need i something other ?

BHH

tebasuna51
11th May 2006, 00:44
The last alpha Bepipe still have the bug writing wav headers detected for BeHappy in my post:
http://forum.doom9.org/showthread.php?p=758076#post758076

Maybe enc_AudX_CLI.exe detect the error and abort. See the routine name in log:
" in enc_AudX_CLI.WaveFormat.ReadWavHeader"

Others encoders may ignore the error (isn't a important parameter).

In any case, I agree with buzzqw, Bepipe can be used in others app. (see NeroAacEnc thread) and may need a update.

buzzqw
11th May 2006, 07:11
@tebasuna51
Thanks for the info.

since avs2wav isn't so good i will hope in bepipe update !

BHH

dimzon
13th May 2006, 19:00
@Dimzon
Good news at http://forum.doom9.org/showthread.php?p=824472#post824472

New ffmpeg CVS_2006-04-28 works with BeHappy and preserve the 100% original wav volume. In my first test new ffmpeg is better than HeadAC3he v0.24-a13 with 6 db gain.
WOW! Really good news! Thanx a lot!

enc_AudX_CLI.exe bug will be fixed a little later...

shon3i
13th May 2006, 19:03
@dimzon you finaly back, can you check aslo this bug in encaacplus.exe

@dimzon i founded one small bug into enc_aacPlus.exe. When use LC-AAC and MP4 container i get fake SBR which have 88.2kHz instead 44kHz and in foobar says that is SBR present but insn't when i remuxed this file with YAMB everything is fine, that is probably because you forgot to clear switch -sbr in mp4box comandline for LC-AAC.

dimzon
13th May 2006, 19:08
@dimzon you finaly back, can you check aslo this bug in encaacplus.exe
Just one question - does anybody still need this encoder since 100% free and legal solution from Nero are avaluable?

shon3i
13th May 2006, 19:11
Just one question - does anybody still need this encoder since 100% free and legal solution from Nero are avaluable?
I think just me ;)

NorthPole
13th May 2006, 19:46
Just one question - does anybody still need this encoder since 100% free and legal solution from Nero are avaluable?

Not me! Using either the free nero encoder or the new ffmpeg encoder.

dimzon
15th May 2006, 14:37
@dimzon you finaly back, can you check aslo this bug in encaacplus.exe
done ;)

dimzon
15th May 2006, 15:02
Ok, second name for this Effect is Wavesharper
There are big amount of such formulas
http://musicdsp.org/archive.php?classid=4#207
http://www.google.com/search?lr=&ie=UTF-8&oe=UTF-8&q=Waveshaper

and finally found good approximation
http://img217.imageshack.us/img217/1803/testnew6pc.png
yellow is tera
pink is .55 * Math.Atan(6*x)

Some code from LigH
http://www.ligh.de/software/booster.zip
const
HalfPi = Pi/2;

function BoostStrong(Value: Single): Single;
begin
Result := TanH(Value);
end;

function BoostMedium(Value: Single): Single;
begin
Result := ArcTan(Value*HalfPi)*HalfPi;
end;

function BoostSoft(Value: Single): Single;
begin
Result := Value/(Abs(Value)+1);
end;

Another good news is BeHappy is now @ third place
http://img169.imageshack.us/img169/650/bh33zw.th.png (http://img169.imageshack.us/my.php?image=bh33zw.png)

shon3i
15th May 2006, 16:30
done ;)
Nice, everything work pefertly now. Thanks

dimzon
16th May 2006, 01:30
new UNSTABLE version is out
get it @ BeHappy workspace at Your own risk

http://img226.imageshack.us/img226/1974/14oa1.png

http://img226.imageshack.us/img226/222/20mg.png

http://img226.imageshack.us/img226/2333/33ut.png

http://img55.imageshack.us/img55/4022/48vn.png

Yama4050242
16th May 2006, 02:48
both BeHappy & megui do not support nero 2pass? why?

buzzqw
16th May 2006, 07:15
Using avisynth isn't possibile to do a 2 pass encoding (with piping).

Behappy should first dump the wav file then do the 2 pass encoding... it's a quite long process

BHH

shon3i
16th May 2006, 11:38
@dimzon, one question:

did you include new CT dialog or not

and can you use mp4 for default extesion insted m4a

buzzqw
16th May 2006, 12:18
and can you use mp4 for default extesion insted m4a

afaik mp4 mean m4a muxed into mp4 container... so is different from m4a

BHH

dimzon
16th May 2006, 12:38
afaik mp4 mean m4a muxed into mp4 container... so is different from m4a
Wrong! m4a is AAC in MP4 container. So it's just mp4 renamed to m4a

@dimzon, one question:
did you include new CT dialog or not
Not yet.

and can you use mp4 for default extesion insted m4a
Personally I prefer m4a for audio-only and mp4 for audio+video
bcz I'm using foobar2000 to play m4a (via file association) and MPC to play mp4 (via file association)...
Actually I believe that different extension for audio-only media is good way:


RIFF: WAV & AVI
ASF: WMA & WMV
Matroska: MKA & MKV
MP4: M4A & MP4
OGM: OGG & OGM

shon3i
16th May 2006, 12:55
Personally I prefer m4a for audio-only and mp4 for audio+video
damn, i just prefer mp4 for both audio and video, can you in next release show nero and ct encoders as extension, so than i can change this manunaly, if that possible

Not yet.approx.

dimzon
16th May 2006, 13:16
damn, i just prefer mp4 for both audio and video, can you in next release show nero and ct encoders as extension, so than i can change this manunaly, if that possible
approx.
Hmm... Maybe I will add ability to use last used extension by default instead first from the list.

Kurtnoise
16th May 2006, 13:33
@Dimzon : looking at the Lame picture, the window title is wrong I think. ;)

m4a is AAC in MP4 container
We can store also mp3 and alac into the m4a. :)

dimzon
16th May 2006, 13:49
@Dimzon : looking at the Lame picture, the window title is wrong I think. ;)
Copy/Paste - the greatest programming paradigm ;)


We can store also mp3 and alac into the m4a. :)
Agreed

Rockaria
16th May 2006, 15:53
Another good news is BeHappy is now @ third place
http://img169.imageshack.us/img169/650/bh33zw.th.png (http://img169.imageshack.us/my.php?image=bh33zw.png)
Also do you agree that you don't need to (& should not) use my id in your project as I said long ago? It is not only reflecting the reality wrongfully, I am not feeling any honered by those kind of fixture at all.
It's not a simple idea, but a complete set of my philosophy through my own career. I have been independant since very long ago, so should it be reflected as such.

SirLamer
17th May 2006, 02:32
I am having trouble getting this to run. I know I am doing something dumb, but... I need help! heh

When I try to convert from an AC3 into AAC using BeHappy, I get this error log:

Starting job VTS_01_1 01 en-English 3_2ch 448Kbps DELAY 0ms.ac3->moulin rouge audio.mp4
Error: BeHappy.AviSynthException: Script error: there is no function named "NicAc3Source"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

I have put NicAudio.dll in the MeGUI folder (where I put BeHappy as well) and AviSynth's plugins folder. Does anyone have any ideas?

Also, I am curious - while I know AAC supports 96kHz sample rates, does it also support 24bit fidelity? I have found nothing that says it is either 16bit or 24bit. Does anyone know?

SirLamer
17th May 2006, 05:17
Hey,

I found out that the error is because the generated AviSynth script is missing a line of code:

LoadPlugin("NicAudio.dll")

It sould appear before the nic script is called.

dimzon
17th May 2006, 06:11
Also, I am curious - while I know AAC supports 96kHz sample rates, does it also support 24bit fidelity? I have found nothing that says it is either 16bit or 24bit. Does anyone know?
ATM BeHappy doesnt support anything except 16 bit

Hey,

I found out that the error is because the generated AviSynth script is missing a line of code:

LoadPlugin("NicAudio.dll")

It sould appear before the nic script is called.
No. Just place NicAudio.dll into AviSynth plugin folder

SirLamer
17th May 2006, 18:04
Well I did that, and it wasn't sufficient.

Adding the line of code made it work suddenly.

dimzon
17th May 2006, 18:18
Well I did that, and it wasn't sufficient.

Adding the line of code made it work suddenly.
impossible

SirLamer
18th May 2006, 01:19
Okay, then don't believe me. You could focus on a possible bug in your program, or you can claim it to be fantasy, it is your choice.

I don't have AviSynth installed in the default location. I will try reinstalling it in the default folder and see if that fixes things.

By the way, it would be nice if one were able to export AAC in a .mp4 container, since it has support with more media players.

UPDATE: Indeed, installing AviSynth at its default location corrected the error.

ANOTHER UPDATE: I had StaxRip installed, and it's possible that it decided to swap the registry link from the AviSynth folder I installed to its own plugins folder.

dimzon
18th May 2006, 08:41
new unstable development build out!

New CT AAC encoder GUI
New TimeStretch encoder GUI

dimzon
18th May 2006, 08:44
Okay, then don't believe me. You could focus on a possible bug in your program, or you can claim it to be fantasy, it is your choice.

I don't have AviSynth installed in the default location. I will try reinstalling it in the default folder and see if that fixes things.

By the way, it would be nice if one were able to export AAC in a .mp4 container, since it has support with more media players.

UPDATE: Indeed, installing AviSynth at its default location corrected the error.

ANOTHER UPDATE: I had StaxRip installed, and it's possible that it decided to swap the registry link from the AviSynth folder I installed to its own plugins folder.

So this is not a bug in BeHappy application as I said before. You just placed NicAudio.dll in wrong folder.

shon3i
18th May 2006, 10:41
new unstable development build out!

New CT AAC encoder GUI
New TimeStretch encoder GUI
Nice, Thank You.

stax76
18th May 2006, 13:41
Any chance adding COM automation suport?

dimzon
18th May 2006, 13:51
Any chance adding COM automation suport?
Any reason to ask about it? :rolleyes:

stax76
18th May 2006, 14:39
In my case I'm interested to use BeHappy for audio encoding with StaxRip. A CLI might even be better since StaxRip has already generic CLI support. Generally scripting and CLI is always a good thing, don't you think?

There is always a feature missing and scripting is often the rescue here. I've extened dozens of applications for personal use including most of my media apps like MediaMonkey, iTunes, DVBViewer, they all got a huge scripting SDK.

BeHappy would then be usable from the command prompt, batch files, and all serious programming and scripting languages. It can already be hacked easily from .NET but it's nicer to use a real SDK, late binding etc. instead of reflection on private code.

dimzon
18th May 2006, 16:06
In my case I'm interested to use BeHappy for audio encoding with StaxRip.
...
It can already be hacked easily from .NET but it's nicer to use a real SDK, late binding etc. instead of reflection on private code.

Actually I think it's much better to add direct reference from StaxRip to BeHappy. If You need some methods to be public instead of private or You need some special API just ask me ;) And if You need COM support just write .NET wrapper around BeHappy...

Another good way is - extract only requed parts of the code from BeHappy source and use it directly into StaxRip (MeGUI way). Since your primary code is written in VB.NET and BeHappy is written in C# it's better to create separate assembly and use it from your VB.NET code ;)

Anycase keep in mind - BeHappy is GPL-ed so You can modify it as You wish ;)

Cheers

dimzon
18th May 2006, 17:31
Fresh ffmpeg.extension is avaluable @ BeHappy Workspace

stax76
18th May 2006, 18:00
How about CLI, don't you think it would be useful? I could help you if you don't want to spend much time with it (start StaxRip with -h to see how I did my CLI, IMHO it's quite nice).

dimzon
18th May 2006, 18:11
How about CLI, don't you think it would be useful? I could help you if you don't want to spend much time with it (start StaxRip with -h to see how I did my CLI, IMHO it's quite nice).
Actually I have some far future plans to improve BePipe a lot...
Avs inline is not very easy-to-use when you need some complex processing - I'm planning to make another architecture, easy to use and extensible... (extension will add or extend command-line switch )
It will be complete different application with it's own extensions and encoders arhitecture... Command line will be close to BeSweet one (maybe it will be even mimic to BeSweet to allow drop-in replacement)

dimzon
19th May 2006, 08:17
New version is out

dimzon
19th May 2006, 16:29
Aud-X extension is out
http://img105.imageshack.us/img105/6730/untitled7ir.png

Daodan
19th May 2006, 16:33
I really can't get that upmix working. It always sais: Invalid arguments to function "SuperEq". How can I get this working?
Thank you.

FredThompson
19th May 2006, 19:51
Am I correct that posts 1 and 4 are the only current "reference" posts?

shon3i
19th May 2006, 22:29
BeHappy 0.1.9 build 5241


Download (http://www.box.net/public/1hvgoifeyd)

Just install and enjoy in encoding


Changelog:

18/08/2006:
- With little late BeHappy package is updated to BeHappy 19/07/2006
- Added Aften AC3 encoding

20/06/2006:
- Added BassAudio plugins & extensions (request by tebasuna51)

17/06/2006:
- Updated BeHappy to 23/05/2006 v4
- Updated mp4box to last release
- Updated Nero to 1.0.0.2
- Updated CT from Winamp 5.23 Pro
- Updated Aud-X 23/05/2006
- Updated NicAudio.extension (support MPG123 ReplayGain)
- Added Nero SSE2 Encoder
- Added SoxFilter for upmix extensions
- New installation by InstallShield

23/05/2006:
- Updated BeHappy to 23/05/2006
- Updated Aud-X CLI encoder to 22/05/2006

22/05/2006:
- Updated BeHappy to 22/05/2006

20/05/2006:
- MeGUI auto updater overwrites my NicAudio.dll (20060314) with some from 2005, in that case DRC not work, so install this new package to return to (20060314)
- I forgot to put mp4box need for CT audio encoder.

19/05/2006
-First release

buzzqw
20th May 2006, 07:11
thanks shon3i !

BHH

dimzon
21st May 2006, 22:10
fresh beta out!
some eye-candy
http://img62.imageshack.us/img62/6428/c19lr.png

shon3i
21st May 2006, 22:47
Hmm very nice Thanks dimzon, new package (http://forum.doom9.org/showpost.php?p=829754&postcount=259)

dimzon
21st May 2006, 22:52
shon3i
If You prefer mp4 over m4a you need

open BeHappy.exe.config via notepad
change key="preferMP4overM4A" value="false" to key="preferMP4overM4A" value="true"


You can also use your favorite DirestShow player for preview instead of mplayer2. Just edit key="directShowPlayer" value="mplayer2"

shon3i
22nd May 2006, 08:59
OK, thanks you.

shon3i
22nd May 2006, 10:38
Is there chance to integrate FAAD or some different AAC/MP4 decoder.

dimzon
22nd May 2006, 11:22
Is there chance to integrate FAAD or some different AAC/MP4 decoder.
Later (much more later)

dimzon
22nd May 2006, 17:32
sorry to bother but i have some problem with enc_AudX_CLI.exe


C:\Programmi\PureBasic\Prove>BePipe.exe --script "import(^test.avs^)" | enc_AudX_CLI.exe - qqq.mp3
--q 2
##################################################################
Aud-X multichannel encoder CLI frontend
this algorithm has been prepared by: [Aud-X Team www.aud-x.com]
##################################################################
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
import("test.avs")
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=32, SampleRate=48000Hz
Writing Header...
Writing Data...
0% System.NotSupportedException: Il flusso non supporta la ricerca. ---> "stream doesn't support seek" i can translate
in System.IO.__Error.SeekNotSupported()
in System.IO.__ConsoleStream.get_Position()
in enc_AudX_CLI.WaveFormat.ReadWavHeader(BinaryReader reader)
in enc_AudX_CLI.Main(String[] args)
Done!

C:\Programmi\PureBasic\Prove>


this is my test.avs

loadplugin("C:\Programmi\PureBasic\Prove\exe\filter\nicaudio.dll")
nicac3source("C:\Programmi\PureBasic\Prove\aaa.ac3")

the same script is fine wth oggenc/lame/neroaacenc.exe

any suggestion ?

thanks

BHH

Edit: typos


fixed (maybe) - check new enc_AudX_CLI.exe version

tebasuna51
22nd May 2006, 19:08
To encode a wav 5.1 to ogg I need a explicit GetChannels(1,3,2,5,6,4) to obtain a correct mapped ogg.
Isn't added automatically?

buzzqw
22nd May 2006, 19:24
downloaded latest version 22/05/2006 of AudX_cli package

avs script

LoadPlugin("NicAudio.dll")
NicAC3Source("C:\Programmi\PureBasic\Prove\aaa.ac3")
EnsureVBRMP3Sync()
ConvertAudioTo16bit() # since aud-x want 16bit sample

batch

BePipe.exe --script "import(^mkvmaudio.avs^)" | enc_AudX_CLI.exe - aaa.mp3 --raw 48000 --q 2

isn't working... mean the job end without warning but audio is corrupted.

i tryed without --raw 48000 and without EnsureVbrMp3Sync, and without convertaudioto16bit

any help ?

BHH

dimzon
22nd May 2006, 20:14
To encode a wav 5.1 to ogg I need a explicit GetChannels(1,3,2,5,6,4) to obtain a correct mapped ogg.
Isn't added automatically?
http://forum.doom9.org/showthread.php?p=827430#post827430


LoadPlugin("NicAudio.dll")
NicAC3Source("C:\Programmi\PureBasic\Prove\aaa.ac3")
EnsureVBRMP3Sync()
ConvertAudioTo16bit() # since aud-x want 16bit sample

batch

BePipe.exe --script "import(^mkvmaudio.avs^)" | enc_AudX_CLI.exe - aaa.mp3 --raw 48000 --q 2

isn't working... mean the job end without warning but audio is corrupted.

i tryed without --raw 48000 and without EnsureVbrMp3Sync, and without convertaudioto16bit



valid command-line is
BePipe.exe --script "import(^mkvmaudio.avs^)" | enc_AudX_CLI.exe - aaa.mp3 --q 2
what does "corrupted" means?
Can you save audio to WAV using
BePipe.exe --script "import(^mkvmaudio.avs^)" > test.wav and listen it - maybe something wrong BEFORE encoder

buzzqw
22nd May 2006, 21:28
tryed without --raw 48000 (as already posted) and audio get wrong

Sample test is 12 second and aud-x got 14 seconds with rumors and distorted audio play.

bepiping for wav file is correctly played

i packed my files (bat/avs/ac3/audx/bepipe) (800kb) please try yourself

www.64k.it/andres/test_bepipe_audx.rar

thanks !

BHH

EDIT: seems to be the normalize fuction...

dimzon
23rd May 2006, 00:28
fresh beta is out.
including UpMix extension ;)

tebasuna51
23rd May 2006, 01:17
From http://forum.doom9.org/showthread.ph...430#post827430
don't forget that latest oggenc2 build support 5.1 channel in correct order
Oh Shit...
Please, provide me download link for fresh valid oggenc2
Oggenc2.83 using aoTuVb4.51 2006-04-26 in rarewares and oggenc2 in shon3i package still need the GetChannel.

Where is the latest oggenc2 build?

tebasuna51
23rd May 2006, 01:45
i packed my files (bat/avs/ac3/audx/bepipe) (800kb) please try yourself
With your example (with or without Normalize) i get:

ERROR: Can't find audio stream!
System.Exception: Invalid file format
at enc_AudX_CLI.WaveFormat.ReadWavHeader(BinaryReader reader)
at enc_AudX_CLI.Main(String[] args)

buzzqw
23rd May 2006, 07:12
@tebasuna51

look at nicaudio plugin and correct it to your avisynth path

about ogg: i usually got it at rarewares

quoting from rarewares
oggenc2 A short explanation.
oggenc2.x: is a command line Ogg Vorbis encoder based upon the official oggenc.....Version 2.8 introduces correct channel mapping for encoding of multi-channel (3 to 6 channels) files that conform to the WAVEFORMATEXTENSIBLE standard. The multi-channel mapping conforms to the Vorbis I Specification.

seems that oggenc2.x has correct channel map :confused: so i don't know if getchannel has to be passed or not

BHH

tebasuna51
23rd May 2006, 07:57
look at nicaudio plugin and correct it to your avisynth path
Of course. And two pass encoding:

BePipe.exe --script "import(^mkvmaudio.avs^)" > aaa.wav
enc_AudX_CLI.exe aaa.wav aaa.mp3 --q 3

the mono mp3 equivalent seems work ok (I haven't 5.1 audio attached to pc)
about ogg: i usually got it at rarewares

quoting from rarewares:

"Version 2.8 introduces correct channel mapping for encoding of multi-channel (3 to 6 channels) files that conform to the WAVEFORMATEXTENSIBLE standard."

But Bepipe/BeHappy never use WAVEFORMATEXTENSIBLE header.

Edit: BeHappy sends audio to oggenc2 in RAW format.
Oggenc2.83 using aoTuVb4.51 2006-04-26 from rarewares need the getchannel.

dimzon
23rd May 2006, 08:31
Edit: BeHappy sends audio to oggenc2 in RAW format.
Oggenc2.83 using aoTuVb4.51 2006-04-26 from rarewares need the getchannel.
Both MeGUI and BeHappy will be fixed soon
Sorry....

dimzon
23rd May 2006, 08:56
Oggenc2.83 using aoTuVb4.51 2006-04-26 from rarewares need the getchannel.
fixed

dimzon
23rd May 2006, 13:01
fresh beta is out ;)
fixed improper Lame MP3 ABR command-line

shon3i
23rd May 2006, 16:39
Fresh package (http://forum.doom9.org/showpost.php?p=829754&postcount=259)

tebasuna51
23rd May 2006, 18:38
@Dimzon
In enc_AudX_CLI.cs maybe there are a bug to explain the buzzqw problem.
Lines 136-148 and a new line (in black):
// advance in the stream to skip the wave format block
len -= 16; // minimum format size
while (len > 0)
{
reader.ReadByte();
--len;
}

// assume the data chunk is aligned
if (readChunk(reader) != "data")
throw new Exception("Invalid file format");

reader.ReadInt32(); // Data length not used but maybe must be read

return format;
If DataLength is not read can be interpreted like first audio data for FL and FR channels and all the file is missmapped.

dimzon
23rd May 2006, 19:42
@Dimzon
In enc_AudX_CLI.cs maybe there are a bug to explain the buzzqw problem.
Lines 136-148 and a new line (in black):
// advance in the stream to skip the wave format block
len -= 16; // minimum format size
while (len > 0)
{
reader.ReadByte();
--len;
}

// assume the data chunk is aligned
if (readChunk(reader) != "data")
throw new Exception("Invalid file format");

reader.ReadInt32(); // Data length not used but maybe must be read

return format;
If DataLength is not read can be interpreted like first audio data for FL and FR channels and all the file is missmapped.


Thanx!!!
New release @ beHappy workspace

dimzon
23rd May 2006, 21:28
first post modified - now it contains some usefull info and installation manual ;)
still need user manual

buzzqw
23rd May 2006, 21:31
sorry again

i have update the build with latest posted by dimzon

but, again , there must be some problems

link at mp3 and ac3 converted (846kb)

www.64k.it/andres/ac3_mp3_23062006.rar

BHH

dimzon
23rd May 2006, 22:00
sorry again

i have update the build with latest posted by dimzon

but, again , there must be some problems

link at mp3 and ac3 converted (846kb)

www.64k.it/andres/ac3_mp3_23062006.rar

BHH
does this bug reproducable when You encode via BeHappy (not BePipe)

dimzon
24th May 2006, 08:51
BeHappy @ first place @ gotdotnet.com
http://img138.imageshack.us/img138/7218/bh110bf.th.png (http://img138.imageshack.us/my.php?image=bh110bf.png)

buzzqw
24th May 2006, 12:07
tested with latest behappy

same error

www.64k.it/andres/ac3_mp3_24052006.rar

BHH

Eric B
25th May 2006, 15:01
So this is not a bug in BeHappy application as I said before. You just placed NicAudio.dll in wrong folder.

Hi,

I've just wanted to use your soft to encode some AAC files with the new Nero Digital Audio free AAC encoder.

I have the same pb than SirLamer before (no function named "NicAc3Source").
I ve put the NicAudio.dll in my Avisynth plugin folder, but there is no reference to avisynth installation path from your software, so I do not see how it could work. Did you hard coded the default avisynth installation path?

It would be great to let the user to configure it, e.g. stored in app.config. It is possible under megui, but not here.

Similar, it would be nice to save all the settings into it (choosen input and output format with the index or value of comboboxes ).

Regarding Avisynth, I am looking into your source (great that I can open it with VS2005 Express, I am myself a C# developper), but I do not find it. I do not see any avisynth config file into windows folder

Alternatively, it is possible to use MeGui to encode with the new Nero CLI ?

Eric B
25th May 2006, 15:19
I ve just tested your new BSN with besweet, and it works great, so I will stay using besweet instead of avisynth for audio encoding.

shon3i
25th May 2006, 16:25
@Eric B download this (http://forum.doom9.org/showpost.php?p=829754&postcount=259) and enjoy

Avish
27th May 2006, 08:19
I'm getting this error:Starting job Bambi T01 DELAY -155ms.mpa->Bambi T01 DELAY -155ms.m4a
Error: BeHappy.AviSynthException: unexpected character "˙"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()I can't figure out what's the culprit here?

BTW what is aacPlusHigh? I mean is it better for any perticular use?

shon3i
27th May 2006, 12:38
I can't figure out what's the culprit here?
Hmm this is very strange, what you setting use?

BTW what is aacPlusHigh? I mean is it better for any perticular use?aacPlusHigh is same as HE-AAC but only for High bitrates, someone says that is not good using SBR @ high bitrates, my ears can't find any artifact, but for safe reason better use LC. aacPlusHigh support only 2 channel audio and have 88.2khz instead 44.1khz.

Avish
27th May 2006, 13:28
Hmm this is very strange, what you setting use?I did this: Selected the source file [mpa], set the suggested delay, selected "CT aacPlus v2, CBR @ 64 kbit/s, Joint Stereo" profile, enqueue & start. Error comes almost immediately.

shon3i
27th May 2006, 15:55
Try to select instead Nic123Source, DirectShowSource and Vice Versa

Avish
27th May 2006, 16:16
Try to select instead Nic123Source, DirectShowSource and Vice VersaNicMPG123Source seems to be working. Thanks. :)

shon3i
27th May 2006, 16:23
put mp4box in BeHappy folder

Avish
27th May 2006, 16:30
put mp4box in BeHappy folderYes. Did exactly that. Sorry for the trouble. :)

:D Troubling you again!!! Why it's showing "AAC 22050Hz stereo 62Kbps". Shouldn't it be 44100Hz?

shon3i
27th May 2006, 18:34
No everything is fine because that is HE-AAC, but when playing decoder upsample to 44Khz

tebasuna51
29th May 2006, 02:26
My first C# program, using enc_AudX_CLI.cs scheme I change the body code to obtain Wav2mono.exe.

This program can split in mono wav's any stereo or 6 channel wav accepting STDIN input. Then can be used with BeHappy to obtain mono wav´s like output instead Wav writer, this replace a BeSweet/BeLight functionality not supported yet by BeHappy.

We need Wav2mono.exe and Wav2mono.Extension in BeHappy folder.

These files, and source and old version (only 23 KB), are in:
(link lost)

Any input will be apreciated.

Edit: See http://forum.doom9.org/showthread.php?p=886080#post886080

dimzon
29th May 2006, 09:24
My first C# program, using enc_AudX_CLI.cs scheme I change the body code to obtain Wav2mono.exe.
Welcome to C#/.NET World ;)

Dayvon
31st May 2006, 21:21
@ Dimzon

Sorry for dropping off the face of the earth man. I had every intention of helping out in some way, and then LIFE happened :o . Needless to say, BeHappy is rocking! You've been doing awesome work. Me and everyone else using it gives you thanks!

fight2win
1st June 2006, 18:39
for ac3 to aac conversion, how to increase volume of output file in behappy?

tebasuna51
1st June 2006, 20:35
for ac3 to aac conversion, how to increase volume of output file in behappy?
Use NicAc3Source with DRC and after Normalize at desired level.

fight2win
2nd June 2006, 12:49
my behappy only says source as nicac3, not as nicac3drc, where to get it?

dimzon
2nd June 2006, 13:02
my behappy only says source as nicac3, not as nicac3drc, where to get it?
choose nicac3 source AND click on [...] button against source selection ;)

fight2win
10th June 2006, 17:55
i have 3 little queries about ac3/dts to aac encoding:

1.if my source is 2-ch 192kbps ac3, which out of drc source,normalize to 100 percent and dpl2 downmix options should i use?

2.in what order should normalize and dpl2 downmix options should come, i mean, which should come first and which after that?

3. for muxing in mp4 container, should i use .aac conatainer output encoding or .m4a container output encoding?

thanks in advance, by the way, behappy rocks!

shon3i
10th June 2006, 20:18
1. for stereo encoding's don't use dominix
2. first dominix and then normalize (but i think is the same when is inverted)
3. mp4 is better choice, because sometimes must to singnal HE-AAC when muxing, and muxers can't detect propertly HE-AAC files.

fight2win
10th June 2006, 20:39
1. for stereo encoding's don't use dominix
2. first dominix and then normalize (but i think is the same when is inverted)
3. mp4 is better choice, because sometimes must to singnal HE-AAC when muxing, and muxers can't detect propertly HE-AAC files.

thanks!:)

fight2win
10th June 2006, 21:05
even when encoding ac3 6 channel or dts to 2-channel aac, should i use downmix to dpl2 ?

tebasuna51
10th June 2006, 23:20
2. first dominix and then normalize (but i think is the same when is inverted)
Is not the same. First downmix and after normalize.

When normalize over 6 channels the max peak of all channels is used to calculate the common gain applied to all channels.

After downmix, (to avoid clipping problems, the coeficients in downmix matrix must sum only 1.0) the resultant 2 channels never are normalized.

Only if all 6 input channels have a equal max peak at same time is the same.
even when encoding ac3 6 channel or dts to 2-channel aac, should i use downmix to dpl2 ?
Yes, why not?

vlada
16th June 2006, 06:17
Hello,

I have one very basic question: Why the NicAudio.dll isn't loaded? The script created by BeHappy doesen't work. It reports there is no command called NicAC3Source. I think there sould be something like LoadPlugin("NicAudio.dll"). Of course I have this file in my AviSynth plugin's directory. Why isn't BeHappy working for me?

Sorry for this very basic question, but I couldn't find the answer anywhere.

dimzon
16th June 2006, 10:18
Of course I have this file in my AviSynth plugin's directory.
Sometimes some software can modify HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth registry key, check it to know wich ACTUAL dir is AviSynth plugin dir

MacAddict
16th June 2006, 11:41
Is not the same. First downmix and after normalize.
Maybe this should be default in the GUI then?

tebasuna51
17th June 2006, 02:32
Yes, for habitual jobs Normalize() is the last DSP to be used.
I don't remember if is the default but, if you use Move Down, the next time you use BeHappy your order is preserved.

shon3i
17th June 2006, 19:18
Again i haved some free time to make new fresh package (http://forum.doom9.org/showpost.php?p=829754&postcount=259) with last versions

vlada
19th June 2006, 20:36
dimzon> So if I have a plugin in AviSynth plugin's folder, there should be no need to load the plugin in script? I didn't know that.

Anyway I installed the package from shon3i and BeHappy started working. I have no idea what was wrong.

shon3i
20th June 2006, 16:57
Maybe you don't haved nicaudio.dll in avisynth plugins folder, or avisynth use other path for plugins(stored in registry, look dimzon's post above) and my setup use this path and find right plugins folder on system

shon3i
20th June 2006, 19:23
Fresh package (http://forum.doom9.org/showpost.php?p=829754&postcount=259) is out.

Now support BassAudio which means more input file types supported directly (wav/ogg/aiff/mp3/mp2/wma/flac/wv/ape/mpc/spx/aac/m4a/mp4/ac3)

but have some minor bugs and restrictions like

- aac decode don't work for 5.1 multichannel. Better to use DirectShowSource
- stereo ac3 (2.0) don't work. NicAC3 is better

And i found that ape (Monkey's Audio) don't work propertly

Yanaran
22nd June 2006, 23:45
Just wanted to say thanks for this great tool, finally I get full volume ac3 for my DVDs without jumping through hoops. :)

dimzon
26th June 2006, 15:29
http://gotdotnet.com/
Now BeHappy is Featured Workspace

Hello,

Your project rocks! We're going to feature it on the GotDotNet homepage. Congrats and keep up the great work.

Julie
Microsoft GotDotNet Team

shon3i
26th June 2006, 22:54
Congratulation dimzon, realy great work.

thuongshoo
3rd July 2006, 10:40
Req1 : If I choose a source file, "destination file" textbox will be filled automatically. This thing only is done if "destination file" textbox is blank for currentl version

Req2: I want to choose multiple job when I need to delete jobs . After I delete a jobs, current item will be set to the fisrt jbo .

Thank you very much !

Dark-Cracker
4th July 2006, 15:36
hum just a little question about the difference beetween amplify and normalyze, i know the amplify factor (to amplify it at 100%) for my wav file, if i amplify it with this factor does it will be the same than normalize it at 100% ? i don't clearly see the difference beetween those 2 audio filter.

and i also want to know if there is some generical range or presets for the function normalize and amplify/amplifydb ?

perhaps some audio guru could enlight me on those silly questions :)

Bye.

Ps : very nice tool dimzon, and thanks for the people who give him life.

++

Wilbert
4th July 2006, 23:14
hum just a little question about the difference beetween amplify and normalyze, i know the amplify factor (to amplify it at 100%) for my wav file, if i amplify it with this factor does it will be the same than normalize it at 100% ?
Yes, that's correct.

I think the difference is as follows:

Normalize(volume=1.0) amplifies maximal without clipping (by calculating the maximum peak). Normalize(volume=0.5) amplifies to 50% of this maximal value. So, even in this case the audiolevels can be higher as before applying the filter.

Amplify(amount1=1.0) doesn't do anything. Amplify(amount1=2.0) doubles the audio levels, regardless whether there will be any clipping.

I'm sure someone will correct me if i'm wrong :)

Dark-Cracker
5th July 2006, 08:52
thank u for the explanation wilbert :) it's more clear now.

another question, does behappy will implement the filter AudioLimier (http://forum.doom9.org/showthread.php?t=108470) or it doesn't produce enought good results to be used ?

Ps : dimzon if this could help you to improve your nice tool here is a little trick (AVSAmp) to found the amplify full scale factor : http://forum.doom9.org/showthread.php?t=92120
not really sure if this could be usefull :) .

Bye.

shon3i
5th July 2006, 10:58
I think that this avsamp works like replaygain from foobar but i am not sure, but will be very usefull

fight2win
5th July 2006, 11:29
after nicac3source (drc), and then downmixing to dpl2, is it advisable to use normalize now, if yes, to what limit, i mean, 100% or more or less than that?also, when is audiolimiter gonna be implemented in behappy?

tebasuna51
7th July 2006, 00:59
after nicac3source (drc), and then downmixing to dpl2, is it advisable to use normalize now, if yes, to what limit, i mean, 100% or more or less than that?
After DRC (output may be at -11 dB) and DPL2 (BeHappy use a normalized matrix) is recommended to use Normalize with a 100% limit.

Krizzz989
11th July 2006, 02:00
My AC3 encodes are filled with noise, thanks in advance for any help.

BeHappy_20060532_v4
NicAudio_25_dll_20060314
ffmpeg CVS 2006-05-19
AviSynth 2.5.6a

BeHappy logStarting job 10.avi->10.ac3
Found Audio Stream
Channels=2, BitsPerSample=16, SampleRate=48000Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 192 "F:\video\chobits\03\10.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete
#### Encoder StdErr ####
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mingw32 --enable-memalign-hack --enable-gpl --enable-a52 --enable-dts --enable-mp3lame --enable-faac --enable-amr_nb --enable-faad --enable-amr_wb --enable-pp --enable-x264 --enable-xvid --enable-theora --enable-libogg --enable-vorbis
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on May 24 2006 08:10:52, gcc: 4.1.0 [Sherpya]
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 1536 kb/s
Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Output #0, ac3, to 'F:\video\chobits\03\10.ac3':
Stream #0.0: Audio: ac3, 48000 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0

video:0kB audio:34496kB global headers:0kB muxing overhead 0.000000%

Let me know if any further information is needed.

edit: Here's a sample http://www.zshare.net/download/sample-ac3.html

tebasuna51
11th July 2006, 09:57
My AC3 encodes are filled with noise, thanks in advance for any help.
The log seems ok.
For further analysis we need a sample of source audio and the .avs used ("Export AviSynth Script").

Krizzz989
11th July 2006, 13:25
Here's a sample, demuxed from source avi using AVI-Mux GUI 1.17.6. http://www.zshare.net/audio/sample-mp3-hqw.html

avs script:
########################################
#Created by BeHappy v0.1.8.35345
#Creation timestamp: 7/11/2006 4:25:07 AM
########################################
#Source FileName:F:\video\chobits\03\10.avi
#Target FileName:F:\video\chobits\03\10.ac3
########################################

########################################
# [Source: DirectShowSource]
########################################
DirectShowSource("F:\video\chobits\03\10.avi")

EnsureVBRMP3Sync() # Some black magic to avoid desync

########################################
# [Encoder: ffmpeg AC3 @ 192 kbps]
########################################
6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last

tebasuna51
11th July 2006, 13:34
There are a new and interesting ac3 encoder Aften (http://forum.doom9.org/showthread.php?p=850635#post850635) based in ffmpeg libraries
Aften 0.01 : A/52 audio encoder
(c) 2006 Justin Ruggles

usage: aften [options] <input.wav> <output.ac3>
options:
[-h] Print out list of commandline options
[-v #] Verbosity (controls output to console)
0 = quiet mode
1 = show average stats (default)
2 = show each frame's stats
[-b #] CBR bitrate (default: none)
[-q #] VBR quality [1 - 1023] (default: 200)
[-w #] Bandwidth [0 - 60] (default: adaptive)
[-m #] Stereo rematrixing
0 = independent L+R channels
1 = mid/side rematrixing (default)
[-s #] Block switching
0 = use only 512-point MDCT (default)
1 = selectively use 256-point MDCT
[-c #] Center Channel Mix level
0 = -3 dB (default)
1 = -4.5 dB
2 = -6 dB
[-u #] Surround Channel Mix level
0 = -3 dB (default)
1 = -6 dB
2 = 0 dB
[-d #] Dolby Pro Logic Mode
0 = Ignored (default)
1 = Disabled
2 = Enabled
[-n #] Dialog Normalization level [0 - 31] (default: 31)
You can try in BeHappy with this aften.extension
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioEncoder UniqueID="a63940a0-0da0-11db-9cd8-0800200c9a66">
<Plugin>
<MultiOptionEncoder Type="BeHappy.Extensions.MultiOptionEncoder, BeHappy">
<DialogWidth>250</DialogWidth>
<ExecutableFileName>aften.exe</ExecutableFileName>
<TitleFormatString>aften AC3 @ {0}</TitleFormatString>
<SupportedFileExtension>ac3</SupportedFileExtension>
<Option>
<Name>448 kbps</Name>
<Value>-b 448000 - "{0}"</Value>
</Option>
<Option default="true">
<Name>384 kbps</Name>
<Value>-b 384000 - "{0}"</Value>
</Option>
<Option>
<Name>320 kbps</Name>
<Value>-b 320000 - "{0}"</Value>
</Option>
<Option>
<Name>256 kbps</Name>
<Value>-b 256000 - "{0}"</Value>
</Option>
<Option>
<Name>192 kbps</Name>
<Value>-b 192000 - "{0}"</Value>
</Option>
<Option>
<Name>160 kbps</Name>
<Value>-b 160000 - "{0}"</Value>
</Option>
</MultiOptionEncoder>
</Plugin>
</AudioEncoder>
</BeHappy.Extension>
To configure others parameters than bitrate (Dialog Normalization, Dolby Surround mode, ...) we need the help from Dimzon to make the appropriate Configuration Dialog (or you can edit aften.extension before run BeHappy).

tebasuna51
11th July 2006, 13:46
avs script:

DirectShowSource("F:\video\chobits\03\10.avi")

You can't use an avi like input for BeHappy.
BeHappy wait for a audio only file.
Use the mp3 extracted with AviMux.

danpos
11th July 2006, 14:03
You can't use an avi like input for BeHappy.
BeHappy wait for a audio only file.
Use the mp3 extracted with AviMux.

Nope, it can to do this using DirectShow since that the container have an audiostream. Take a look at the BeHappy's log from a quick conversion test that I did right now:


Starting job sample.avi->sample.ac3
Found Audio Stream
Channels=2, BitsPerSample=16, SampleRate=48000Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 160 "D:\Compilation\SCRIPTS\Didees scripts\sample.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete
#### Encoder StdErr ####
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mingw32 --enable-memalign-hack --enable-gpl --enable-a52 --enable-dts --enable-mp3lame --enable-faac --enable-amr_nb --enable-faad --enable-amr_wb --enable-pp --enable-x264 --enable-xvid --enable-theora --enable-libogg --enable-vorbis
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on May 13 2006 18:31:30, gcc: 4.1.0 [Sherpya]
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 1536 kb/s
Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Output #0, ac3, to 'D:\Compilation\SCRIPTS\Didees scripts\sample.ac3':
Stream #0.0: Audio: ac3, 48000 Hz, stereo, 160 kb/s
Stream mapping:
Stream #0.0 -> #0.0

video:0kB audio:6611kB global headers:0kB muxing overhead 0.000000%

JFYI. :)

See ya,

tebasuna51
11th July 2006, 16:09
Nope, it can to do this using DirectShow since that the container have an audiostream.
You are right, but the use of DirectShowSource is always unpredictable in BeHappy because different configurations (SPDIF out, Aud-X, ...).

The sample.mp3 provided by Krizzz is encoded without problems using NicMPG123Source like decoder and ffmpeg encoder

danpos
11th July 2006, 16:35
You are right, but the use of DirectShowSource is always unpredictable in BeHappy because different configurations (SPDIF out, Aud-X, ...).

I'm agreed with you in this point. :)

See ya,

Robot
18th July 2006, 07:30
Is it possible to convert a 5.1 AAC file into a AC3 file that I can use in DVDLab?

I followed the install directions, but when I hit start I get this error:

Starting job theusvsjohnlennon_h720p_track2.aac->theusvsjohnlennon_h720p_track2.ac3
Error: BeHappy.AviSynthException: Required Avisynth 2.5
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

Thanks

tebasuna51
18th July 2006, 08:43
@Robot, in your log:
"Error: BeHappy.AviSynthException: Required Avisynth 2.5"

At first post of this thread:
"System requirements
...
* Microsoft .NET Framework Version 2.0
* Avisynth v2.56"

Robot
18th July 2006, 08:53
@Robot, in your log:
"Error: BeHappy.AviSynthException: Required Avisynth 2.5"

At first post of this thread:
"System requirements
...
* Microsoft .NET Framework Version 2.0
* Avisynth v2.56"

Yeah, I've downloaded both. :confused:

Do I need t do something else to connect Avisynth to BeHappy?

tebasuna51
18th July 2006, 10:27
Do I need t do something else to connect Avisynth to BeHappy?
After install AviSynth v2.56 restart your computer and run BeHappy.

For further analysis we need the .avs used ("Export AviSynth Script").

To decode aac 5.1 you need DirectShow properly configured (maybe ffdshow Audio Decoder with 6 chan 16 bit int output and "Don't use WAVEFORMATEXTENSIBLE header...")

Robot
18th July 2006, 11:27
I re-installed Avisynth and restarted. I get the same error. I exported the script.

########################################
#Created by BeHappy v0.1.5.526
#Creation timestamp: 7/18/2006 6:25:24 AM
########################################
#Source FileName:C:\Documents and Settings\J\Desktop\NTS\johnlennon\theusvsjohnlennon_h720p_track2.aac
#Target FileName:C:\Documents and Settings\J\Desktop\NTS\johnlennon\theusvsjohnlennon_h720p_track2.ac3
########################################

########################################
# [Source: AviSynth]
########################################
Import("C:\Documents and Settings\J\Desktop\NTS\johnlennon\theusvsjohnlennon_h720p_track2.aac")

EnsureVBRMP3Sync() # Some black magic to avoid desync

########################################
# [Encoder: ffmpeg AC3 @ 448 kbps]
########################################
6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last

Thanks

dimzon
18th July 2006, 15:03
Robot
Wich OS did You use?
Are you able to play obtained script via mplayerc?

alwa
18th July 2006, 19:38
[Source: AviSynth]
How is that possible? :confused: It's an aac-file, not an avs-file...
Try to use DierectShowSource or BassAudio, then it should work properly.

Robot
18th July 2006, 20:54
Robot
Wich OS did You use?
Are you able to play obtained script via mplayerc?

I use Windows XP

and I have no idea what the next thing means.
I'm a novice. :D

tebasuna51
19th July 2006, 00:13
In BeHappy [1] Source you must select DirectShowSource instead AviSynth after the input file.

dimzon
19th July 2006, 01:00
In BeHappy [1] Source you must select DirectShowSource instead AviSynth after the input file.
And don't forget about AAC splitter :D

dimzon
19th July 2006, 01:05
http://img232.imageshack.us/img232/274/aftenam4.png
Aften support (not tested yet, please report)

Robot
19th July 2006, 06:02
I'm lost. No matter what I do, I get this error:

Starting job theusvsjohnlennon_h720p_track2.aac->theusvsjohnlennon_h720p_track2.ac3
Error: BeHappy.AviSynthException: Required Avisynth 2.5
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

:confused:

nfm
19th July 2006, 06:07
Can somebody compile this app into one package with all plugins etc. I don't even know where to begin, everything is all over the place. :(

thuongshoo
19th July 2006, 06:54
@nfm : I often install K-lite codec pack , and plugin which is need for Behappy is at gotdotnet

tebasuna51
19th July 2006, 11:03
Aften support (not tested yet, please report)

Starting job Bueno.wav->Bueno_t2.ac3
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Aften.exe -v 0 -b 448 -m 1 -s 0 -cmix 1 -smix 2 -dsur 0 -dnorm 26 - "D:\Internet\AudioTest\aften\Bueno_t2.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException:
Bitrate must be: -b 448000

Edit: Valid values for bitrate only exact:
32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 Kb/s

dimzon
19th July 2006, 12:02
Starting job Bueno.wav->Bueno_t2.ac3
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Aften.exe -v 0 -b 448 -m 1 -s 0 -cmix 1 -smix 2 -dsur 0 -dnorm 26 - "D:\Internet\AudioTest\aften\Bueno_t2.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException:
Bitrate must be: -b 448000

Edit: Valid values for bitrate only exact:
32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 Kb/s
Ok, will be fixed tonight

marnix88
19th July 2006, 18:22
Is there a way to run BeHappy with commandline parameters or run FFmpeg with AviSynth without Behappy?

Don't get me wrong, Behappy does exacty what I need, but I'm creating a frontend for AVI to DVD and FFmpeg can't encode 5.1 channels correctly just by itself. If I have to use BeHappy to do the work, then it's going to take tons of 'SendKeys' to control it.

I thought I had figured it out with FFmpeg, but I don't. If I encode 5.1 channel 448kbps AC3 to 5.1 channel 384kbps AC3, then the center channel is moved to the front right channel.

What is BeHappy exactly doing to keep all the channels correct? I know it's using FFmpeg and AviSynth, but how is FFmpeg executed with the script to keep the channels in the correct place?

This is the AviSynth script Behappy gives me.

########################################
#Created by BeHappy v0.1.8.35345
#Creation timestamp: 19-7-2006 18:20:49
########################################
#Source FileName:D:\TestAudio.ac3
#Target FileName:D:\TestAudioEncoded.ac3
########################################

########################################
# [Source: NicAc3Source]
########################################
NicAc3Source("D:\TestAudio.ac3")

EnsureVBRMP3Sync() # Some black magic to avoid desync

########################################
# [Encoder: ffmpeg AC3 @ 384 kbps]
########################################
6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last

tebasuna51
19th July 2006, 19:58
What is BeHappy exactly doing to keep all the channels correct? I know it's using FFmpeg and AviSynth, but how is FFmpeg executed with the script to keep the channels in the correct place?
NicAc3Source("D:\TestAudio.ac3")
6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last
First line decode the ac3 to wav in correct wav order (L,R,C,LFE,SL,SR).

Last line, if there are 6 channels, re-order the channels from (L,R,C,LFE,SL,SR) to (L,C,R,SL,SR,LFE)

You can use Bepipe instead BeHappy with this command line:

Bepipe --script "NicAc3Source(^D:\TestAudio.ac3^).GetChannel(1,3,2,5,6,4)" | ffmpeg -i - -y -acodec ac3 -ab 384 "D:\TestAudioEncoded.ac3"
Or with new Aften encoder
Bepipe --script "NicAc3Source(^D:\TestAudio.ac3^)" | Aften -b 384000 - "D:\TestAudioEncoded.ac3"

marnix88
19th July 2006, 21:01
That works great!

Thank you very much, tebasuna51 :)

BigDid
22nd July 2006, 20:31
Error: System.IO.IOException:
Same for me here, waiting for an update :o
Dimzon, Thanks in advance.

Edit: Valid values for bitrate only exact:
32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 Kb/s
@Tebasuna
Valid values in what sense? Regarding Dolby specs? or non-compliant for soft players? SAP players?
I would like to DRC/Normalize AC3-6ch with a lower bitrate than original; ie: 352 or 288 ...actually limited to 320 or 256 with ffmpeg ...?
Thanks for the info.

Did

tebasuna51
22nd July 2006, 21:07
@BigDid, bitrate must be discrete values, see 5.4.1.4 frmsizecod and Table 5.18 at: ATSC Standard: Digital Audio Compression (AC-3), Revision A (http://www.dolby.com.cn/gb/assets/pdf/tech_library/a_52a.pdf)

Edit: Each ac3 frame (32 msec. if 48 KHz) must have a discrete value, the VBR method is obtained with different bitrate frames. This method is not well supported.

BigDid
22nd July 2006, 22:39
@BigDid, bitrate must be discrete values, see 5.4.1.4 frmsizecod and Table 5.18 at: ATSC Standard: Digital Audio Compression (AC-3), Revision A (http://www.dolby.com.cn/gb/assets/pdf/tech_library/a_52a.pdf)

So it's in the specs.

Edit: Each ac3 frame (32 msec. if 48 KHz) must have a discrete value, the VBR method is obtained with different bitrate frames. This method is not well supported.
I'll try to reformulate: Not being a "discrete value"(aka one one the supported bitrate from the specs) a Vbr resulting ac3 stream should not be well supported ...
Is it correct?
BTW I was speaking of CBR, not VBR but I suppose same conclusions applies.
Sorry to be dumb but I am not so... performant in audio matters :D
Thanks.

Did

Sakuya
26th July 2006, 03:38
I was wondering if anyone has achieved good results when converting from 6ch AAC to 6ch AC3 using BeHappy?

I converted my AAC file to a 6ch WAV file using audio2wav. Right now, I'm pondering whether I should add BeHappy's Digital Signal Processing. If I keep to the original, it won't change a thing and directly convert that to AC3 am I right?

tebasuna51
26th July 2006, 12:35
I was wondering if anyone has achieved good results when converting from 6ch AAC to 6ch AC3 using BeHappy?
Without problems using DirectShowSource and ffdshow Audio decoder properly configured.
I converted my AAC file to a 6ch WAV file using audio2wav. Right now, I'm pondering whether I should add BeHappy's Digital Signal Processing. If I keep to the original, it won't change a thing and directly convert that to AC3 am I right?
I don't understand your question.
If you use faad decoder (audio2wav) the 6ch wav (with WAVE_FORMAT_EXTENSIBLE header) can be converted directly to ac3 with Aften encoder.
If you want open the 6ch wav in BeHappy you need BassAudio
because WAVE_FORMAT_EXTENSIBLE header.

alwa
26th July 2006, 20:29
I don't understand your question.
I guess Sakuya wanted to know, whether there are disadvantages of BeHappy(Avisynth) instead of audio2wav(WAV) as source for the encoder(e.g. Aften).
Guessed answer :D : You are rigth, there should be no differences!

raquete
27th July 2006, 14:24
@ dimzon

why Aften adjust max 448K and not 640K?

thanks.

tebasuna51
28th July 2006, 12:14
@Dimzon
At http://www.un4seen.com/bass.html there are a new Bass version 2.3, but don't work with your BassAudio.dll for v2.2.

There are also info to upgrade from 2.2. Maybe is only:
"BASS_MusicGetName
This function is replaced by BASS_ChannelGetTags"
and is enough compile this new bassAudio.cpp (http://www.mytempdir.com/831665)

Thanks.

thuongshoo
30th July 2006, 09:24
Hi ! For nearly day, I can't convert files into mp4/AAC .
I use newest version of Behappy. All versions on my computer say like that. I also re-install .NET frame work but the bug is the same . I copied command line and run in cmd, the bug is the same . If I dont' use -rawpcm option, enc_aacplus work
Starting job [Star News]Shoo@ShowbizExtra(ArirangTV20060409)=bcnsmy=_audio.wav->[Star News]Shoo@ShowbizExtra(ArirangTV20060409)=bcnsmy=_audio.m4a
Found Audio Stream
Channels=2, BitsPerSample=16, SampleRate=48000Hz
enc_aacPlus.exe - "E:\[Star News]Shoo@ShowbizExtra(ArirangTV20060409)=bcnsmy=_audio.m4a" --rawpcm 48000 2 16 --mp4box --cbr 64000
Writing PCM data to encoder's StdIn
Finalizing encoder
Error: System.ApplicationException: Abnormal encoder termination 1
at BeHappy.Encoder.encode()
#### Encoder StdOut ####
Error - 2 input names specified, please check usage
********************************************************************
* AACPlus v2 Encoder (using Winamp 5.2 enc_aacplus.dll)
* Source timestamp Mon May 15 17:24:26 2006
* Build May 15 2006, 17:24:35
********************************************************************
* NOTE! enc_aacplus.dll must be into executable directory
* get it from Winamp 5.2 plugins directory
* tested on Winamp 5.2 Release Feb 23 2006 Full (Not Pro) version)
********************************************************************
Input file: -
Output file: E:\[Star News]Shoo@ShowbizExtra(ArirangTV20060409)=bcnsmy=_audio.m4a
SampleRate: 48000
ChannelCount: 2
BitsPerSample: 16
Bitrate: 64000
ChannelMode: Stereo
Encoder: aacPlus v2 (HE-AAC+PS)
Creating MP4...Can't create MP4!

buzzqw
30th July 2006, 13:49
just a suggestion try removing @,[,] from name

BHH

thuongshoo
1st August 2006, 08:35
I'm sorry ! above information isn't correct. aac_encplus don't work when I use --mp4box . --rawpcm still work
just a suggestion try removing @,[,] from name thanks ! I will try to do this

thuongshoo
1st August 2006, 15:38
NO !
Starting job da-sua_audio.ac3->da-sua_audio.m4a
Found Audio Stream
Channels=2, BitsPerSample=16, SampleRate=48000Hz
enc_aacPlus.exe - "E:\da-sua_audio.m4a" --rawpcm 48000 2 16 --mp4box --cbr 90675
Writing PCM data to encoder's StdIn
Finalizing encoder
Error: System.ApplicationException: Abnormal encoder termination 1
at BeHappy.Encoder.encode()
#### Encoder StdOut ####
Error - 2 input names specified, please check usage
********************************************************************
* AACPlus v2 Encoder (using Winamp 5.2 enc_aacplus.dll)
* Source timestamp Mon May 15 17:24:26 2006
* Build May 15 2006, 17:24:35
********************************************************************
* NOTE! enc_aacplus.dll must be into executable directory
* get it from Winamp 5.2 plugins directory
* tested on Winamp 5.2 Release Feb 23 2006 Full (Not Pro) version)
********************************************************************
Input file: -
Output file: E:\da-sua_audio.m4a
SampleRate: 48000
ChannelCount: 2
BitsPerSample: 16
Bitrate: 90675
ChannelMode: Stereo
Encoder: aacPlus v2 (HE-AAC+PS)
Creating MP4...Can't create MP4!


C:\Program Files\BeLight\behappy>enc_aacPlus.exe - "E:\da-sua_audio.m4a" --rawpc
m 48000 2 16 --mp4box --cbr 90675
********************************************************************
* AACPlus v2 Encoder (using Winamp 5.2 enc_aacplus.dll)
* Source timestamp Mon May 15 17:24:26 2006
* Build May 15 2006, 17:24:35
********************************************************************
* NOTE! enc_aacplus.dll must be into executable directory
* get it from Winamp 5.2 plugins directory
* tested on Winamp 5.2 Release Feb 23 2006 Full (Not Pro) version)
********************************************************************
Input file: -
Output file: E:\da-sua_audio.m4a
SampleRate: 48000
ChannelCount: 2
BitsPerSample: 16
Bitrate: 90675
ChannelMode: Stereo
Encoder: aacPlus v2 (HE-AAC+PS)
Creating MP4...Error - 2 input names specified, please check usage
Can't create MP4!

C:\Program Files\BeLight\behappy>enc_aacPlus.exe "E:\da-sua_audio.dat" e:\out.m
4a --rawpcm 48000 2 16 --mp4box --cbr 90675
********************************************************************
* AACPlus v2 Encoder (using Winamp 5.2 enc_aacplus.dll)
* Source timestamp Mon May 15 17:24:26 2006
* Build May 15 2006, 17:24:35
********************************************************************
* NOTE! enc_aacplus.dll must be into executable directory
* get it from Winamp 5.2 plugins directory
* tested on Winamp 5.2 Release Feb 23 2006 Full (Not Pro) version)
********************************************************************
Input file: E:\da-sua_audio.dat
Output file: e:\out.m4a
SampleRate: 48000
ChannelCount: 2
BitsPerSample: 16
Bitrate: 90675
ChannelMode: Stereo
Encoder: aacPlus v2 (HE-AAC+PS)
Creating MP4...Error - 2 input names specified, please check usage
Can't create MP4!

C:\Program Files\BeLight\behappy>enc_aacPlus.exe "E:\da-sua_audio.dat" e:\out.m
4a --rawpcm 48000 2 16 --cbr 90675
********************************************************************
* AACPlus v2 Encoder (using Winamp 5.2 enc_aacplus.dll)
* Source timestamp Mon May 15 17:24:26 2006
* Build May 15 2006, 17:24:35
********************************************************************
* NOTE! enc_aacplus.dll must be into executable directory
* get it from Winamp 5.2 plugins directory
* tested on Winamp 5.2 Release Feb 23 2006 Full (Not Pro) version)
********************************************************************
Input file: E:\da-sua_audio.dat
Output file: e:\out.m4a
SampleRate: 48000
ChannelCount: 2
BitsPerSample: 16
Bitrate: 90675
ChannelMode: Stereo
Encoder: aacPlus v2 (HE-AAC+PS)
Done

C:\Program Files\BeLight\behappy>

BigDid
1st August 2006, 17:25
Hello,

@Dimzon

Any news for the Aften interface fix?

http://forum.doom9.org/showthread.php?p=853494#post853494
http://forum.doom9.org/showthread.php?p=854674#post854674
http://forum.doom9.org/showthread.php?p=853509#post853509
:thanks:

Did

dimzon
1st August 2006, 18:27
Hello,

@Dimzon

Any news for the Aften interface fix?

http://forum.doom9.org/showthread.php?p=853494#post853494
http://forum.doom9.org/showthread.php?p=854674#post854674
http://forum.doom9.org/showthread.php?p=853509#post853509
:thanks:

Did
I'm sorry, I'm too busy IRL

Score Report Authentication
The Pearson VUE Testing System recorded the following information for this score report.
Exam Date: Friday, July 28, 2006 at 4:00 PM
Candidate: DMITRY ALEXANDROV
Candidate ID: 3715915
Registration #: 216581226
Exam Series: 070-536
Exam: TS: Microsoft® .NET Framework 2.0 - Application Development Foundation
Validation #: 642490061
Grade: pass
:p

BigDid
4th August 2006, 20:53
I'm sorry, I'm too busy IRL...
:p
Hi Dimzon,

Nevermind, work and money is always good to have; maybe jruggle will change it in aften.

Did

tebasuna51
6th August 2006, 00:33
@Dimzon, I know you are bussy, but one more thing for your todo list.

Detected in aften thread, seems NicAc3Source abort decoding ac3 44.1 KHz streams. The problem is in ReadFrame() function in m2audio_ac3.cpp:
...
// Check if the frame has proper length and BSI
if ((Length != FrameLength) || (_Flags != Flags) || (_Samplerate != Samplerate))
// Fatal error, unable to continue decoding
return false;
...
Ac3 44.1 KHz streams have two valids FrameLengths and abort when a frame with the second length arrive. Maybe we can replace the ReadFrame() function with this:
// Reads the next frame from the stream and decodes it into the framebuffer
bool m2AudioAC3Source::ReadFrame() {
int Sync; // synch info
int Length; // length of the current frame
int _Flags, _Samplerate, _Bitrate; // bit stream information
int BytesRead; // needed if last frame < previous frame

// Read next frame from stream
BytesRead = vfread(Stream, Frame, FrameLength);
Length = a52_syncinfo(Frame, &_Flags, &_Samplerate, &_Bitrate); // Get frame information

while (!Length) { // Check if we need synchronization
vfseek(Stream, 1 - FrameLength, SEEK_CUR); // Seek back in the stream
Length = FrameLength; // Try synchronization
Sync = Synchronize(Length, _Flags, _Samplerate, _Bitrate);

// Serious damage in the stream, mute frame
if (!Sync || Sync < 0) {
EmptyFrame(); // Mute frame
return true;
}

// Read frame
BytesRead = vfread(Stream, Frame, FrameLength);
Length = a52_syncinfo(Frame, &_Flags, &_Samplerate, &_Bitrate); // Get frame information
}

// Check if the frame have same length than previous
if (FrameLength != Length) {
vfseek(Stream, 0 - FrameLength, SEEK_CUR); // Go back in the stream
FrameLength = Length;
BytesRead = vfread(Stream, Frame, FrameLength); // And read the correct FrameLength
}

if (BytesRead != FrameLength) {
EmptyFrame(); // Error at the end of the stream, mute frame
return true;
}
// Check if the frame has proper BSI. With ac3 VBR, bitrate can be different
if ((_Bitrate != Bitrate) || (_Flags != Flags) || (_Samplerate != Samplerate)) {
EmptyFrame(); // Error but may be is better to continue, mute frame
return true;
}
// return false; // Fatal error, unable to continue decoding ***EDITED***

// Decode frame
if (!DecodeFrame()) EmptyFrame();
return true;
}
Thanks.

Edit: Continue decoding instead abort when a invalid frame is detected. See this post (http://forum.doom9.org/showthread.php?t=114968)

thuongshoo
7th August 2006, 11:40
oh ! my bug ? I can't use Behappy longer ! Mu computer doesn't support 8.3 file name. Is this a reason ?

dimzon
7th August 2006, 15:39
oh ! my bug ? I can't use Behappy longer ! Mu computer doesn't support 8.3 file name. Is this a reason ?
Yes! This is 100% reason - I'm converting path's to 8.3 format when calling mp4box to wrap AAC into MP4 container
So just possible solution in your case is
Place BeHappy in 8.3 compaible folder (for example c:\BeHappy)
Use short target filenames (for example audio.aac)
Place temp folder to 8.3 compatible (for example c:\temp)

thuongshoo
8th August 2006, 16:02
I rarely run old game so supporting 8.3 filename will cause my computer is slow .
dimzon ! Do you have any method to avoid this bug although that computer doesn't support 8.3 filename :D

koz
8th August 2006, 19:06
Hi,
First may I congratulate the author(s) for a great set of tools.

I managed to get Behappy to do what I needed - convert an MP3 file to the AACplus M4A format

But I need to get this done via the command line.

My attempts at using BePipe.exe dont seem to have it quite right:

Here's what I'm trying:

BePipe.exe --script "import(^mymp3.avs^)" | enc_aacPlus.exe blugg.m4a --cbr 24000 --mp4box

THough i feel I need to specify the name of the interim .wav file

mymp3.avs contains:

########################################
#Created by BeHappy v0.1.9.5241
#Creation timestamp: 25/07/2006 16:00:20
########################################
#Source FileName:C:\Documents and Settings\ME\My Documents\TEST\mymp3.mp3
#Target FileName:C:\Documents and Settings\ME\My Documents\TEST\mym4a.m4a
########################################

########################################
# [Source: NicMPG123Source]
########################################
NicMPG123Source("C:\Documents and Settings\ME\My Documents\TEST\mymp3.mp3")

EnsureVBRMP3Sync() # Some black magic to avoid desync

########################################
# [Encoder: CT aacPlus v2, CBR @ 24.32 kbit/s, Joint Stereo]
########################################


Should this be edited to add the next M4a stage from enc_aacPlus.exe

Any help or pointers with this would be hugely appreciated.

Thanks
Koz

koz
8th August 2006, 19:39
OK _ I;m going to answer my own question

Here's what worked _ To convert an MP3 file to M4A using BePipe

BePipe.exe --script "import(^mymp3.avs^)" | enc_aacPlus.exe - "mym4a.m4a" --rawpcm 44100 1 16 --mp4box --cbr 24320


BUT - I really need to get the MP3 ID3 tags and insert the Meta data into the M4A file.

Can enc_aacPlus.exe do this? - Notably Title, Description and Genre fields

many thanks :) Koz
:thanks:

tebasuna51
8th August 2006, 20:25
Here's what worked _ To convert an MP3 file to M4A using BePipe

BePipe.exe --script "import(^mymp3.avs^)" | enc_aacPlus.exe - "mym4a.m4a" --rawpcm 44100 1 16 --mp4box --cbr 24320
Bepipe send wav header and PCM data, then enc_aacPlus can produce a initial click because the header is treated like rawpcm.
BUT - I really need to get the MP3 ID3 tags and insert the Meta data into the M4A file.

Can enc_aacPlus.exe do this? - Notably Title, Description and Genre fields
Enc_aacPlus can't do this job.

koz
8th August 2006, 20:40
Thanks for the reply tebasuna51.

I found an app called neroAacTag.exe which does the job I needed, so I created a .bat file to handle the whole process, which seems to work fine:

Here it is:

BePipe.exe --script "import(^mymp3.avs^)" | enc_aacPlus.exe - "mym4a.m4a" --rawpcm 44100 1 16 --mp4box --cbr 24000

neroAacTag.exe mym4a.m4a -meta:artist="Koz" -meta:genre="Podcast" -meta:title="Kozcast #26" -meta:comment="A test by Koz which got converted to M4a using the excellent BeHappy"
pause
exit


Running this worked fine (then asked for a keypress beofre exiting)


Is it possible to create a commercial system using these tools?

thx
koz

dimzon
9th August 2006, 09:37
Is it possible to create a commercial system using these tools?
No! It's prohibited by
1) Nero licence
2) WinAmp license

MacAddict
11th August 2006, 16:00
Great program! Thx for your efforts.

Any chance of also having BeHappy set to 'low priority' like the encoders get set? The option would be nice nut not a necessity :-)

fight2win
15th August 2006, 17:42
for encoding ac3 to aac via megui, where ac3 is 192 kbps ac3 (cantonese original mono), should i go for keep original channels or convert to mono? i use force decoding via dshow, and in ac3filter, "AS Is" decoding...

shon3i
15th August 2006, 21:18
Just leave is as, but after encoding see what happens, is file real mono or is upmixed to stereo.

fight2win
16th August 2006, 12:31
please tell us proper way of encoding ac3/dts to aac, in which proper gain/volumes and all other effects are properly maintained, please...:confused:

Doom9
17th August 2006, 12:12
@dimzon: looking at people reporting low audio in megui I decided to have a look at the avisynthaudioencoder and compare it with what the trusty old besweet does.
I found the following differences:
besweet performs DRC. We now have DRC in nicaudio as well so I think it makes sense to use it.
besweet uses gain (be it hybrid or postgain, depending on the audio format), whereas the increase volume option in megui is a 100% normalization. I suspect we'd get better results by analyzing the samples read during the first pass, and compute a DB gain, then write a new script with the amplifydb command in it.
Do you think that's doable?

dimzon
17th August 2006, 12:20
I suspect we'd get better results by analyzing the samples read during the first pass, and compute a DB gain, then write a new script with the amplifydb command in it.

I believe Normalize()=="analyzing the samples read during the first pass, and compute a DB gain, then write a new script with the amplifydb command in it"

Actually I think we need to write Yet another Avisynth filter to perform non-linear DRC (like besweet's DSPguru/Ligh/Tera)

add:
this is sample http://www.ligh.de/software/booster.zip

shon3i
17th August 2006, 12:34
No we need only some scaner like aacgain or avsamp or foobar replay gain who will preformed RG over aac, aslo we can simulate HybridGain using first normalize than RG.

dimzon
17th August 2006, 12:39
No we need only some scaner like aacgain or avsamp or foobar replay gain who will preformed RG over aac, aslo we can simulate HybridGain using first normalize than RG.
Sorry, I really don't understand you!
AFAIK Normalize perform scan and compute Max peak value at first pass. Than it compute amplification factor as (factor * AbsoluteMax/FoundMax) and perform amplification on second pass...

shon3i
17th August 2006, 12:45
Sorry, I really don't understand you!
AFAIK Normalize perform scan and compute Max peak value at first pass. Than it compute amplification factor as (factor * AbsoluteMax/FoundMax) and perform amplification on second pass...
Just you need scaner like from foobar's ReplayGain or something like HybridGain from BeSweet, or little small app called aacgain (http://www.rarewares.org/files/aac/aacgain_1_5.zip) which preform RG over aac but have same scaner like foobar (find's same db and than amplyfy it but works only with stereo).

Doom9
17th August 2006, 13:11
Actually, Hybridgain does the following: apply a 10dB gain at the input, encode while finding the maximum possible gain, then apply that gain as postgain after encoding.
If normalize was the same as finding and applying the maximum gain , why are the results so different in between using besweet vs behappy?

tebasuna51
17th August 2006, 13:32
@dimzon: looking at people reporting low audio in megui I decided to have a look at the avisynthaudioencoder
I think, like Kurtnoise (http://forum.doom9.org/showthread.php?p=864124#post864124), is a player problem not with encoder.
and compare it with what the trusty old besweet does.
I found the following differences:
besweet performs DRC.
We now have DRC in nicaudio as well so I think it makes sense to use it.
Of course must be a option use/not use DRC.
Boost (non-linear DRC) can be a option, but I never recommend use boost transcoding ac3 -> aac.
besweet uses gain (be it hybrid or postgain, depending on the audio format), whereas the increase volume option in megui is a 100% normalization. I suspect we'd get better results by analyzing the samples read during the first pass, and compute a DB gain, then write a new script with the amplifydb command in it.
Do you think that's doable?
AviSynth Normalize do this job (a first pass to compute a DB gain and a second pass to apply)

@shon3i ReplayGain don't work properly with ac3 5.1 like I say in this post (http://forum.doom9.org/showthread.php?p=864220#post864220)

I make many test with AviSynth Normalize and never the aac output volume is less than ac3 input volume.

shon3i
17th August 2006, 13:42
@shon3i ReplayGain don't work properly with ac3 5.1 like I say in this post

I make many test with AviSynth Normalize and never the aac output volume is less than ac3 input volume.That is true but when i play for example DVD via PowerDVD or other DVD players ac3 is more louder like is aac after this RG, aslo AutoGordianKnot use some Normalize over mp3 which generate very loud files, like besweet after HybridGain. Somebody told me that aac can't be used with HybridGain because aac don't have RG or post gain, both CT and Nero devs are negate that.

in this case RG works very good.

dimzon
17th August 2006, 16:01
That is true but when i play for example DVD via PowerDVD or other DVD players ac3 is more louder
Maybe You have Boost (non-linear DRC) option activated? Sometimes this option has some "brand" name like "Night mode" etc

tebasuna51
17th August 2006, 16:47
That is true but when i play for example DVD via PowerDVD or other DVD players ac3 is more louder like is aac after this RG,
This is a player problem, and can affect to many people but not to everybody. If I play ac3 with Ac3Filter configured to amplify the signal +20 dB of course I play the ac3 more loud.
aslo AutoGordianKnot use some Normalize over mp3 which generate very loud files, like besweet after HybridGain. Somebody told me that aac can't be used with HybridGain because aac don't have RG or post gain, both CT and Nero devs are negate that.
HybridGain is developed to prevent clips in encoder phase: if source is 100% (0 dB) normalized (PreGain), some samples can be encoded over 100% (a good encoder can't do this, but may exists < +2dB).
Then HybridGain is a PreGain limited (< 100%), and after a PostGain to reach the 100% (or less) in formats than accept this.

PreGain 100% is equal to HybridGain +- 2 dB, then HybridGain is more accurate than PreGain/Normalize but don't justify any volume difference. And any difference can't be previewed before the encode phase (with RG over the ac3 input)

dimzon
17th August 2006, 16:52
If I play ac3 with Ac3Filter configured to amplify the signal +20 dB
It mean You have (AmplifyDb(20) + Limiter)==Boost(Non-Linear DRC)

shon3i
17th August 2006, 16:56
If I play ac3 with Ac3Filter configured to amplify the signal +20 dB of course I play the ac3 more loud.
Yes but my ac3 filter version 1.01 plays ac3 like PowerDVD 5/6/7, settings are default, which means ac3 something about +10db louder

@all can somebody check aacgain/avsamp (AviSynth ampifler) metod because works same as RG from foobar.

tebasuna51
17th August 2006, 17:07
It mean You have (AmplifyDb(20) + Limiter)==Boost(Non-Linear DRC)
Nope. Is only a example.

Don't worry (be happy) with this problem. Is not a encoder problem, forget boost, non-linear DRC, ...

We need an aac 5.1 decoder, a new Bepipe (without header errors like first BeHappy) before than boost.

dimzon
17th August 2006, 17:18
We need an aac 5.1 decoder, a new Bepipe (without header errors like first BeHappy) before than boost.
Hmmm...
Why not just use DShow to decode 5.1 AAC? Actually I never transcode FROM AAC IRL...
Why do You need bePipe? Do you want to write batches?

shon3i
17th August 2006, 17:37
Why not just use DShow to decode 5.1 AAC? Actually I never transcode FROM AAC IRL...Me too, but for ppl's who want back aac->ac3 or something else aac conversations will be usefull, for example i have stereo speakers and in decoder is set to dominix, so i must always disable that when i want transcode.

before than boost.We not need boost, we need better first pass scener

tebasuna51
17th August 2006, 18:08
Hmmm...
Why not just use DShow to decode 5.1 AAC? Actually I never transcode FROM AAC IRL...
I can use DShow (I need change player settings with encoder settings and after turn to player settings), but I can't say to other people how to make that, because I don't know their DShow configuration.
You don't have problems with MEGUI DShow input?
Why do You need bePipe? Do you want to write batches?
Yeah... I like batches, not GUI's:)

tebasuna51
17th August 2006, 18:17
We not need boost, we need better first pass scener
Scanner, I suppose.
shon3i, really Normalize work fine. :)

shon3i
17th August 2006, 20:40
really Normalize work fine. Yes and i don't say anything about normalize because do great work, but ppl and me whan't very loud files like AutoGK mp3 files when playing, because PowerDVD gain ac3 when playing. Aslo HybridGained mp3 files are about 5db differents then only normalized mp3's

tebasuna51
17th August 2006, 22:58
Yes and i don't say anything about normalize because do great work, but ppl and me whan't very loud files like AutoGK mp3 files when playing, because PowerDVD gain ac3 when playing.
My PowerDVD 6 player offer this options:
- Quiet Environment: experience the full dynamic range of Dolby Digital Surround. (== without DRC)

- Normal Environment: experience the compressed dynamic range of Dolby Digital Surround. (== with DRC)

- Noisy Environment: experience boosted sound. Strongly recommended for notebook users. (== with DRC boosted)

Do you want make your audio something boosted permanently?
This can't be recovered, after encoded you never can "experience the full dynamic range of Dolby Digital Surround" in a Quiet Environment. This options are for player time.

Use foobar, bsplayer (with ffdshow) with common DSP's for all codecs to listen ac3 and aac.
Aslo HybridGained mp3 files are about 5db differents then only normalized mp3's
Sorry, the only way to obtain a file 5 dB more loud than a normalized is with clips or distort.

shon3i
18th August 2006, 16:14
Use foobar, bsplayer (with ffdshow) with common DSP's for all codecs to listen ac3 and aac.
I will try thanks for tip.

Sorry, the only way to obtain a file 5 dB more loud than a normalized is with clips or distort.
It is with clips, but file is hard limited so then there is no distorsions.

EDIT:

BTW New package (http://www.box.net/public/1hvgoifeyd) is out, changelog (http://forum.doom9.org/showpost.php?p=829754&postcount=259)

fight2win
22nd August 2006, 05:57
aud-x encoding has been updated to v1.23, i think v1.2.0 is being used in behappy, can someone please update that?

dimzon
22nd August 2006, 22:22
new Aften configuration dialog (in progress)
http://img206.imageshack.us/img206/5256/aftengq8.png

raquete
23rd August 2006, 00:17
seems cool dimzon.

:thanks:

BigDid
23rd August 2006, 03:48
new Aften configuration dialog (in progress)
Nice, I will have a dozen more possibilities to get confused (joke). Hurry up for the release (re-joke) :D
Continue the good work, :thanks:

Did

anonymez
19th September 2006, 12:56
couple of suggestions if i may, been using behappy for a while but 2 things that'll make it a little easier to use for those of us that use it often :)

- a 'clear all' button in the queue tab
- when input file is selected, output file name should be adjusted accordingly (otherwise when loading multiple files it just writes over the previous job)

thx dimzon :)

NorthPole
7th October 2006, 00:56
@tebasuna51

My first C# program, using enc_AudX_CLI.cs scheme I change the body code to obtain Wav2mono.exe.

This program can split in mono wav's any stereo or 6 channel wav accepting STDIN input. Then can be used with BeHappy to obtain mono wav´s like output instead Wav writer, this replace a BeSweet/BeLight functionality not supported yet by BeHappy.

Tried using wav2mono by piping directly from a 6ch flac file to wav2mono output files with the following command line.


c:\<path>\flac.exe -d -s test.flac -c | c:\<path>\wav2mono.exe - ch.wav

runs ok but output is just pulsing static

if i run without stdin directly from a wav file it works fine.

here is the info I got by running wavinfo.exe on each file. The first one is the front center channel from the flac stdin file that sounds bad.
(Note: the source flac file plays fine in fb2k.)

C:\Temp>wavinfo ch_fc from flac.wav

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
File:
Name: ch_fc.wav
File Size: 27464079
Format:
Type: Microsoft PCM
Channels: 1
Sample Rate: 48000 Hz
Avg bytes/sec: 0
Block Align: 2 bytes
Bit Width: 16
Channel Mask: 0x004
Data:
Start: 44
Data Size: 27464035
Samples: 13732017
Playing Time: 286.08 sec
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

here is the fc.wav generated from a wave file without stdin

C:\Temp>wavinfo ch_fc from wave.wav

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
File:
Name: ch_fc.wav
File Size: 27474282
Format:
Type: Microsoft PCM
Channels: 1
Sample Rate: 48000 Hz
Avg bytes/sec: 0
Block Align: 2 bytes
Bit Width: 16
Channel Mask: 0x004
Data:
Start: 44
Data Size: 27474238
Samples: 13737119
Playing Time: 286.19 sec
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I have been using bepipe to generate 3 stereo files but you program runs faster :D

the bepipe code is

c:\<path>\bepipe.exe --script GetChannel("DirectShowSource(^6chtest.flac^), 1, 2)" > flfr.wav
c:\<path>\bepipe.exe --script GetChannel("DirectShowSource(^6chtest.flac^), 3, 4)" > clfe.wav
c:\<path>\bepipe.exe --script GetChannel("DirectShowSource(^6chtest.flac^), 5, 6)" > slsr.wav

Any ideas?

NorthPole
7th October 2006, 02:51
@dimzon

Sorry about being off topic, probably should have put these posts in the bepipe thread.

@tebasuna51

this bepipe code works OK

c:\<path>\bepipe.exe --script "DirectShowSource(^6chtest.flac^)" | c:\<path>\wav2mono.exe - ch.wav

tebasuna51
7th October 2006, 03:32
@NorthPole
Yes, I test BeHappy/Bepipe/foobar (http://forum.doom9.org/showthread.php?p=876671#post876671) -> Wav2mono and work Ok
Also:

flac.exe -d -s test.flac -c > test.wav
wav2mono.exe test.wav
But:

flac.exe -d -s test.flac -c | wav2mono.exe - ch.wav
don't work. Seems lose some info and mix values and channels.
I don't know what is the problem.

tebasuna51
10th October 2006, 16:25
1) wav2stereo
I have been using bepipe to generate 3 stereo files but you program runs faster :D

the bepipe code is

c:\<path>\bepipe.exe --script GetChannel("DirectShowSource(^6chtest.flac^), 1, 2)" > flfr.wav
c:\<path>\bepipe.exe --script GetChannel("DirectShowSource(^6chtest.flac^), 3, 4)" > clfe.wav
c:\<path>\bepipe.exe --script GetChannel("DirectShowSource(^6chtest.flac^), 5, 6)" > slsr.wav

Any ideas?
I can't make work:

flac -d -s -c 6chan.flac | wav2mono - ch.wav

(works with 2chan.flac)
But maybe this can help:
bepipe --script"DirectShowSource(^6chtest.flac^)" | wav2stereo - st.wav
Also wav2stereo can work with foobar like flac decoder.
The output is st_FLFR.wav, st_CLFE.wav and st_SLSR.wav.

2) wav2mono v1.0.0.2
Some changes, now accept 2/3/4/5/6 channels and a new parameter:
-ignorelength If present the length in wav header is ignored, useful for wav > 2/4 GB. Problem: extrachunks at end of file treated as data (Default in previous version, now default use the datalength)

Now the wrong header and the final extrabytes generated by Bepipe are ignored by default.

3) WavNotEx
Testing AviSynth v2.5.7 RC-1 with Bepipe I see the method WavSource() works with wav 8/16/24/32 bits int and with 32 bits float but not with header WAVE_FORMAT_EXTENSIBLE.

I make a instantaneous wav patcher to permit the use for WavSource()-AviSynth, SoftEncode, BeSweet, and maybe another software not WAVE_FORMAT_EXTENSIBLE header compliant.

Example, is know than Faad decoder make this kind of wav output and work with:
Faad -o wav_ex.wav input.aac
WavNotEx -p -q wav_ex.wav
Bepipe --script "WavSource(^wav_ex.wav^).Normalize()" | aften -b 448 - output.ac3
WavNotEx -q wav_ex.wav

4) The three utils, sources, etc. in WavUtil.zip (http://rapidshare.com/files/3572747/WavUtil.zip.html) (only 23 KB)

5) @Dimzon
Like you can see there are many uses for Bepipe. The AviSynth v2.5.7 RC-1 test (new output 32 bits float) is not possible with BeHappy because AvisynthWrapper.dll convert always the audio to 16 bit int.

With Bepipe I get outputs 32 bits int/float

NorthPole
14th October 2006, 13:58
4) The three utils, sources, etc. in WavUtil.zip (http://www.mytempdir.com/982606) (only 23 KB)

5) @Dimzon
Like you can see there are many uses for Bepipe. The AviSynth v2.5.7 RC-1 test (new output 32 bits float) is not possible with BeHappy because AvisynthWrapper.dll convert always the audio to 16 bit int.

With Bepipe I get outputs 32 bits int/float

@tebasuna51,

Thanks for the wav2mono fixes. I'll try them out along with the other utillities...let you know if I have any problems.

@dimzon,

I agree with tebasuna that bepipe is a very useful tool that you can include in a batch file as needed.

sjchmura
23rd October 2006, 20:41
.GRF/DirectShowSource as input....

I wanted to use BeHappy to use a .GRF file with the AVISynth (stable release) DirectShowSource so I could encode with FFDSHOW HFRT

So under Graphedit:

DTS/AC3 -> FFDSHOW (HFRT eneabled) -> WAVEOUT -> File Writer (So my iPOD gets 5.1 HFRT :)

How can I impliment the .GRF under BeHappy - am I missing something simple???

tebasuna51
22nd November 2006, 12:17
@Dimzon. I see your recent posts. If you have some time for us now, here is my petition list. Thanks.

- The last Bepipe version have the same bugs detected for early BeHappy:
Bugs
The last buffer send to the encoder can be incomplete but is send complete, then there are extrabytes at end.
The RiffChunkSize in wav header is incorrect.
About the first bug you wrote:
Finally I found a bug in Microsoft VfW AVIStreamRead function - it still "read" data even if EOF is alredy occured....
and the second is solved also in BeHappy.
We need a new version or the sources (in the web there are only the previous version source .NET FrameWork v1.1)

- The new encoder options of Aften must include now DRC (last versions is only for test but the syntax can be definitive):
[-dynrng #] Dynamic Range Compression profile
0 = Film Standard
1 = Film Light
2 = Music Standard
3 = Music Light
4 = Speech
5 = None (default)

- We need an AviSynth aac 5.1 decoder instead use the problematic DirectShowSource method. Maybe the new BassAudio v2.3 libraries can do, but the bassaudio.dll plugin work only with v2.2.

- The next AviSynth v2.5.7 not only accept 32-Float wav, also can output 32-Float. Actually the AvisynthWrapper.dll limit the audio output to 16 bit int.

BigDid
22nd November 2006, 21:27
@Dimzon...

- The new encoder options of Aften must include now DRC (last versions is only for test but the syntax can be definitive):
[-dynrng #] Dynamic Range Compression profile
0 = Film Standard
1 = Film Light
2 = Music Standard
3 = Music Light
4 = Speech
5 = None (default)
...
Hi Dimzon,

+1 for the DRC in Aften.
Even if exists with the NIC audio source with DRC, I believe the Aften option is an improvement and also it can be tuned :)

Did

miztadux
29th November 2006, 14:10
Hello,

I'm new to BeHappy.
The main reason I am interested is being able to use the same avs script used to edit the video to encode the audio.

First of all I'd like to thank you for it, it seems to be a really well done app, and i'm looking forward to use it in replacement of besweet (even if dimzon's plugins enabled besweet to stay somewhat up-to-date, thank you for that too!)

After some testing, i got a question and a problem to submit:

Question:
My goal is to reuse, in BeHappy, a .avs full of "duplicateframe" and "trim" to get an audio in perfect sync with the edited video from this very script. (I used to open it in vdub to extract uncompressed audio, i hope behappy can help me avoid this "uncompressed data to hard drive" step).
I tried it but "trim" can only work if there's a video part in the script, so i cannot use a script with audio source only...
My Idea was to use something like this as an avisynth source in behappy:
vid = blankclip(fps=23.976, length=154202)
aud = NicAc3Source('en.ac3')
audiodub(vid, aud)

trim(X,Y)...
duplicateframe...

My question is:
How would you do this ?
Does this way (using a blankclip+audiodub) seems OK ?
(i never actually ran this test, see bellow... )

Problem:
When I was happy with the generated avs/preview I tried to actually convert something, and there I was bitten by a 64bit .Net problem discussed here (http://forum.doom9.org/showthread.php?t=106740) for MeGUI (ok, after some experiences i now know that 64bit windows isn't supported anywhere):

With default compiler options, the .net exe will be re-compiled to 64bit on a 64bit host, appart from affecting the precision of floating point calculations (and maybe performance) it now generates an error when trying to load a 32bit dll.

Long story short, i was able to run behappy after a little "corflags.exe /32BIT+ BeHappy.exe" (even tho the 350MB sdk pack took forever to download at the 50kB/s ms would allow me to use...and left me with no more time to test the app.)
But the linked post about MeGui suggests that adding a compiler option would solve this problem once and for all:
The solution is to add /platform:x86 to the C# compiler options.

Sorry if this problem was already reported here, i failed to find it.


Thanks again for this great app!

Priyatam
27th February 2007, 03:46
Starting job Lucia.mp3->Lucia.ac3
Found Audio Stream
Channels=2, BitsPerSample=16, SampleRate=44100Hz
Aften.exe -v 0 -b 448 -m 1 -s 0 -cmix 0 -smix 0 -dsur 2 -dnorm 31 - "D:\Songs\Lucia.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: The pipe has been ended.


i'm getting this error when trying to convert mp3/wmv to ac3. can anyone help me plz

BigDid
27th February 2007, 06:08
i'm getting this error when trying to convert mp3/wmv to ac3. can anyone help me plz

Hi, works:
Starting job Essai448KbpsCutNormEss.mp3->Essai448KbpsCutNormEss vers ac3.ac3
Found Audio Stream
Channels=1, BitsPerSample=16, SampleRate=48000Hz
Aften.exe -v 0 -b 448 -m 1 -s 0 -cmix 0 -smix 0 -dsur 2 -dnorm 31 - "J:\Audios progs\Essai448KbpsCutNormEss vers ac3.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
for directshow source and Nic Mpg123 source,
With Aften 0.06 from last Kurtnoise build,
Behappy 0.1.9.5241 (20060719 package).

Did

Chumbo
3rd March 2007, 02:30
new Aften configuration dialog (in progress)
http://img206.imageshack.us/img206/5256/aftengq8.png
Was wondering if this is still in the works? If so, may I ask for a "wish feature" please? Increase the top VBR from 448 to 1024? Many thanks. :)

tebasuna51
3rd March 2007, 03:25
The actual interface is:
http://img91.imageshack.us/img91/5241/aftenbehgx2.png (http://imageshack.us)
You can see the Quality parameter for VBR encoding go to 1023, like say the Aften specs:
[-q #] VBR quality
A value 0 to 1023 which corresponds to SNR offset, where
q=240 equates to an SNR offset of 0. 240 is the default value.

For CBR encoding the up limit is 640 Kb/s

There are other important wished features like:
Dynamic Range Compression
-readtoeof (http://forum.doom9.org/showthread.php?p=962477#post962477)

but seems Dimzon is missing and the new interface must wait.

Chumbo
3rd March 2007, 07:10
Ah, thank you. Not getting enough sleep. Yeah it was the command parameters that triggered my asking this actually. ;) I got the two mixed up, so sorry about that.

I meant to ask for CBR to 640Kbps. Okay, now time to go to sleep. ZZZzzz...

Chumbo
3rd March 2007, 20:43
I was able to find the source code, change the maximum CBR setting to 640 and recompile. I hope you find this useful and that it was okay to do this. Attached is the modified .exe file.

[EDIT]removed attachment. See new mod in a later post.

Mtz
4th March 2007, 18:36
Can you compile to support the latest version of aften?
http://forum.doom9.org/showthread.php?p=947643#post947643

Chumbo
4th March 2007, 21:27
Can you compile to support the latest version of aften?
http://forum.doom9.org/showthread.php?p=947643#post947643
I looked at the aften source code and it does allow for piping, so I'm not sure why that's happening.

I wanted to switch the input order back to how it used to be, i.e., output var first and input last. However, I'm unable to get the dang thing compiled using the latest build.

I've not used Intel's compiler so I'm not sure what's causing this this. Anyone who can point me in the right direction please would be greatly appreciated.

The source project files were kindly provided by wisodev here (http://forum.doom9.org/showthread.php?p=961941#post961941).

I'm not sure how those dpi files are supposed to be created is my problem.

xilink: executing 'link'
Creating library output/aften.lib and object output/aften.exp
a52enc.c
d:\PROGRA~1\Intel\Compiler\C__~1\9.1\Ia32\Bin\profmerge: no .dyn files to merge.

ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/a52enc.c (code 1)
bitalloc.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/bitalloc.c (code 1)
bitio.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/bitio.c (code 1)
crc.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/crc.c (code 1)
dynrng.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/dynrng.c (code 1)
exponent.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/exponent.c (code 1)
filter.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/filter.c (code 1)
mdct.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/mdct.c (code 1)
util.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/util.c (code 1)
window.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/window.c (code 1)
exponent_common.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../libaften/exponent_common.c (code 1)
Fatal error cannot open "output/a52enc.obj"
xilib: error: problem during multi-file optimization compilation (code 1)
xilib: error: problem during multi-file optimization compilation (code 1)
aften.c
d:\PROGRA~1\Intel\Compiler\C__~1\9.1\Ia32\Bin\profmerge: no .dyn files to merge.

ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../aften/aften.c (code 1)
opts.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../aften/opts.c (code 1)
wav.c
ERROR: feedback file "output\pgopti.dpi" missing.
compilation aborted for ../aften/wav.c (code 1)
Fatal error cannot open "output/aften.obj"
xilink: error: problem during multi-file optimization compilation (code 1)
xilink: error: problem during multi-file optimization compilation (code 1)

tebasuna51
5th March 2007, 01:09
Can you compile to support the latest version of aften?
Please test this version BeHappy_Aften449 (http://www.mytempdir.com/1241884).

The interface is changed to:
http://img152.imageshack.us/img152/7558/behappyaften449im7.png (http://imageshack.us)

Changes:
1) CBR is rounded to a valid value when is send to Aften (see AftenEncoder.cs). Upper limit extended to 640 Kb/s.

2) Dinamic Range Compression instead BandWidth

3) Read to End of File instead Selectively use 256-point MDCT

First test with aften rev449 seems ok:
Starting job J6.wav->J6.ac3
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Aften.exe -v 0 -b 448 -m 0 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "G:\J6.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete

Chumbo
5th March 2007, 01:42
Thanks for doing that. It's also real easy to change the max 448 to 640 in AftenEncoder.cs. Just replace the two 448 values with 640. That way the support for 640kbps is available via Aften. :)

[EDIT] @tebasuna51
Your copy works great. I recompiled after I set the aften max back to 640 and it did not stop with the "pipe has ended" io exception message. Nice job. And nice job on the new options too. :) Do you want me to attach my version with the 640kbps cbr or do you want to just recompile yours and update the link above?

tebasuna51
5th March 2007, 10:46
Thanks for doing that. It's also real easy to change the max 448 to 640 in AftenEncoder.cs. Just replace the two 448 values with 640. That way the support for 640kbps is available via Aften. :)

[EDIT] @tebasuna51
Your copy works great. I recompiled after I set the aften max back to 640 and it did not stop with the "pipe has ended" io exception message. Nice job. And nice job on the new options too. :) Do you want me to attach my version with the 640kbps cbr or do you want to just recompile yours and update the link above?

My initial version have already the CBR limit to 640 (only the initial default remain at 448). You can see the image at 437 Kb/s far of right limit (640).

Chumbo
5th March 2007, 19:17
Very cool, thanks.

Deckard2019
5th March 2007, 21:34
First test with aften rev449 seems ok:
It works for me too :
Starting job aud.avs->aud.ac3
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Aften.exe -v 0 -b 640 -m 0 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "D:\aud.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete

But I don't know if these settings are ok for a DD+ source.
What about LFE for instance ? Is channel mapping ok ?

Thank you tebasuna51 ...

tebasuna51
6th March 2007, 01:31
But I don't know if these settings are ok for a DD+ source.
Of course is not DD+ compliant (6 Mb/s, 13.1 channels,...)
What about LFE for instance ?
If input is 6 channel only can be 3/2.1 then LFE is included.

Really Aften have many parameters, only the habitual/important are present now.
Is channel mapping ok ?
Of course, if sources are correct mapped the output is also correct.

Chumbo
7th March 2007, 06:17
I added to the mods made by tebasuna51. I basically added the features I would use a lot:
- added Delete All to quickly remove all the jobs except the one that is processing
- added check box to allow you to keep any output created if you decide to abort early or if an error occurs

I hope this is helpful. Please test it out. Thank you.

The Aften config is different, so make sure to go in and set it to your liking. I just left my defaults in.

[EDIT] removed attachment. See updated mod in later post.

yonta
7th March 2007, 10:06
@Chumbo
Thank you for the mods. Should be very useful to us all.

One request:
Can you make BeHappy remember last window position and size?
BeHappy starts out with a too big window and at random positions. This is sometimes very annoying.

Chumbo
9th March 2007, 03:48
One request:
Can you make BeHappy remember last window position and size?
BeHappy starts out with a too big window and at random positions. This is sometimes very annoying.
Yeah, I hate this too actually. I just had some time, so I put it in for me as much as you. :)

changes:
- default window size is 800x400 now
- once you close it it'll save the size and position state

File includes exe, changed code and sample of new section in state file. Get it here (http://www.mytempdir.com/1247964).

Happy testing...

tebasuna51
9th March 2007, 12:37
Please use links like http://www.mytempdir.com/ or similar to attach files, because with the forum method remain several days in "Attachments Pending Appoval" state.

I can't still test the previous mod.

Chumbo
9th March 2007, 16:33
Oh, crap. I didn't even notice the pending approval. I need to find some off-site hosting then.

I used the site you provided, thank you. Try this (http://www.mytempdir.com/1247964) link.

tebasuna51
9th March 2007, 18:48
Thanks Chumbo.

Tested your new version and work fine.

yonta
10th March 2007, 02:00
Thank you, Chumbo and tebasuna51 for the modifications.
It works just fine.

alwa
10th March 2007, 13:00
Thanks for your work too!
And i did some minor changes by myself:
- made the Ensure MP3 VBR Sync checkbox work
- target filename will change now after loading an new source file
- aften encoder GUI bitrate trackbar improvement :rolleyes:

You can get the Update here (http://www.mytempdir.com/1248977)

shon3i
10th March 2007, 23:47
Can you guy's, make rounded bitrate in CT encoder, and i will make new Package?

Chumbo
10th March 2007, 23:52
Thanks for your work too!
And i did some minor changes by myself:
- made the Ensure MP3 VBR Sync checkbox work
- target filename will change now after loading an new source file
- aften encoder GUI bitrate trackbar improvement :rolleyes:

You can get the Update here (http://www.mytempdir.com/1248977)
This includes the mods made by me and tebasuna51 right? Just want to be sure. :) Thank you.

[EDIT] I went ahead and grabbed and it looks like it has the previous mods rolled in. Cool, thanks.

Chumbo
11th March 2007, 04:03
Can you guy's, make rounded bitrate in CT encoder, and i will make new Package?
Is this what you're looking for? I've not used aac so please test it first to make sure it works correctly. Includes all previous mods in this thread. Get it here (http://www.mytempdir.com/1249872).

- changed the range to 8 - 320 instead of 8000 - 32000 (still displays correctly, just internal math)
- on save, I multiply the value by 1024 (let me know if this is not correct, i.e., if it should be 1000)

shon3i
11th March 2007, 13:43
Yes, that is that, thanks. Works correctly, but

- on save, I multiply the value by 1024 (let me know if this is not correct, i.e., if it should be 1000)

should be 1000, because when i use 128 for bitrate, input bitrate should be 128000, not 131072

can you correct this aslo.

Thanks

tebasuna51
11th March 2007, 14:02
Can you guy's, make rounded bitrate in CT encoder, and i will make new Package?

For what? CT encoder accept any value without error, and what are the rounder criterium for CT aac?

Is true the CT interface is not clear because:
Stereo Multichannel MaxBitrate
------ ------------ ----------
AAC-LC Yes Yes 320000
AAC-HE (SBR) AAC+ Yes Yes 212000
AAC-HE+PS AAC+v2 Yes - 48000
AAC-HIGH Yes - 256000

But always we obtain correct result because CT encoder override the interface parameters (don't use PS or HIGH for 6 channels, limits and round the bitrate, ...)

shon3i
11th March 2007, 14:20
For what? CT encoder accept any value without error, and what are the rounder criterium for CT aac?
Yes, but what i get if i use 128.656 instead 128 really. Becuase CT is CBR encoder, should have CBR values (8-320) like in winamp. It is hard to choose right bitrate moving slider with mouse right? That is my point.

Is true the CT interface is not clear because:


Stereo Multichannel MaxBitrate
------ ------------ ----------
AAC-LC Yes Yes 320000
AAC-HE (SBR) AAC+ Yes Yes 212000
AAC-HE+PS AAC+v2 Yes - 48000
AAC-HIGH Yes - 256000

close enough

The right table is:

Stereo Multichannel MaxBitrate
------ ------------ ----------
AAC-LC Yes Yes 320000
AAC-HE (SBR) AAC+ Yes Yes 128000, 213000 for Multichannel
AAC-HE+PS AAC+v2 Yes - 64000
AAC-HIGH Yes - 256000, 32000 if Independed Stereo used

alwa
11th March 2007, 16:29
So, i did it again :p .

The package includes the previous mods
+ CT Changes with multiplier 1000
+ extensions can now be stored either in the "ext" directory or like before
+ .config moved to the BeHappy.state file (unlovely, but it works)
+ DirectShowSource(... , video=false)
+ moved GuiPosition class to Configuration.cs

It can be downloaded here (http://www.mytempdir.com/1250395).

I want to move the other binaries to a subdirectory as well, but i haven't discovered yet the best way to do that.
BTW: Do you even like that?

Chumbo
11th March 2007, 21:21
@alwa,
May I ask why you're changing the project structure a bit? Just curious, that's all. Thanks for contributing. :)

I don't think it's a good idea to move the .config stuff into the .state file. The .config file contains settings that are defaults that the project can fall back on or the like BEFORE any state is saved. So when someone want to reset their BeHappy settings, they can just delete their .state file, but we don't want the default configurations removed. So I'd highly recommend keeping what's in the .config separate from the .state file. I hope that makes sense. :)

I really like the idea of having the extension files in the ext folder. Nice.

alwa
12th March 2007, 00:44
May I ask why you're changing the project structure a bit?
Why was the class in the Job.cs? Is there a deeper meaning? ;)

I personally don't think there is a reason to change the settings in the .config.(?) These are very special customizations. Which in the current build fall back to "default"(other default than in your context...) if the file gets delete/corrupted. But i think i got your point. I don't know what's better, i just don't like the additional file :p .

I really like the idea of having the extension files in the ext folder. Nice.
Thanks. The structure in the Project-View is imo more clearly now.

Thanks for contributing.
Thanks too...

Chumbo
12th March 2007, 00:54
Why was the class in the Job.cs? Is there a deeper meaning? ;)

I was a zombie on no sleep is the only explanation I can come up with. You correctly put it where it should have been in the first place. I guess I experienced an "ID 10 T" error. ;)

tebasuna51
12th March 2007, 04:07
One problem pending is obtain 32 bit precision output (int or float) with BeHappy.

Maybe if any can compile AvisynthWrapper.dll without lines 260-274 of AvisynthWrapper.cpp:
if (inf.HasAudio())
{
*originalSampleType = inf.SampleType();
if( *originalSampleType != SAMPLE_INT16)
{
res = pstr->env->Invoke("ConvertAudioTo16bit", res);
pstr->clp = res.AsClip();
infh = pstr->clp->GetVideoInfo();
if(infh.SampleType() != SAMPLE_INT16)
{
strncpy(pstr->err,"Cannot convert audio to 16bit",ERRMSG_LEN-1);
return 6;
}
}
}
I can test it.

Chumbo
12th March 2007, 04:39
@tebasuna51
Here you go. I hope it helps. Get it here (http://www.mytempdir.com/1251054).

tebasuna51
12th March 2007, 18:05
@tebasuna51
Here you go. I hope it helps. Get it here (http://www.mytempdir.com/1251054).

Thanks Chumbo, works fine but need also some changes in Encoder.cs.

Here (http://www.mytempdir.com/1251693) is a new BeHappy version with:

1) Changes to allow any AviSynth output samples. Compatible with actual and alternative AvisynthWrapper.dll (Encoder.cs)

2) New ConvertSample.extension. Needed to test output samples and check encoders:
The old AvisynthWrapper.dll is equivalent to use the new one with a final DSP Convert Sample to 16 bit int.
Warning, some encoders must need 16 bit int output.

3) Descriptive literal change: "Custom (actual_time / desired_time) x 100" instead "Custom transform" (TimeStretchDSP.cs)

4) EnsureMP3VBRSync unchecked by default, in my opinion not needed in BeHappy (MainForm.cs).

Please send yours opinions about the use of the new AvisynthWrapper.dll, and EnsureMP3VBRSync also.

shon3i
12th March 2007, 18:56
Thank you guy's for hard work.

@alwa, i tested version and works perfectly.

@Chumbo, i agree with you about leaving seperate .state file.

@tebasuna51, is now aften dialog ok?

aslo, what you guys think to change the name to BeHappyMod or something, maybe Dimzon won't include these changes?

Chumbo
12th March 2007, 20:09
...aslo, what you guys think to change the name to BeHappyMod or something, maybe Dimzon won't include these changes?
How about calling it BeHappyCATmod. Since you have a cat in your avatar and Chumbo, Alwa and Tebasuna51. Just a thought...;) It would be a good idea to have a mod with the changes listed in a txt file too.

tebasuna51
12th March 2007, 21:07
It would be a good idea to have a mod with the changes listed in a txt file too.
With my last version there are a complete (I hope) list of changes.

@Chumbo, i agree with you about leaving seperate .state file.
You say maintain BeHappy.exe.config and BeHappy.state?
I am with alwa, the 'config' is unnecessary: 2-2 :rolleyes:

About sample precision:

- Decoders: NicAudio and BassAudio output are 32 float.
Others inputs (WavSource, DirectShowSource) can vary.

- DSP functions:
Amplify 16 Bit, Float
ConvertToMono 16 Bit, Float
Downmix 16 Bit, Float
Normalize 16 Bit, Float
SSRC Float
TimeStretch Float
SoxFilter 32 Bit Int

- Encoders:
8 i 16 i 24 i 32 i 32 f
---- ---- ---- ---- ----
mp3 AudX - Y - - -
aac CT - Y - - -
aac Nero Y Y Y Y Y
ac3 Aften Y Y Y Y Y
ffmpeg (3) Y Y Y Y -
mp3 Lame Y Y Y Y -
ogg enc2 Y Y Y Y -
flac - Y Y - -
wavpack Y Y Y Y Y


AudX and aac CT maybe are limited by the Dimzon's interface.

What do you think? Include or not the new AvisynthWrapper.dll?

Aften, for instance, take all formats but make a conversion to float internally, if internally AviSynth work in float, is necessary convert to 16 bit int and reconvert after?.

tebasuna51
12th March 2007, 21:22
@tebasuna51, is now aften dialog ok?

Aften have many parameters but confuse the user, maybe we can add a 'Additional CLI Arguments' like Lame.

Or add a few parameters, for me the most interesting are the pre-filters:

-bwfilter 1 (Bandwidth Low-Pass Filter)
-lfefilter 1 (LFE Low-Pass Filter)
-dcfilter 1 (DC High-Pass Filter)

defaults are 0 (do not apply filter)

alwa
13th March 2007, 13:22
There was a problem with the preferMP4overM4A handling.
Update (http://www.mytempdir.com/1252496)

About the .config generally. I could let BeHappy check whether it exist: if yes use it, if not not?

About the Bits Per Sample. It seems like every DSP can handle 32 Bit Float, but the encoder prefer 16 Bit. I rather like 16Bit for encoding it's much faster than 32 Bit.

//Edit: Oops take all formats but make a conversion to float internally
The suitable Bits Per Sample conversion could be placed in the GetScript() method for each encoder individually.

Aften have many parameters but confuse the user, maybe we can add a 'Additional CLI Arguments' like Lame.
I prefer that.

How about calling it BeHappyCATmod.
Rather just BeHappyCAT or BeHappyMod :)

Chumbo
14th March 2007, 01:32
Added the following changes (appended to changes.txt too):

modified Delete All button behavior to only remove items with status of Done, Error and Abort
changed job list control to a multi-select control
modified Delete button behavior to remove the selected items except if item selected is in Processing state


Get the Updated build (http://www.mytempdir.com/1253348) and test it please. :)

tebasuna51
14th March 2007, 02:32
New mod (http://www.mytempdir.com/1253380) with adjust for the limited input encoders:

- Encoders with only support for 16 bit int
Audiobits()==16 ? last : ConvertAudioTo16bit()

- Encoders with max support 24 bit:
Audiobits()==16 ? last : ConvertAudioTo24bit()

- Encoders without support for float:
IsAudioInt() ? last : ConvertAudioTo32bit()

- OggEnc2 support now float input (not suported in raw mode).

- TwoLame for mp2 encode support all data formats, is my election instead ffmpeg.

Now all encoders works at best quality possible and always can returns to previous behaviour using a final DSP Convert Sample to 16 bit int.

Then my vote is use the new AvisynthWrapper.dll because with the old we can never obtain full quality.

Rectal Prolapse
14th March 2007, 08:56
I tried to run the latest (march 14) one with the AVISynthWrapper.dll from the March 12 archive and it always crashes.

I replaced the old AVISynthWrapper.dll with AVISynthWrapper_new.dll - I renamed the new one.

If I don't replace the old one it works - but my source audio always get resampled to 16 bit from the original 24 bit.

Did I do it right?

Rectal Prolapse
14th March 2007, 09:13
Also, I can't seem to compile this - it complains about missing Configuration class members - so I guess I am missing an updated Configuration.cs file - it was not present in the March 12 and 14th .7z files. I don't know where to look - is there a semi-official place to download the *complete* source code? I'd love to try getting 24 bit FLAC and WavPack encodes going. :)

tebasuna51
14th March 2007, 12:11
I tried to run the latest (march 14) one with the AVISynthWrapper.dll from the March 12 archive and it always crashes.

I replaced the old AVISynthWrapper.dll with AVISynthWrapper_new.dll - I renamed the new one.

If I don't replace the old one it works - but my source audio always get resampled to 16 bit from the original 24 bit.

Did I do it right?

- Using the old one (32768 bytes 2006/01/26) all must be like before: always the audio is resampled to 16 bit.

- The new one (69632 bytes 2007/03/11) AVISynthWrapper_new.dll must be renamed to AVISynthWrapper.dll. The changes in new one are:
- compiled w/out lines 260-274 (http://forum.doom9.org/showthread.php?p=969134#post969134) to help out tebasuna51
- replaced deprecated strcpy calls with new strcpy_s method

What are your SO, .NET, AviSynth versions?
Any C++ expert can explain if this can cause the crash in different environments?

The last full code package we are using are in 2007-03-11 (Alwa) (http://www.mytempdir.com/1250395).
And you need the mod's:
2007-03-12 (Chumbo) (http://www.mytempdir.com/1251054)
2007-03-12 (Tebasuna) (http://www.mytempdir.com/1251693)
2007-03-13 (Alwa) (http://www.mytempdir.com/1252496)
2007-03-13 (Chumbo) (http://www.mytempdir.com/1253348)
2007-03-14 (Tebasuna) (http://www.mytempdir.com/1253380)

The last Configuration.cs is at 2007-03-11 (Alwa)

Deckard2019
14th March 2007, 15:16
Don't know what happened the first time I tried but it crashed.
Now it works :
Starting job aud.avs->aud.wv
Found Audio Stream
Channels=6, BitsPerSample=24 int, SampleRate=48000Hz
wavpack.exe -h -i -l -m -r -q -y - "D:\aud.wv"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete


Maybe you could maintain a tested-and-working package somewhere ?
(if anyone need to create AC3@640kbps with ffmpeg, just change ffmpeg.extension @ line 48 to add correct Option tag).

BTW, thank you all !

Rectal Prolapse
14th March 2007, 17:15
Thank you very much tebasuna51 and Chumbo for the information and patches.

I'm using AVISynth 2.7.0 and Visual Studio .NET 2005 Pro, .NET version 2.0. I've been compiling the project in Debug mode. I will try again with the latest Configuration.cs file you kindly linked for me.

The crashes I get were not from my builds though - just the ones that were released in this thread. Strange!

Rectal Prolapse
14th March 2007, 17:35
Ok, I fixed the crashing problem by starting from scratch - I unzipped the original BeHappy from last year into a directory. Then, starting in order, I unzipped each of the archives you linked for me, replacing the files as needed. Now it works!

24 bit! Yes! :D

tebasuna51
15th March 2007, 02:19
@Chumbo

In my MainForm.cs lines 859-860 from 2007-03-12 I have:
this.cbxEnsureMP3VBRSync.Checked = false;
// this.cbxEnsureMP3VBRSync.CheckState = System.Windows.Forms.CheckState.Checked;

In your MainForm.cs lines 859-860 from 2007-03-13 you have:
this.cbxEnsureMP3VBRSync.Checked = true;
this.cbxEnsureMP3VBRSync.CheckState = System.Windows.Forms.CheckState.Checked;

Is a error or you defend the use of EnsureVBRMP3Sync() ?
Anybody can explain me when is necessary EnsureVBRMP3Sync() ?
I think we always work with uncompressed audio without sync problems.

Chumbo
15th March 2007, 02:23
@Chumbo

In my MainForm.cs lines 859-860 from 2007-03-12 I have:
this.cbxEnsureMP3VBRSync.Checked = false;
// this.cbxEnsureMP3VBRSync.CheckState = System.Windows.Forms.CheckState.Checked;

In your MainForm.cs lines 859-860 from 2007-03-13 you have:
this.cbxEnsureMP3VBRSync.Checked = true;
this.cbxEnsureMP3VBRSync.CheckState = System.Windows.Forms.CheckState.Checked;

Is a error or you defend the use of EnsureVBRMP3Sync() ?
Anybody can explain me when is necessary EnsureVBRMP3Sync() ?
I think we always work with uncompressed audio without sync problems.
No I agree with your setting. I could swear I've grabbed all the updates from you and alwa. You might want to make sure I didn't miss the updates where you changed this to false. Sorry about that. I'm trying hard to make sure I keep the changes you guys are making in the order you're making them so my build is incremental, i.e., includes yours and alwa's changes BEFORE I make any changes.

[EDIT] This build includes the proper default. Thanks Tebasuna for catching it. BeHappy update (http://www.mytempdir.com/1254664)

tebasuna51
15th March 2007, 19:07
One more mod. (http://rapidshare.com/files/21189004/BeHappy_20070315.7z.html)

Changes:

1) Added 'Additional CLI arguments' to Aften capture.

2) Optional 'pseudo-encoders' to split in mono or stereo wav's.

3) Optional optimized Downmix routines. Fast and without inversion in rear channel.

With this I finish my inputs for BeHappy.

Chumbo
16th March 2007, 21:25
@alwa and tebasuna,
I just noticed that the "Keep output..." check box is not working in the latest build. Can you verify this please? I'll try to track down in which build we probably lost this functionality.

raquete
17th March 2007, 00:10
hi.
i need a complete "package" to encode ac3 only(no mp3,aac,ogg,etc).
can you tell me what i have to download and install please?
:thanks:

Chumbo
17th March 2007, 00:23
I believe shon3i was going to update the install package. I need to fix a quick bug though that I mentioned in the pervious post and then I'll put a new build out.

raquete
17th March 2007, 00:25
very nice.thanks so much.

Chumbo
17th March 2007, 00:55
Here's my last changes for now. This build fixes the bug mentioned a few posts back and includes all mods by alwa and tebasuna.

BeHappyCAT (http://www.mytempdir.com/1257194) mod. ;)

@shon3i,
If you plan on building a package now, grab all the previous builds too because they have more up to date versions of aften.exe and other tools in addition to the latest BeHappy.exe in this post. :)

tebasuna51
17th March 2007, 01:53
@raquete
The most basic BeHappy are only two files at same folder:
BeHappy.exe (http://www.mytempdir.com/1257194)
AvisynthWrapper.dll (http://www.mytempdir.com/1251054)

You need add to the folder your preferred Aften version.

The inputs can be from WavSource or DirectShowSource.
The outputs can be ac3, wav or raw PCM.

raquete
17th March 2007, 05:56
thank you so much!

shon3i
17th March 2007, 13:25
Here's my last changes for now. This build fixes the bug mentioned a few posts back and includes all mods by alwa and tebasuna.

BeHappyCAT (http://www.mytempdir.com/1257194) mod. ;)

@shon3i,
If you plan on building a package now, grab all the previous builds too because they have more up to date versions of aften.exe and other tools in addition to the latest BeHappy.exe in this post. :)
Oki, so this is final version, with 32b AvisynthWrapper.dll

raquete
17th March 2007, 15:01
@raquete
The most basic BeHappy are only two files at same folder:
BeHappy.exe (http://www.mytempdir.com/1257194)
AvisynthWrapper.dll (http://www.mytempdir.com/1251054)

You need add to the folder your preferred Aften version.

The inputs can be from WavSource or DirectShowSource.
The outputs can be ac3, wav or raw PCM.
i download the files and extract inside a "behappy" folder together with Aften.exe.
i have netframework2.0 and avisynth installed but Behappy give a error message and close.
is needed something more to put inside the "behappy" folder to encode ac3 only?
thanks.

tebasuna51
17th March 2007, 16:25
i download the files and extract inside a "behappy" folder together with Aften.exe.
i have netframework2.0 and avisynth installed but Behappy give a error message and close.
is needed something more to put inside the "behappy" folder to encode ac3 only?

I can't reproduce your problem, with only:

aften.exe 234.687 10/03/2007 07:14
AvisynthWrapper.dll 69.632 11/03/2007 22:32
BeHappy.exe 237.568 16/03/2007 18:37

And AviSynth v2.5.7 and .Net FrameWork v2.0, works fine for me.

What is the error message?

tebasuna51
17th March 2007, 16:45
Oki, so this is final version, with 32b AvisynthWrapper.dll

Ok for me. The last BeHappy.exe can work with old AvisynthWrapper.dll 16 bit output, or with the new transparent AvisynthWrapper.dll.

Only the Rectal Prolapse report about problems (http://forum.doom9.org/showthread.php?p=970241#post970241)with compilations. And now raquete problem.

Work for everybody the AvisynthWrapper.dll, BeHappy.exe versions in my previous post?

raquete
18th March 2007, 00:22
What is the error message?an advice with a big exclamation in yellow with the words:
"Program Error
behappy.exe generate erros and will be closed by windows.
you need to restart the program.
creating one log of errors."

...but no one error log is created and in the background BeHappy close without messages!

i'm using:
aften.exe 253.952 27/02/2007 02:17
AvisynthWrapper.dll 69.632 11/03/2007 22:32
BeHappy.exe 237.568 16/03/2007 18:37

the same happens with others Aften's versions.

tebasuna51
18th March 2007, 02:44
@raquete
I don't know what is the problem (not Aften version).
I make a new compile (without code changes) to see if work better in your machine (the previous one is by Chumbo).

Also I send the full code (http://www.mytempdir.com/1258593) and you can tray compile yourself (double click in compile.bat and, if not errors, the BeHappy.exe go to 'dist' folder)

@Chumbo, Alwa
Modified files: MainForm.cs, Encoder.cs, compile.bat only to cancell the 'Warnings' and copy files.

=Wolf=
18th March 2007, 06:23
i have this error massage...


Starting job 01.mp3->01.ac3
Found Audio Stream
Channels=2, BitsPerSample=16 int, SampleRate=44100Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 384 "C:\01.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: Канал был закрыт.

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()
#### Encoder StdErr ####
FFmpeg version SVN-r8310, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-liba52 --enable-avisynth --enable-libdts --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libogg --enable-libtheora --enable-libvorbis --enable-x264 --enable-xvid --enable-amr_nb --enable-amr_wb --cpu=i686 --enable-memalign-hack --extra-ldflags=-static
libavutil version: 49.3.0
libavcodec version: 51.38.0
libavformat version: 51.10.0
built on Mar 10 2007 23:38:41, gcc: 4.3.0 20070126 (experimental)
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 1411 kb/s
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Output #0, ac3, to 'C:\01.ac3':
Stream #0.0: Audio: ac3, 44100 Hz, stereo, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

tebasuna51
18th March 2007, 12:43
i have this error massage...

...
Channels=2, BitsPerSample=16 int, SampleRate=44100Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 384 "C:\01.ac3"
...
FFmpeg version SVN-r8310, Copyright (c) 2000-2007 Fabrice Bellard, et al.
...
libavutil version: 49.3.0
libavcodec version: 51.38.0
libavformat version: 51.10.0
built on Mar 10 2007 23:38:41, gcc: 4.3.0 20070126 (experimental)
...
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 1411 kb/s
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Output #0, ac3, to 'C:\01.ac3':
Stream #0.0: Audio: ac3, 44100 Hz, stereo, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

The BeHappy work seems ok.

Not all ffmpeg versions can be tested, seems this one have problems maybe with bitrate (384 is a high bitrate for stereo).

Try other ffmpeg version or better, to encode to ac3 use Aften based in same libs than ffmpeg but highly optimized.

Here work fine (with other ffmpeg version):
Starting job Jap6.mp3->Jap6.ac3
Found Audio Stream
Channels=2, BitsPerSample=32 int, SampleRate=44100Hz
Channels=2, BitsPerSample=16 int, SampleRate=44100Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 384 "G:\Jap6.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete
#### Encoder StdErr ####
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mingw32 --enable-memalign-hack --enable-gpl --enable-a52 --enable-dts --enable-mp3lame --enable-faac --enable-amr_nb --enable-faad --enable-amr_wb --enable-pp --enable-x264 --enable-xvid --enable-theora --enable-libogg --enable-vorbis
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on May 13 2006 18:31:30, gcc: 4.1.0 [Sherpya]
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 2822 kb/s
Stream #0.0: Audio: pcm_s32le, 44100 Hz, stereo, 2822 kb/s
Duration: N/A, bitrate: 1411 kb/s
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Output #0, ac3, to 'G:\Jap6.ac3':
Stream #0.0: Audio: ac3, 44100 Hz, stereo, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0

video:0kB audio:942kB global headers:0kB muxing overhead 0.000000%
Bold lines using the new AvisynthWrapper.dll, normal lines using the old one like you seems use.

raquete
18th March 2007, 13:52
tebasuna,
using one interleaved wave 6 channels,BeHappy close,then i try with stereo source with 2 AvisynthWrapper.dll versions:

with AvisynthWrapper.dll 11/03/2007 18:32
Starting job Track 10.wav->Track 10.ac3
Found Audio Stream
Channels=2, BitsPerSample=16 int, SampleRate=48000Hz
Aften.exe -v 0 -b 448 -m 0 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "D:\01\Track 10.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: O pipe foi finalizado.

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

Aften: A/52 audio encoder
Version SVN
(c) 2006-2007 Justin Ruggles, Prakash Punnoor, et al.

and here with AvisynthWrapper.dll 11/03/2007 22:32
Starting job Track 10.wav->Track 10.ac3
Found Audio Stream
Channels=2, BitsPerSample=16 int, SampleRate=48000Hz
Aften.exe -v 0 -b 448 -m 0 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "D:\01\Track 10.ac3"
Error: System.ApplicationException: Can't start encoder: Năo é possível processar a solicitaçăo porque o processo (872) foi encerrado. ---> System.InvalidOperationException: Năo é possível processar a solicitaçăo porque o processo (872) foi encerrado.
em System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
em System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
em BeHappy.Encoder.createEncoderProcess(AviSynthClip x)
--- Fim do rastreamento de pilha de exceçőes internas ---
em BeHappy.Encoder.createEncoderProcess(AviSynthClip x)
em BeHappy.Encoder.encode()

alwa
18th March 2007, 15:25
Full Code Update with Aften Example (http://www.mytempdir.com/1259180)

Changes:
2007-03-18 (Alwa)
+ renamed the "ext" directory to "extensions" (MainForm.cs, BeHappy.csproj)
+ Encoder binaries can be placed in the "encoder" directory(handling like extensions directory)(MainForm.cs)

You don't have to use those directories! You can...

raquete
18th March 2007, 22:30
@ alwa

your update is working perfectly encoding ac3 using stereo sources but with interleaved 6 channels BeHappy close without encode showing the same error message that i posted yesterday:
"Program Error
behappy.exe generate erros and will be closed by windows.
you need to restart the program.
creating one log of errors."

...but no one error log is created and in the background BeHappy close without messages!

edit: typos!

Chumbo
19th March 2007, 03:33
More changes added to previous mods:
2007-03-18 (Chumbo)
+ added accelerators to buttons so keyboard can be quickly used to access functions
+ when either source/destination are blank, clicking Enqueue displays a message
+ "Keep output..." check box now works AFTER you've started a process
+ Move buttons in Queue tab are now enabled based on list selections (1 item selected only)
+ fixed unintended multiple selections in Jobs list. Now that we have a multi-select list, certain
processes were causing items to stay selected when they should not.

BeHappyCAT (http://www.mytempdir.com/1259886) mod.

alwa
19th March 2007, 12:44
BeHappyCAT (http://www.mytempdir.com/1260250) :rolleyes:
2007-03-19 (Alwa)
+ fixed a problem with the "encoder" directory in connection with the WAVWriter output

@raquete would be nice if you provide us a tiny sample which causes this error.

raquete
19th March 2007, 17:03
@raquete would be nice if you provide us a tiny sample which causes this error.in few minutes.
i'm cutting some from the source and hosting.
thanks so much for your interest.:)

raquete
19th March 2007, 17:41
one interleaved,6-channel wave file with round 30 seconds

http://rapidshare.com/files/21807882/sample.rar

some comments:
loading this sample and others waves(6ch) in AftenGUI1.2 with Aften 06/08/06 43k or Aften 17/03/07 229k the result is perfect.
with the last EncWAVtoAC3 works perfect too.
thanks.

tebasuna51
19th March 2007, 18:24
@raquete
Your wav have a WAVE_FORMAT_EXTENSIBLE header and is not supported by AviSynth WavSource().
To open this files with AviSynth you can:
- Use BassAudioSource(). You need BassAudio.dll and Bass.dll in AviSynth plugins folder.
- Use DirectShowSource with, for instance, ffdshow properly configured.
- Convert to a PCM wav with WaveWizard.
- Patch the wav with WavNotEx.exe

This is a AviSynth problem not related with BeHappy.
If you don't need DSP functions AftenGUI is fast than use BeHappy.

raquete
19th March 2007, 18:31
i have BassAudio.dll and Bass.dll in AviSynth plugins folder but...
This is a AviSynth problem not related with BeHappy.
If you don't need DSP functions AftenGUI is fast than use BeHappy. all right,very clever.
thank you so much! :)

Chumbo
20th March 2007, 04:53
For those of you that are audio coding experts, any idea on why a 24MB ac3 file, after run through BeHappy, is 3 times the size when rewritten back to ac3? I just wanted to test the time stretch to see if that works well and noticed my output file was almost 80MB. I did use the down sample to 16 bit and left it at 384kbps using Aften, but the same thing happens when I use ffmpeg.

btw, I did test it w/out any DSP turned on and still the same 3x larger output file. Ideas? Words of wisdom? Thanks much. Hopefully I can learn something. :)

Using BeSweet gives me the expected result incase you were wondering. I have not tried Aften via the command line with bepipe to see if the results are the same as with BeHappy.

tebasuna51
20th March 2007, 12:01
For those of you that are audio coding experts, any idea on why a 24MB ac3 file, after run through BeHappy, is 3 times the size when rewritten back to ac3? I just wanted to test the time stretch to see if that works well and noticed my output file was almost 80MB. I did use the down sample to 16 bit and left it at 384kbps using Aften, but the same thing happens when I use ffmpeg.
In ac3 always:
Size = Time_length x BitRate

- The bit depth ("I did use the down sample to 16 bit") is irrelevant.

- If Time_length don't vary (TimeStretch don't support great change) your output bitrate is 3 times your input bitrate.

Chumbo
20th March 2007, 15:47
In ac3 always:
Size = Time_length x BitRate

- The bit depth ("I did use the down sample to 16 bit") is irrelevant.

- If Time_length don't vary (TimeStretch don't support great change) your output bitrate is 3 times your input bitrate.
Thanks tebasuna. My input ac3 has the same bitrate. It's a 5.1 384kbps 48kHz. My output parameters are the same. Like I said, I don't have the size "issue" with BeSweet which uses azid. What do you think?

tebasuna51
20th March 2007, 16:36
Thanks tebasuna. My input ac3 has the same bitrate. It's a 5.1 384kbps 48kHz. My output parameters are the same. Like I said, I don't have the size "issue" with BeSweet which uses azid. What do you think?

Is not possible, an ac3 384 Kb/s 24 Mb is 8:44, and a 80 Mb is 29:07. What is true?

Chumbo
20th March 2007, 17:17
Is not possible, an ac3 384 Kb/s 24 Mb is 8:44, and a 80 Mb is 29:07. What is true?
Well, I did a couple tests and it's the input that causing the problem.

03/20/2007 11:10 AM 1,440,768 601.384.ac3
03/20/2007 11:13 AM 4,323,840 601.DSinput.aften.384.ac3
03/20/2007 11:14 AM 1,442,304 601.NicAc3SourceInput.aften.384.ac3
Note how much bigger the file is when DirectShow is used as the input. My problem is, when I use NicAc3Audio on the full file, the process blows up in BeHappy. I ran the ac3 through delaycut and used the fix option and it still blows up during the conversion.

Using DS works fine, but my file is 3x larger. Sigh... Ideas, suggestions? Thanks a lot.

Can you guys confirm this or am I the only one seeing this?

tebasuna51
20th March 2007, 18:25
I ran the ac3 through delaycut and used the fix option and it still blows up during the conversion.

I'm sure than DelayCut send you error message. Please put them.

Seems your ac3 is corrupted. Maybe you have a mix between bitrates or different channels and the behaviour can differ with decoders.

And you don't say me the duration of ac3's (and if sound right).

tebasuna51
20th March 2007, 19:04
BeHappyCAT (http://www.mytempdir.com/1262315) new version with:
- problem fixed because AviSynth bug: IsAudioInt return always false.

The problem is reported (http://forum.doom9.org/showthread.php?t=123646) but waiting a new AviSynth release is better change

IsAudioInt() ? last : ConvertAudioTo32bit()
for
Audiobits()==32 ? ConvertAudioTo32bit() : last

First line (always false) convert always the audio to 32 bit int, second line convert only float and int 32 bit to 32 int.

Chumbo
20th March 2007, 19:26
I'm sure than DelayCut send you error message. Please put them.

Seems your ac3 is corrupted. Maybe you have a mix between bitrates or different channels and the behaviour can differ with decoders.

And you don't say me the duration of ac3's (and if sound right).
Actually, the small sample info I posted is clean. I ran it through delaycut and it came out fine.
[Input info]
Bitrate=384
Actual rate=384.000000
Sampling Frec=48000
TotalFrames=938
Bytesperframe=1536.0000
Filesize=1440768
FrameDuration= 32.0000
Framespersecond= 31.2500
Duration=00:00:30.016
Channels mode=3/2: L+C+R+SL+SR
LFE=LFE: Present
[Target info]
StartFrame=0
EndFrame=937
NotFixedDelay= 0.0000
Duration=00:00:30.016
====== PROCESSING LOG ======================
Number of written frames = 938
Number of Errors= 0
The problematic ac3 file I was referring to was my 24MB file. I just wanted to use a small clean sample to show you what I was talking about.

Look at the differences between the original here:
====== INPUT FILE INFO ========================
File is ac3
Bitrate (kbit/s) 384
Act rate (kbit/s) 384.000
File size (bytes) 1440768
Channels mode 3/2: L+C+R+SL+SR
Sampling Frec 48000
Low Frec Effects LFE: Present
Duration 00:00:30.016
Frame length (ms) 32.000000
Frames/second 31.250000
Num of frames 938
Bytes per Frame 1536.0000
Size % Framesize 0
CRC present: YES
=============================================

and the one run through BeHappy using DirectShow for input and aften output:
====== INPUT FILE INFO ========================
File is ac3
Bitrate (kbit/s) 384
Act rate (kbit/s) 384.000
File size (bytes) 4323840
Channels mode 3/2: L+C+R+SL+SR
Sampling Frec 48000
Low Frec Effects LFE: Present
Duration 00:01:30.080
Frame length (ms) 32.000000
Frames/second 31.250000
Num of frames 2815
Bytes per Frame 1536.0000
Size % Framesize 0
CRC present: YES
=============================================


Why would it be so different when the input is DirectShow? btw, my DS graph is the ac3 file->ac3filter->default ds device. AC3Filter output is set to AS IS (no change).

[EDIT] Here's the ac3 file I'm experimenting with. test file (http://www.mytempdir.com/1262380). btw, I also tried using DirectShow with the sonic audio decoder instead of ac3filter and got the same bloated output. Ugh...

Chumbo
21st March 2007, 01:44
Discovered a small bug:
2007-03-20 (Chumbo)
+ fixed a small UI bug to make sure when a job is finished, the item selected doesn't get deselected in the jobs list

BeHappyCAT (http://www.mytempdir.com/1262803) update.

tebasuna51
21st March 2007, 03:03
[EDIT] Here's the ac3 file I'm experimenting with. test file (http://www.mytempdir.com/1262380). btw, I also tried using DirectShow with the sonic audio decoder instead of ac3filter and got the same bloated output. Ugh...

Your test file is correct. And I can't reproduce your problem.

Really is not recommended use the DirectShowSource method because config differences between systems, player/convert options and difficult debug.

In my system I have ffdshow DSF to decode ac3 and work with BeHappy without this problem. Most sure is use the dedicated decoder NicAc3Source.

Sorry but I can't help you with your DirectShow configuration (is a mystery for me).

Chumbo
21st March 2007, 04:30
Your test file is correct. And I can't reproduce your problem.

Really is not recommended use the DirectShowSource method because config differences between systems, player/convert options and difficult debug.

In my system I have ffdshow DSF to decode ac3 and work with BeHappy without this problem. Most sure is use the dedicated decoder NicAc3Source.

Sorry but I can help you with your DirectShow configuration (is a mystery for me).
No worries, I really appreciate you trying to duplicate. I kinda' figured it was a filter issue and, I think, you validated that and am grateful to you for this. :) Many thanks.

shon3i
21st March 2007, 22:02
One more thing to do:

When is [..] for destination pressed, and common dialog show, should filename filed in common dlg, be filed with filename from destination textbox without full path, only filename.

Chumbo
22nd March 2007, 02:09
Let me take a look at that for you shon3i.

[EDIT] here you go shon3i:
2007-03-21 (Chumbo)
+ Destination/output dialog now prefills the file name

Latest BeHappyCAT (http://www.mytempdir.com/1265030) build.

shon3i
22nd March 2007, 08:24
Not working in my type.

http://img208.imageshack.us/img208/8388/untitledgi5.jpg

Maybe you didn't understand me.

Chumbo
22nd March 2007, 16:25
Not working in my type.
...
Maybe you didn't understand me.
Oh no, I understood perfectly. I may have copied the wrong BeHappy.exe in my haste. Sorry, let me double check it.

[EDIT] I'm an idiot. I uploaded the wrong file. It should be the 3/21 build. Here's the right link. BeHappyCAT (http://www.mytempdir.com/1265030).

shon3i
22nd March 2007, 20:00
Thanks Chumbo, work like charm :)

@Chumbo, tebasuna51, Alwa, can we stop development now, and sum what we have here

BeHappy.exe 03/21/2007 version 0.1.9.35190
AvisynthWrapper.dll ? 16 or 32, you tebasuna51 said that all encoders support 32bit output except aud-x and CT. Did i were have problems using 32bit and CT encoder on 16bit audio?
And can somebody upload lastest versions of both thanks.

Aslo to upload lastest extensions.

What to use for ogg encoding and link?
What is last aften version and link?
What is good for wav2mono & wav2stereo extension?
What is last NicAC3?
What encoder for musepack?

Chumbo
22nd March 2007, 22:30
Thanks Chumbo, work like charm :)

@Chumbo, tebasuna51, Alwa, can we stop development now, and sum what we have here

BeHappy.exe 03/21/2007 version 0.1.9.35190
AvisynthWrapper.dll ? 16 or 32, you tebasuna51 said that all encoders support 32bit output except aud-x and CT. Did i were have problems using 32bit and CT encoder on 16bit audio?
And can somebody upload lastest versions of both thanks.

Aslo to upload lastest extensions.

What to use for ogg encoding and link?
What is last aften version and link?
What is good for wav2mono & wav2stereo extension?
What is last NicAC3?
What encoder for musepack?
Glad it worked. :)

btw, my project contains all the changes made by CAT crew. ;) I also have the latest utilities. I think I have twolame.exe too since that wasn't there initially. I can pack up all the parts including the two versions of avisynthwrapper some time tonight.

[EDIT] I packed my BeHappy program folder into this package (http://www.mytempdir.com/1265592). btw, I used your most recent install, but I updated all the files that needed updating, i.e., aften, extensions, etc. I included the original/old avisynthwrapper dll but the new one is the active one.

tebasuna51
23rd March 2007, 05:11
AvisynthWrapper.dll ? 16 or 32, you tebasuna51 said that all encoders support 32bit output except aud-x and CT. Did i were have problems using 32bit and CT encoder on 16bit audio?
AFAIK all encoders work with new AvisynthWrapper.dll and the added functions than work only when is necessary and not always like with old AvisynthWrapper.dll.
And can somebody upload lastest versions of both thanks.
Aslo to upload lastest extensions.

What to use for ogg encoding and link?
What is last aften version and link?
What is last NicAC3?
What encoder for musepack?
I agree with Chumbo package but :

BassAudio.extension (added .cda extension)
NicAudio.extension (added Normalize in mp123)

There are some files I don't know if are needed:
lame_enc.dll
wvgain.exe
wvselfx.exe
wvunpack.exe

And other I have new versions:
enc_aacPlus.exe 45.056 28/09/2006 12:03
enc_aacplus.dll 529.408 13/02/2007 19:28 Winamp v5.33
flac.exe 237.568 15/02/2007 17:38 v1.14
neroAacEnc.exe 843.776 12/02/2007 09:49 and SS2
oggenc2.exe 403.968 25/10/2006 14:30 v2.83
twolame.exe 294.912 22/03/2007 13:20 v03.10b
and
mppenc.exe 109.568 13/11/2006 02:00 v1.16

I use http://www.rarewares.org/ for:
LAME 3.97
twoLame 0.3.10b
Oggenc2.83 using aoTuVb5
Flac v1.14

Also:
http://kurtnoise.free.fr/index.php?dir=Aften/
http://www.wavpack.com/
http://www.musepack.net/

And this NicAudio.dll (http://nic.dnsalias.com/NicAudio_alpha3.zip)

What is good for wav2mono & wav2stereo extension?
Sometimes we need split multichannel input in mono/stereo wav's to be edited in stereo audio editors. Split in mono wav's is a BeSweet tool than can be accomplished with these utils (compressed are only 5 KB and are optional)

Here are (http://www.mytempdir.com/1265679) BassAudio.extension, NicAudio.extension and bass_cd.dll. This bass library (in AviSynth 2.5\plugins) enable BeHappy to open CD Audio directly.

序列人
23rd March 2007, 06:16
Starting job bits0001.mpa->bits0001.m4a
Error: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at BeHappy.AviSynthClip.dimzon_avs_init(IntPtr& avs, String func, String arg, AVSDLLVideoInfo& vi, AviSynthColorspace& originalColorspace, AudioSampleType& originalSampleType, String cs)
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()



Some one can help me?

setarip_old
23rd March 2007, 07:41
This is often an indication that other memory is corrupt.Sounds like the program is suggesting that you may have some bad RAM...

alwa
23rd March 2007, 14:11
There are some files I don't know if are needed:
lame_enc.dll
wvgain.exe
wvselfx.exe
wvunpack.exe
BeHappy works fine without those files.

LAME 3.97 produces files with the wrong bitrate in ABR mode. Someone else had problems with it? At the moment i use ver. 3.96.1 which produces files with correct bitrate.

Aften (http://win32builds.sourceforge.net/aften/index.html)(Other link don't work right now)

@序列人: Can you reproduce the error or does it happen incidentally?

Chumbo
23rd March 2007, 15:41
Starting job bits0001.mpa->bits0001.m4a
Error: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at BeHappy.AviSynthClip.dimzon_avs_init(IntPtr& avs, String func, String arg, AVSDLLVideoInfo& vi, AviSynthColorspace& originalColorspace, AudioSampleType& originalSampleType, String cs)
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()



Some one can help me?
You can try alternative ways of feeding your audio:
- load your mpa into graphedt to see what your filter chain is. Your system may not be able to create a filter chain or even if it does, you may have to server it to behappy differently.

- server your mpa file via an AVS script with directshowsource. Make sure to use the fps parameter. If you still get the same error, add the framecount parameter

- use graphedt to save a grf file of your filter chain without the last output, i.e., default directsound device. So your audio output pin should be open. Create an avs script and use your file.grf as the input to directshowsource. Same here, use the fps parameter and you may have to use the framecount parameter.

The other thing to consider is what is your mpa file? Is it actually an ac3 file? If it is, rename it to ac3 and feed it accordingly. Is it a dts file? You can try renaming it to dts. Check out the thread on evodemux as there's plenty of info there on the demuxed audio tracks from both hd dvds and blu-ray dics.

[EDIT] Here's a sample of the avs line:
directshowsource("myfile.grf",fps=23.976,video=false,audio=true,framecount=xxxxx)
Of course set your fps according to your specific feature's setting. Some say fps and framecount are not necessary with audio files, but I guess you can check for yourself. I find it doesn't hurt to use them.

Chumbo
24th March 2007, 00:40
@shon3i,
Thanks to tebasuna and alwa, I updated my folder with the latest files (except enc_aacPlus.exe because I couldn't find the version tebasuna has). I also fed the help text to the encoder's xxxxHelp.txt files for convenience. I also put the avisynth plugin DLLs in their own folder for you.

Here's my updated folder (http://www.mytempdir.com/1266896) link if you want to use it. I hope it helps lessen the work you have to do.

tebasuna51
24th March 2007, 01:58
I updated my folder with the latest files (except enc_aacPlus.exe because I couldn't find the version tebasuna has).

I don't remember from where I download the "AACPlus v2 Encoder (using Winamp 5.3 enc_aacplus.dll)" but here (http://www.mytempdir.com/1266951) is.

shon3i
24th March 2007, 10:21
Thanks, i alredy have lastest enc_aac files, plus i use 5.33/5.34 which is CT 8.03

shon3i
24th March 2007, 11:45
New package is out

Link (http://www.box.net/shared/nkihizx1dh)

i've add whole changelog later

buzzqw
24th March 2007, 12:04
thanks shon3i!

BHH

Deckard2019
24th March 2007, 14:35
New package is out
Thank you but could you just provide a zip or rar file instead ?

shon3i
24th March 2007, 14:39
Thank you but could you just provide a zip or rar file instead ?
Why?

I don't see the point?

buzzqw
24th March 2007, 14:59
not an installer...

BHH

Deckard2019
24th March 2007, 16:14
not an installer...
Thank you buzzqw ;)

shon3i
24th March 2007, 16:44
Then use all files from BeHappy folder and just zip that's all, including avs audio plugins, nothing simpler ;)

BeHappy

aften.exe
aud-x.extension
audxlib.dll
AviSynth Plugin DLLs
AvisynthWrapper.dll
BassAudio.extension
BeHappy.exe
BeHappy.exe.config
ConvertSample.extension
DownMix.extension
DuplicateChannels.extension
enc_aacplus.dll
enc_aacPlus.exe
enc_AudX_CLI.exe
ffmpeg.exe
ffmpeg.extension
flac.exe
flac.extension
lame.exe
libmmd.dll
MP4Box.exe
mppenc.exe
musepack.extension
neroAacEnc.exe
neroAacEnc_SSE2.exe
NicAudio.extension
nscrt.dll
oggenc2.exe
SSRC.extension
twolame.exe
twolame.extension
UpMix.extension
wav2mono.exe
wav2mono.extension
Wav2stereo.exe
Wav2stereo.extension
wavpack.exe
wavpack.extension


Avs Plugins

bass.dll
bassAudio.dll
bass_aac.dll
bass_ac3.dll
bass_ape.dll
bass_cd.dll
bass_flac.dll
bass_mpc.dll
bass_spx.dll
bass_wma.dll
bass_wv.dll
NicAudio.dll
soxfilter.dll


you can use this my package exe and run in administrative mode with "BeHappy_20070324.exe" /a, then setup will extract all files from package to C:\ without real install.

This package is designed for all ppl's who want install and encode easly, for that purpose, i planing to make package who will include lastest AviSynth and Net Framework 2.0.

buzzqw
24th March 2007, 16:58
no...no need to include .net2 just offer to download

BHH

Chumbo
24th March 2007, 23:08
no...no need to include .net2 just offer to download

BHH
Yeah, I agree on this one. :) You should be able to build your package to require the .net frmwrk 2 and then download it if it needs it. It's too much overhead to download for folks who don't have a fast connection and already have it.

madshi
30th March 2007, 18:52
Hi guys,

I'm trying to mux audio tracks from my German PAL DVDs to HD-DVD. For that to work I need of course to change the German audio track from 25fps to 23.976fps. I've tried "TimeStretch", but it's more intelligent than I like. It seems to do pitch correction. But that's *BAD* in my case, cause by far most German audio tracks have been sped up without pitch correction. So basically I need a stupid and simple stretch, much less sophisticated than BeHappy's TimeStretch.

Can anybody help me, please?

Thanks!

tebasuna51
30th March 2007, 19:37
Open your track in BeHappy and apply the timestretch needed and other changes, instead Enqueue use Export AviSynth Script.

Edit with Notepad (or similar) the avs changing:
"tempo" by "rate" in line:

TimeStretch(last, tempo=95.904)

The new line:

TimeStretch(last, rate=95.904)

Now open the avs with BeHappy and encode (uncheck the DSP's functions now).

Chumbo
30th March 2007, 19:38
Hi guys,

I'm trying to mux audio tracks from my German PAL DVDs to HD-DVD. For that to work I need of course to change the German audio track from 25fps to 23.976fps. I've tried "TimeStretch", but it's more intelligent than I like. It seems to do pitch correction. But that's *BAD* in my case, cause by far most German audio tracks have been sped up without pitch correction. So basically I need a stupid and simple stretch, much less sophisticated than BeHappy's TimeStretch.

Can anybody help me, please?

Thanks!
If you export the avs script, you'll note that all BeHappy does is do the math and put a line in the resulting avs script similar to this:
########################################
# [DSP: TimeStretch - 25 -> 23.976]
########################################
TimeStretch(last, tempo=95.904)
I know BeSweet is outdated, but it does frame conversion if you want to try it and compare.

[EDIT] I knew tebasuna would have the answer. :)

tebasuna, what do you think about updating the UI to include a checkbox for pitch in the stretch dialog? If checked, then tempo is used, otherwise rate is used.

madshi
30th March 2007, 20:07
Thank you guys! :) That should do the trick for me. Of course having this option in the GUI would be great, but as long as I can make it work, I'm happy.

tebasuna51
30th March 2007, 22:47
tebasuna, what do you think about updating the UI to include a checkbox for pitch in the stretch dialog? If checked, then tempo is used, otherwise rate is used.
There are three options with TimeStretch:
- rate: tempo and pitch changed
- tempo: only tempo changed
- pitch: only pitch changed

this third option can be used to repair the tracks in this case if we don't need change the fps in video.

Maybe for the next version.

Chumbo
31st March 2007, 00:02
There are three options with TimeStretch:
- rate: tempo and pitch changed
- tempo: only tempo changed
- pitch: only pitch changed

this third option can be used to repair the tracks in this case if we don't need change the fps in video.

Maybe for the next version.
From the way you broke it down, sounds like the default behavior is what madshi needed, i.e., tempo, because he didn't want pitch change. The suggestion to use rate would actually do both. I just want to make sure I understand. Thanks.

Here's the usage from the help file (just like you broke it down):
TimeStretch allows changing the sound tempo, pitch and playback rate parameters independently from each other, i.e.:
Sound tempo can be increased or decreased while maintaining the original pitch.
Sound pitch can be increased or decreased while maintaining the original tempo.
Change playback rate that affects both tempo and pitch at the same time.
Choose any combination of tempo/pitch/rate.

tebasuna51
31st March 2007, 00:52
From the way you broke it down, sounds like the default behavior is what madshi needed, i.e., tempo, because he didn't want pitch change. The suggestion to use rate would actually do both. I just want to make sure I understand.

The normal usage is 'tempo': modify the audio duration (preserving the pitch) to maintain the sync with a video with a new duration because is played at other fps. If the video is modified adding or deleting frames to change the fps, but maintain the duration, the audio don't need change.

But now madshi say: "cause by far most German audio tracks have been sped up without pitch correction", then the pitch is incorrect with the old fps, and tempo is incorrect for the new fps.

Chumbo
31st March 2007, 01:08
The normal usage is 'tempo': modify the audio duration (preserving the pitch) to maintain the sync with a video with a new duration because is played at other fps. If the video is modified adding or deleting frames to change the fps, but maintain the duration, the audio don't need change.

But now madshi say: "cause by far most German audio tracks have been sped up without pitch correction", then the pitch is incorrect with the old fps, and tempo is incorrect for the new fps.
Yeah, that makes sense which is what I thought. Thanks.

btw, I went ahead and started the next round of changes. ;) I had time so I added the UI for those options.

2007-03-30 (Chumbo)
+ added rate control to the TimeStretch DSP module - you can select rate, pitch or both
+ updated the version to 0.1.10.* from 0.1.9.*. With all the changes we made we should've update the version sooner

Get latest BeHappy update (http://www.mytempdir.com/1276813). Please test and report any problems.

=Wolf=
31st March 2007, 06:58
I has tried from AC3 5.1 448kbps-> Mp3 Sterio 2.0 and here that at me has left....
http://home.farlep.net/~wolf2/17_jpn.mp3

old version is work fine....

p.s sorry for my bad English :(

madshi
31st March 2007, 10:06
Hey, that's what I call a quick implementation of a feature suggestion! Thanks, Chumbo!! :)

May I suggest a renaming of the options, though? I think the names are not clear enough. Basically "change frame rate and pitch" can mean two things:

(1) It could mean: Do no pitch correction, so that the pitch is practically changed during conversion.

(2) It could mean: Do pitch correction, so that the pitch after the conversion is the same as before.

Basically I'm not sure when you say "change pitch" do you mean "do pitch correction"? Or do you mean "don't do pitch correction" (the latter of which would result in a pitch change during conversion).

I'd suggest these labels for the 3 options:

(1) Change frame rate without pitch correction.
(2) Change frame rate with pitch correction.
(3) Perform pitch correction without frame rate change.

Alternatively you could also replace the 3 radio buttons with 2 check buttons:

(1) Pitch correction.
(2) Run length correction (or "run time correction" or "frame rate correction").

Actually I think I'd prefer the 2 check buttons over 3 radio buttons. That's the most intuitive option set IMHO. Of course having both check buttons unchecked would simply do no modification to the audio stream at all.

------------

Btw, after doing some tests yesterday, the "rate" conversion is really exactly what I needed. The converted audio tracks are practically perfect. Perfect sync, perfect pitch.

Don't know if this is a known problem, but with the "tempo" method, the sync was not perfect. The final audio file was a few seconds too short. I believe it played slightly too "fast". No such problems with the "rate" option. Also I noticed that the whole conversion process needs significantly less time when using the "rate" option. That was to be expected, of course, cause it does much simpler manipulations to the audio file.

Anyway, for all people trying to convert PAL audio tracks to 23.976, I suggest this approach:

(1) Check whether the PAL track has too high pitch (this is the case for by far most PAL tracks, but not for all).
(2) If the pitch of the PAL track is too high, use the "rate" option.
(3) If the pitch is not too high, use the "tempo" option. However, you might have sync problems this way.

tebasuna51
31st March 2007, 11:13
The parameters 'tempo', 'pitch' and 'rate' are well know not only by AviSynth users but also by BeLight-BeSweet users then the name must appear in the options.

I'm opposed to use the words 'frame rate' when speak about audio, the real audio frame rate is never changed with this options.

Then I propose:

(1) Tempo changed preserving pitch.
(2) Pitch changed preserving tempo.
(3) Rate, tempo and pitch changed.

@madshi: "with the "tempo" method, the sync was not perfect. The final audio file was a few seconds too short."
Sometimes the exact change needed is not the exact relation between video framerates, then we need use the 'custom' option.

tebasuna51
31st March 2007, 11:25
I has tried from AC3 5.1 448kbps-> Mp3 Sterio 2.0 and here that at me has left....
http://home.farlep.net/~wolf2/17_jpn.mp3

old version is work fine....
Please send the original ac3 5.1 to try reproduce your problem.

Here with an ac3 5.1 448 kb/s, a downmix DSP and encode with Lame work fine.

=Wolf=
31st March 2007, 11:50
@tebasuna51
Here. Take it

http://file4.webfile.ru/1362905/17.ac3
48000Hz 448 kb/s tot , 6 chnls (3/2 .1)

madshi
31st March 2007, 12:55
The parameters 'tempo', 'pitch' and 'rate' are well know not only by AviSynth users but also by BeLight-BeSweet users then the name must appear in the options.
Agreed, that makes sense.

I'm opposed to use the words 'frame rate' when speak about audio
Yeah, makes sense to me, too.

Then I propose:

(1) Tempo changed preserving pitch.
(2) Pitch changed preserving tempo.
(3) Rate, tempo and pitch changed.
Again for me "pitch changed" is not clear. It could mean "pitch corrected" in the sense "changed=corrected". Or it could mean "pitch changed because it was not corrected". I suggest making use of the terms "pitch correction" and "no pitch correction", as that is a fixed term everybody understands.

Sometimes the exact change needed is not the exact relation between video framerates, then we need use the 'custom' option.
"Rate" gave me perfect sync where "Tempo" give me incorrect sync with the same audio track.

Chumbo
31st March 2007, 15:19
The parameters 'tempo', 'pitch' and 'rate' are well know not only by AviSynth users but also by BeLight-BeSweet users then the name must appear in the options.

I'm opposed to use the words 'frame rate' when speak about audio, the real audio frame rate is never changed with this options.

Then I propose:

(1) Tempo changed preserving pitch.
(2) Pitch changed preserving tempo.
(3) Rate, tempo and pitch changed.

@madshi: "with the "tempo" method, the sync was not perfect. The final audio file was a few seconds too short."
Sometimes the exact change needed is not the exact relation between video framerates, then we need use the 'custom' option.
Thanks guys for your feedback. That's exactly what I was looking for. I was wondering if I worded the options correctly. ;) I'll make the changes sometime today. Thanks again.

tebasuna51
31st March 2007, 15:44
Again for me "pitch changed" is not clear. It could mean "pitch corrected" in the sense "changed=corrected". Or it could mean "pitch changed because it was not corrected". I suggest making use of the terms "pitch correction" and "no pitch correction", as that is a fixed term everybody understands.
Pitch changed means more acute or more deep we don't know if is correct or incorrect.

This functions can be used for other purpose than audio movie tracks. For instance we can need change the pitch, preserving tempo, to accommodate music for different karaoke singers.

"Rate" gave me perfect sync where "Tempo" give me incorrect sync with the same audio track.
Yes, yes, the 'tempo' algorithm is more complex, and more inexact, like you say, for that we need any custom correction and try with different values (really I don't found seconds of difference, only ms, in movie tracks).

tebasuna51
31st March 2007, 15:46
@tebasuna51
Here. Take it

http://file4.webfile.ru/1362905/17.ac3
48000Hz 448 kb/s tot , 6 chnls (3/2 .1)

Sorry I get a "404 - Not Found" error with this link.

alwa
31st March 2007, 15:48
@tebasuna51
Here. Take it

http://file4.webfile.ru/1362905/17.ac3
48000Hz 448 kb/s tot , 6 chnls (3/2 .1)
link fix (http://webfile.ru/1362905)
I can't reproduce your issue.
I'm using NicAC3Source/Bass -> Downmix DSP -> LAME and the output is fine.

Again for me "pitch changed" is not clear. It could mean "pitch corrected" in the sense "changed=corrected". Or it could mean "pitch changed because it was not corrected". I suggest making use of the terms "pitch correction" and "no pitch correction", as that is a fixed term everybody understands.
then:
(1) Tempo changed, pitch correction.(hint: changes the length of the audio track while preserving the original pitch)
(2) Pitch changed preserving tempo.(hint: manipulates pitch, but Track length will kept unchanged)
(3) Rate, tempo and no pitch correction.(hint: changes the length of the audio track without preserving the original pitch )
?

Are the details right(i may be completely wrong)? :rolleyes:

Chumbo
31st March 2007, 16:10
...then:
(1) Tempo changed, pitch correction.(hint: changes the length of the audio track while preserving the original pitch)
(2) Pitch changed preserving tempo.(hint: manipulates pitch, but Track length will kept unchanged)
(3) Rate, tempo and no pitch correction.(hint: changes the length of the audio track without preserving the original pitch )
?

Are the details right(i may be completely wrong)? :rolleyes:
Thanks alwa. I'll add the hints too.

[EDIT]2007-03-31 (Chumbo)
+ updated TimeStretch rate control radio button labels per suggestions by tebasuna, alwa and madshi.
+ added hints/popup text to rate control radio buttons. I wound up using the AVISynth text for the hint text as it's straightforward.

Latest BeHappy update (http://www.mytempdir.com/1277580)

=Wolf=
1st April 2007, 00:45
I have tried to make 5.1 -> 2.0 so here that has left....
http://webfile.ru/1362905 <- ac3

AC3 5.1 -> MP3
Starting job 17_jpn.ac3->17_jpn.mp3
Found Audio Stream
Channels=2, BitsPerSample=32 int, SampleRate=48000Hz
lame.exe -b 128 -h -S --silent - "C:\FTP\Incoming\17_jpn.mp3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete


AC3 5.1 -> Ogg
Starting job 17_jpn.ac3->17_jpn.ogg
Found Audio Stream
Channels=2, BitsPerSample=32 float, SampleRate=48000Hz
oggenc2.exe -Q --quality 3 -o "C:\FTP\Incoming\17_jpn.ogg" -
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete

tebasuna51
1st April 2007, 02:10
I have tried to make 5.1 -> 2.0 so here that has left....
Seems all perfect.

1) Ac3 5.1 decoded by NicAc3Source produce 32 float. The downmix function works in 32 float, perfect. Now we want encode with Lame. Warning Lame don't support 32 float, the best quality supported is 32 int, then we need a conversion to 32 int. Done. All the process is make with the best quality possible.

2) Ac3 5.1 to Ogg. All the same but oggenc2 accept 32 float. Congratulations! we don't need convert the 32 float and is delivered to the encoder directly.

I test your sample and all is ok here.

=Wolf=
1st April 2007, 02:17
@tebasuna51
Then why at me such result turns out?
At work lame...
http://home.farlep.net/~wolf2/17_new.mp3

tebasuna51
1st April 2007, 02:45
Here (http://www.mytempdir.com/1278134) is your sample with:
- Open with NicAc3Source("17.ac3", DRC=0)
- Douwmix -> 2.0 with DLP II
- Normalize(45%) to be comparable with your sample
- Automatic conversion to 32 int
- Encoded with Lame 128 Kb/s CBR (like your sample)

Only your mp3 is broken? The ogg play fine?

tebasuna51
1st April 2007, 03:41
BeHappy update (http://www.mytempdir.com/1278153) :
- Changes to support new enc_aacPlus.exe from Shon3i. (NeroDigitalEncoder.cs, CodingTechnologiesAAC.cs)

- New enc_aacPlus.exe version to support enc_aacPlus.dll from WinAmp 5.33/5.34 and new MP4mux instead MP4Box. (enc_aacPlus.exe, MP4mux.exe)

=Wolf=
1st April 2007, 05:55
@tebasuna51
Yes....
- Open with NicAc3Source("17.ac3", DRC=0)
- Douwmix -> 2.0 with Stereo
- Normalize(100%)
- Encoded with Lame 128 Kb/s CBR
ONLI Lame broken... ogg, aac (32float) working is fine.... :(

madshi
1st April 2007, 10:08
The new options for rate/tempo/pitch have good names now (and helpful hints). Thank you guys!

tebasuna51
1st April 2007, 10:23
ONLI Lame broken... ogg, aac (32float) working is fine...
I use LAME 3.97 Release (http://www.rarewares.org/mp3.html)
Bundle: includes lame.exe, lame_enc.dll. (ICL9.1) 2006-10-03.

tebasuna51
4th April 2007, 10:56
AFAIK the actual ac3 free decoders (NicAudio, Azid, ffdshow, Ac3Filter, ...) can't decode DDP.
Only if you have installed in your system a DirectShow decoder filter capable to decode DDP, you can convert it to any other format.

Rectal Prolapse
4th April 2007, 17:23
Sonic Audio Decoder 4.2 can decode DD+ soundtracks.

After you install Sonic Cinemaster Decoder Pack 4.2, you can then use GraphEdit to make a .grf file, that can be loaded into BeHappy as a DirectShowSource.

Graph:

File Source (Async.) -> Sonic HD Demuxer -> Sonic Audio Decoder 4.2

Hopefully this will work for you.

idbirch2
8th April 2007, 17:17
Hi, I'm trying to correct a gradual sync problem after a HD-DVD re-encode and am trying to stretch an AC3 file. Only ever so slightly as over a 2h21m film, it is only about 3.5s out by the end.

Anyway, when I try and do this with BeHappy 0.1.10.17947 I croaks straight away, in the log window, all I get is:

Found Audio Stream
Channels=6, BitsPerSample=16 int, SampleRate=48000Hz
Aften.exe -v 0 -b 384 -m 1 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "H:\\poto-eac3to_happy.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.ApplicationException: Abnormal encoder termination 1
at BeHappy.Encoder.encode()
#### Encoder StdErr ####

Aften: A/52 audio encoder
Version 0.06
(c) 2006-2007 Justin Ruggles, et al.

usage: aften [options] <input.wav> <output.ac3>
type 'aften -h' for more details.

Its as if the syntax used is wrong but how do I fix this? Thanks.

tebasuna51
8th April 2007, 20:08
"H:\\poto-eac3to_happy.ac3"

Seems the output file sintax is the problem

idbirch2
8th April 2007, 21:15
Sorry, I should have mentioned, I did spot that already and tried deleting the extra \ but the result is exactly the same. I can preview the output so I know the source filter is working. I don't suppose it matters but why does BH insert double \\'s because that wasn't an error on my part?

Chumbo
8th April 2007, 23:41
Sorry, I should have mentioned, I did spot that already and tried deleting the extra \ but the result is exactly the same. I can preview the output so I know the source filter is working. I don't suppose it matters but why does BH insert double \\'s because that wasn't an error on my part?
Below is an output from one of my many transcodes with BH and it never adds a double backslash. Internally, the code may use a "\\" to translate to "\" but that's standard.
Found Audio Stream
Channels=6, BitsPerSample=24 int, SampleRate=48000Hz
Aften.exe -v 0 -b 640 -m 1 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 27 -dynrng 5 - "E:\Media\audio\hf.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder

Check your input file path and name and make sure the input is okay. Try another drive and maybe even a simple file name, i.e., remove the dash and underscore, just to rule those things out.

idbirch2
9th April 2007, 10:16
Sorry, no joy. I moved the entire BeHappy folder to the root of C:\ in case it didn't like its location and also moved the target ac3 file to the same place, the result is the same. Here's how I have behappy set up:

http://img03.picoodle.com/img/img03/7/4/9/f_screenm_f2cf10b.gif (http://www.picoodle.com/view.php?srv=img03&img=/7/4/9/f_screenm_f2cf10b.gif)

What version of Aften are you using?

edit: I forgot, here's the output from this test:

Starting job test.ac3->test2.ac3
Found Audio Stream
Channels=6, BitsPerSample=16 int, SampleRate=48000Hz
Aften.exe -v 0 -b 384 -m 1 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "C:\test2.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.ApplicationException: Abnormal encoder termination 1
at BeHappy.Encoder.encode()
#### Encoder StdErr ####

Aften: A/52 audio encoder
Version 0.06
(c) 2006-2007 Justin Ruggles, et al.

usage: aften [options] <input.wav> <output.ac3>
type 'aften -h' for more details.

tebasuna51
9th April 2007, 10:51
What version of Aften are you using?

edit: I forgot, here's the output from this test:
Channels=6, BitsPerSample=16 int, SampleRate=48000Hz
Aften.exe -v 0 -b 384 -m 1 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "C:\test2.ac3"
...
Aften: A/52 audio encoder
Version 0.06

Please use the last shon3i package (http://forum.doom9.org/showthread.php?p=974646#post974646)

For Aften you need rev449 at least, because with 2h21m 6 channnls you need "-readtoeof 1" not supported by v0.06.

idbirch2
9th April 2007, 11:52
Thanks very much for your help. I did originally start out using build 449 but I must have been doing something else wrong then as having gone back to 449, BH is now working :)

tauka
25th April 2007, 03:08
hi guys, i need a little help. i have the newest behappy, and i try to convert an ac3 file from pal to ntsc 6ch wav, its 2h24min long.. the problem is this: i open the wav with any prog, it shows 2:04:17.. in delaycut in the info actually the correct length is shown (2h31min), but in the target file the 2:04:17 again.. what can be the problem? the wav is actually around 4,8gig.. any suggestion? is it possible at all to convert such a long track with behappy?
thanks

update: well, i actually managed to get the correct length, but only if i load in the six separate mono wavs and stretch those.. strange.. but the ntsc track isnt good, it goes out of sync at the end, but its correct in the beginning.. with adobe audition i get with time stretch perfect timing.. :s

tebasuna51
25th April 2007, 18:58
hi guys, i need a little help. i have the newest behappy, and i try to convert an ac3 file from pal to ntsc 6ch wav, its 2h24min long.. the problem is this: i open the wav with any prog, it shows 2:04:17..
Then don't trust in these prog's.
in delaycut in the info actually the correct length is shown (2h31min), but in the target file the 2:04:17 again.. what can be the problem? the wav is actually around 4,8gig.. any suggestion?
Wav files have a header field with a 4GB limit (or 2:04:17 for wav 16 bit int, 6 channel, 48 KHz) but you have more data until 4.8 GB or 2h31m.
Edit: see also this link (http://forum.doom9.org/showthread.php?p=974973#post974973)

Don't worry Aften can encode this long track with the parameter: -readtoeof 1.
If you want encode to aac, NeroAacEnc also support long files with -ignorelength parameter.
is it possible at all to convert such a long track with behappy?
Of course, and don't need the huge intermediate wav file. Just I make a test with an ac3 7846.336 seconds. ( 2 h. 10 m. 46.336 s.) and timestretch 25 -> 23.976 directly to ac3 and the result is 8181.472 seconds. ( 2 h. 16 m. 21.472 s.) with less than a frame error (32 ms) than 7846.336*25/23.976 = 8181,448

thuongshoo
1st May 2007, 16:52
Hi ! Thank all for continueing to developt BeHappy. I love all new feature.
I used to use OggdropXP. It can estimate bitrate in Q mode. I hope that a new version will has this feature.
Bye!

thuongshoo
3rd May 2007, 07:52
tebasuna1! You seem to be the one which do last correct. Can you send a copy of newest version of BeHappy to me ?
Thank you!

tebasuna51
3rd May 2007, 13:27
tebasuna1! You seem to be the one which do last correct. Can you send a copy of newest version of BeHappy to me ?
Last links resumed:
2007-03-24 Last Shon3i BeHappy package (http://www.box.net/shared/nkihizx1dh)

2007-03-31 Chumbo mod (http://www.mytempdir.com/1277580) for Timestretch and others v0.1.10

2007-04-01 BeHappy mod (http://www.mytempdir.com/1278153) to support new enc_aacPlus.exe and MP4mux


Don't forget last Aften 0.07 (http://forum.doom9.org/showthread.php?p=996683#post996683)

thuongshoo
5th May 2007, 09:47
Oh! Thanks tebasuna51!
I didn't say clearly. I like source code :)
These pic decribe my words

tebasuna51
5th May 2007, 12:38
Last BeHappy sources (http://www.mytempdir.com/1318681).

Use http://www.imageshack.us/ to share pic's and avoid the "Attachments Pending Approval".

tebasuna51
7th May 2007, 15:21
I didn't say clearly. I like source code :)
These pic decribe my words
Sorry I can't reproduce your problem (I haven't Visual C++), I only obtain this:
http://img263.imageshack.us/img263/8694/ctaacuf6.png (http://imageshack.us)

NoX1911
13th May 2007, 17:50
I'm trying to convert AC3 to AAC 6ch. The source is a DVB stream (live concert). I don't know if it has DRC. How can i figure that out (metadata)?

If i use 'NicAC3Source (DRC)' what compression rate will be used? Most standalone dvd players have 3 profiles (low, med, high).

tebasuna51
13th May 2007, 18:58
I'm trying to convert AC3 to AAC 6ch. The source is a DVB stream (live concert). I don't know if it has DRC. How can i figure that out (metadata)?
You need read the header like in http://forum.doom9.org/showthread.php?p=993860#post993860
Read the next posts also.
If i use 'NicAC3Source (DRC)' what compression rate will be used? Most standalone dvd players have 3 profiles (low, med, high).
The attenuation values supplied in the ac3 stream are used without correction. I don't know what is: low, med, high. Maybe half, full, double?

NoX1911
13th May 2007, 22:51
Ok.. just hoped there would be something like this where you could additionally modify the DRC (or change metadata/Line Mode Profile of AC3).

http://www.imagebanana.com/img/ykt0wrx8/ac3.png

http://www.imagebanana.com/img/a6x8zg0/drc.png

tebasuna51
13th May 2007, 23:38
Ac3Filter have a DRC function independent of the DRC data in ac3 stream. NicAudio is a decoder to apply only the DRC data in the stream, if you want addicional/different compression you can use SoxFilter.

NoX1911
13th May 2007, 23:56
I think its not a different compressor. It is intended by Dolby to have impact on DRC like this to optimize volume for different environments (small speakers (high compression/flat sound), big speakers (no compression/full dynamic)). That's the way 'dialogue normalization' works. There are official dolby whitepapers linked in the faq sticky (http://forum.doom9.org/showthread.php?t=56020). I think i read it there...

My settop dvd player has some static values (low, med, high) for DRC that do the same what Ac3Filter does (i think) so this must be intended by dolby.

The second screenshot i posted above holds some metadata for 'line mode profile'. These could be preset values for that additional compression and may be used by Nic's DRC method.

But i'm not sure on that...

Edit:
solved... neroaacenc.exe has to be moved to 'encoder' folder.

Beside of that BeHappy doesn't work with my scenario. I use BeHappy with aac update.
NicAc3Source(DRC) to load my Ac3 file. If i output as avs script it works fine with mpc. If i enqueue and start the batch process following error msg appears in the log:

Translation:
Das System kann die angegebene Datei nicht finden = File not found

Starting job ggg.ac3->ggg.mp4
Found Audio Stream
Channels=2, BitsPerSample=32 float, SampleRate=48000Hz
encoder\neroAacEnc.exe -ignorelength -q 0.3 -if - -of "F:\ggg.mp4"
Error: System.ApplicationException: Can't start encoder: Das System kann die angegebene Datei nicht finden ---> System.ComponentModel.Win32Exception: Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei System.Diagnostics.Process.Start()
bei BeHappy.Encoder.createEncoderProcess(AviSynthClip x)
--- Ende der internen Ausnahmestapelüberwachung ---
bei BeHappy.Encoder.createEncoderProcess(AviSynthClip x)
bei BeHappy.Encoder.encode()

solved... neroaacenc.exe has to be moved to 'encoder' folder.

tebasuna51
14th May 2007, 02:16
My settop dvd player has some static values (low, med, high) for DRC that do the same what Ac3Filter does (i think) so this must be intended by dolby.
Not exactly. Your standalone, and soft decoders like PowerDVD, Azid, ffdshow, NicAudio, ... read the gain/attenuation value put in the ac3 stream for each block (5.33 ms) and apply the full value or a part only, don't calculate the DRC needed analyzing the sound decoded.
AC3Filter analyze the sound and calculate the DRC required.
The second screenshot i posted above holds some metadata for 'line mode profile'. These could be preset values for that additional compression and may be used by Nic's DRC method.

These presets are used at encoding time. The encoder calculate the appropriate gain/attenuation in function of these presets and the actual volume and put this value in the ac3 stream for each block (5.33 ms). The decoders don't need calculate, only read the values proposed by the encoder.

thuongshoo
16th May 2007, 03:27
This is a new version of BeHappy
http://www.box.net/shared/5tyvsczuxo
:)

alwa
16th May 2007, 17:08
This is a new version of BeHappy
http://www.box.net/shared/5tyvsczuxo
:)

@thuongshoo:You should list your changes.
I've noticed chages in OggVorbisEncoder.cs and CodingTechnologiesAAC.cs, please document them. :rolleyes:

Maybe the mod should have it's own repository, something like a project page on sf.net.

tebasuna51
16th May 2007, 20:30
In CodingTechnologiesAAC.cs only size parameters to avoid the problem in post #568.

In OggVorbisEncoder.cs size parameters and:
if (Quality <= 4) ApproximateBitrate = (double)(Quality + 2)*16 + 32;
if ((Quality > 4) && (Quality <= 8)) ApproximateBitrate = (double)(Quality - 4) * 32 + 128;
if (Quality > 8 && Quality <= 9) ApproximateBitrate = (double)(Quality - 8) * 64 + 256;
if (Quality > 9) ApproximateBitrate = (double)((Quality - 9)) * 179.8 + 320;
rbtnVBR.Text = string.Format("Variable Bitrate Q={0} approximate {1} kbs", Quality,ApproximateBitrate);

I don't use ogg files and don't know if is correct or not, but maybe the number of channels need to be considered.

thuongshoo
17th May 2007, 10:56
I've noticed chages in OggVorbisEncoder.cs and CodingTechnologiesAAC.cs, please document them.
@alwa:I'm sorry!
CodingTechnologiesAAC.cs: I resized and changed position of component to avoid the problem in post #568
OggVorbisEncoder.cs: added "ApproximateBitrate" value.
I don't use ogg files and don't know if is correct or not, but maybe the number of channels need to be considered.
@Tebasuna51: I tested 2 file and feel Ok. Everyone please re-test :)

It is quite right if I use oggenc2 while oggenc show a lower bitrate.
I'm using MediaInfo to observer information of media file
This feature come from OggDropXPd
http://img149.imageshack.us/img149/4330/approximatebitrateix7.th.png (http://img149.imageshack.us/my.php?image=approximatebitrateix7.png)

Link to download oggenc2 ( I prefer oggdropXPd V.1.8.9 using libVorbis v1.1.2 with IMPULSE_TRIGGER_PROFILE Option)
and OggDropXP
http://www.rarewares.org/ogg.html
Good luck! :)

tebasuna51
17th May 2007, 12:08
@Tebasuna51: I tested 2 file and feel Ok. Everyone please re-test

I say the approximate bitrate is only for stereo audio:

StereoTrack -> Ogg Q=3 approx. 112 kbs -> Real 113 Kb/s OK.
StereoTrack -> Downmix to mono -> Ogg Q=3 approx. 112 kbs -> Real 62 Kb/s
StereoTrack -> Upmix to 5.1 -> Ogg Q=3 approx. 112 kbs -> Real 441 Kb/s

I propose only a literal change:
Variable Bitrate Q=3 (approx. 112 kb/s for stereo)

MuLTiTaSK
22nd May 2007, 17:55
this tool is amazing i mostly use it to convert .ac3 files i extract from my dvd's to .mp3 format and it works great

but now i want to use it to convert a 224Kbps CBR 2CH Stereo 48KHz .mpa i extracted with DGIndex from one of my tuner caps to .ac3 format so i can import it into a dvd authoring program

i never did this before so i'am not sure what encoder to use and what settings to set in BeHappy i tried with ffmpeg but not sure if i did it right

i'am using lastest Shon3i BeHappy package with 2007-04-01 BeHappy mod http://forum.doom9.org/showthread.php?p=998715#post998715

below is the log i got after the encode was done
hope someone can help me do this conversion right thanks in advance

settings i used in BeHappy
http://i12.tinypic.com/4ka87t5.png


Starting job test T01 DELAY 0ms.mpa->test T01 DELAY 0ms.ac3
Found Audio Stream
Channels=2, BitsPerSample=32 int, SampleRate=48000Hz
ffmpeg.exe -i - -y -acodec ac3 -ab 192 "H:\Caps\test T01 DELAY 0ms.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete
#### Encoder StdErr ####
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mingw32 --enable-memalign-hack --enable-gpl --enable-a52 --enable-dts --enable-mp3lame --enable-faac --enable-amr_nb --enable-faad --enable-amr_wb --enable-pp --enable-x264 --enable-xvid --enable-theora --enable-libogg --enable-vorbis
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on May 13 2006 18:31:30, gcc: 4.1.0 [Sherpya]
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 3072 kb/s
Stream #0.0: Audio: pcm_s32le, 48000 Hz, stereo, 3072 kb/s
Output #0, ac3, to 'H:\Caps\test T01 DELAY 0ms.ac3':
Stream #0.0: Audio: ac3, 48000 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0

video:0kB audio:145896kB global headers:0kB muxing overhead 0.000000%

tebasuna51
22nd May 2007, 19:30
@MuLTiTaSK
What is the problem?
Seems the conversion is ok. You have a 'H:\Caps\test T01 DELAY 0ms.ac3' about 145896 kB.
Don't worry about info from ffmpeg, all is ok.

Maybe you can use the last Aften (http://kurtnoise.free.fr/index.php?dir=Aften/&file=aften_rev511.zip) like encoder with more options than ffmpeg.

shon3i
22nd May 2007, 19:38
yep, everythig is normal like log says, if file is playable, there is nothing to do.

btw new package will be redy, at the end of this week

MuLTiTaSK
22nd May 2007, 19:52
@MuLTiTaSK
What is the problem?
Seems the conversion is ok. You have a 'H:\Caps\test T01 DELAY 0ms.ac3' about 145896 kB.
Don't worry about info from ffmpeg, all is ok.

Maybe you can use the last Aften (http://kurtnoise.free.fr/index.php?dir=Aften/&file=aften_rev511.zip) like encoder with more options than ffmpeg.

i wasnt sure if BeHappy was reporting a error by looking at the log i was a little confused thank you guys for clearing that up for me

would i get better quality using aften to encode the .mpa to .ac3?

i notice it had more settings but i did'nt know which ones to set so i used ffmpeg ;/

would these settings be correct for my conversion thanks again
http://i13.tinypic.com/4lpfh1x.png

tebasuna51
22nd May 2007, 20:05
These default settings are ok, equivalents to ffmpeg.

Aften is based in same code than ffmpeg but have some improvements, maybe not noticeable but there are.

If you want ensure the max volume without clipping you can use the DSP function Normalize 100%

MuLTiTaSK
22nd May 2007, 21:55
worked like a charm thanks alot tebasuna51 & everyone else keeping this great program alive

shon3i your packages help a great a deal thank you very much for building them saves new users to the program alot of grief

i'am still surprised why more people dont use this gem

is there a reason BeHappy is not listed on sites like?

http://www.digital-digest.com/software/topcategory-23.html
http://www.videohelp.com/tools/sections/audio-encoders

thuongshoo
27th May 2007, 12:34
StereoTrack -> Ogg Q=3 approx. 112 kbs -> Real 113 Kb/s OK.


StereoTrack -> Downmix to mono -> Ogg Q=3 approx. 112 kbs -> Real 62 Kb/s
62 = 112/2
StereoTrack -> Upmix to 5.1 -> Ogg Q=3 approx. 112 kbs -> Real 441 Kb/s
I don't know how 5.1 file is encoded.
I used word "Approximate Bitrate" , not "Bitrate". We are using "Q mode"

tebasuna51
27th May 2007, 13:24
I don't know how 5.1 file is encoded.
I used word "Approximate Bitrate" , not "Bitrate". We are using "Q mode"

5.1 (441 Kb/s) is encoded with Q mode and literal:

"Variable Bitrate Q = 3 approximate bitrate 112 kbs"

And I propose a literal like:

"Variable Bitrate Q = 3 (approx. 112 Kb/s for stereo)"

paranoid87
16th June 2007, 17:05
are you sure? teba? that the 5.1 is encoded witht the Q mode?

tebasuna51
16th June 2007, 21:43
are you sure? teba? that the 5.1 is encoded witht the Q mode?
I'm sure about the commandline:

Channels=6, BitsPerSample=16 int, SampleRate=48000Hz
oggenc2.exe -Q --quality 3 -o "G:\Test.ogg" -

and the result is a ogg 5.1 with bitrate 441 (Foobar Properties)

chros
21st June 2007, 18:08
Last links resumed:
2007-03-24 Last Shon3i BeHappy package (http://www.box.net/shared/nkihizx1dh)
I'm using this version, but encoding to flac doesn't manage:
Starting job audio.ac3->audio.flac
Found Audio Stream
Channels=6, BitsPerSample=24 int, SampleRate=48000Hz
flac.exe --best --force -o "F:\audio.flac" --silent --force-raw-format --endian=little --channels=6 --bps=24 --sample-rate=48000 --sign=signed --input-size=7172361216 -
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: Using the pipe has finished.
source: ac3 , with NicAC3Source , filters: none, flac: best

tebasuna51
22nd June 2007, 00:56
I'm using this version, but encoding to flac doesn't manage...


Works for me with small samples (--input-size=183057408):
Starting job Test.ac3->Test.flac
Found Audio Stream
Channels=6, BitsPerSample=24 int, SampleRate=48000Hz
flac.exe --best --force -o "D:\Test.flac" --silent --force-raw-format --endian=little --channels=6 --bps=24 --sample-rate=48000 --sign=signed --input-size=183057408 -
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete

But also crash with big sources (--input-size=7068791808):
Starting job 136_min.ac3->136_min.flac
Found Audio Stream
Channels=6, BitsPerSample=24 int, SampleRate=48000Hz
flac.exe --best --force -o "G:\136_min.flac" --silent --force-raw-format --endian=little --channels=6 --bps=24 --sample-rate=48000 --sign=signed --input-size=7068791808 -
Error: System.ApplicationException: Can't start encoder: Cannot process request because the process (1096) has exited. ---> System.InvalidOperationException: Cannot process request because the process (1096) has exited.
...

The same source can be transcoded to wav or aac without problems, then seems a flac encoder problem.

buzzqw
22nd June 2007, 07:10
i can confirm the bug using ffmpeg for piping to faac.
sothing is wrong in faac pipe input

BHH

tebasuna51
22nd June 2007, 10:38
i can confirm the bug using ffmpeg for piping to faac.
sothing is wrong in faac pipe input

Are you talking about faac or flac?

buzzqw
24th June 2007, 18:12
ops.. misread... i mean faac not flac

BHH

jordisound
3rd July 2007, 15:07
I've tried to convert an ac3 4 channels from an old DVD to 4 wavmono using behappy (installer 20070315). After process only appears FL, FR.
Using besweet i've got the 4 channels FL, FR, C, S (SL, SR are the same, and LFE is empty.)
So, behappy is not able to convert 4.0 to 4 wavmono? or have I to change the configuration?
Thanxs!

Chumbo
3rd July 2007, 18:40
I've tried to convert an ac3 4 channels from an old DVD to 4 wavmono using behappy (installer 20070315). After process only appears FL, FR.
Using besweet i've got the 4 channels FL, FR, C, S (SL, SR are the same, and LFE is empty.)
So, behappy is not able to convert 4.0 to 4 wavmono? or have I to change the configuration?
Thanxs!
You have to feed your source using an AVS script and add the GetChannel command to grab each channel separately. Add each script to the queue and then run it to produce each wav file.

tebasuna51
3rd July 2007, 19:00
I've tried to convert an ac3 4 channels from an old DVD to 4 wavmono using behappy (installer 20070315). After process only appears FL, FR.
Using besweet i've got the 4 channels FL, FR, C, S (SL, SR are the same, and LFE is empty.)
So, behappy is not able to convert 4.0 to 4 wavmono? or have I to change the configuration?

The problem is in the ac3 decoder (NicAudio.dll) and is detected in this thread (http://forum.doom9.org/showthread.php?p=977363#post977363)

When the ac3 is 3/1 (FL, C, FR, S) NicAudio make an automatic downmix to:
3/1.0 -> stereo downmix
lt = 0,4xFL + 0,3xC + 0,3xS
rt = 0,4xFR + 0,3xC + 0,3xS

If the ac3 is 2/2 (FL, FR, SL, SR) NicAudio works ok.

- To decode properly an ac3 3/1.0, with free tools, you need use Azid.exe directly with:

azid.exe -d3/1 -ol,r,c,sl input.ac3 output.wav

The output.wav is a 4 channel (FL, FR, C, S) wav and you can split in mono wav's with WaveWizard or Wav2mono (1)

- Also you can use Foobar2000 to Convert to a WAVE_FORMAT_EXTENSIBLE wav or, if you use Wav2mono with Foobar, directly to 4 mono wav's (1)

(1) The wav's are named FL, FR, BL, BR and must be FL, FR, C, S

jordisound
3rd July 2007, 22:17
ok. i'll try and tell you if it works. thank you tebasuna.

edit:
it works.
The wav's are named FL, FR, BL, BR and must be FL, FR, C, S
exact! this is very important!

bjt
9th July 2007, 16:57
Where I can download the newest version of behappy ?

BeHappy Workspace (http://workspaces.gotdotnet.com/behappy )has been phased-out.

tebasuna51
9th July 2007, 19:20
Where I can download the newest version of behappy ?

BeHappy Workspace (http://workspaces.gotdotnet.com/behappy )has been phased-out.
Yes GotDotNet is out and the BeHappy author Dimzon is also out of this forum from long time.

The last 'official' release is from 2006-07-19, but there are mod's here (http://forum.doom9.org/showthread.php?p=998715#post998715) and here (http://forum.doom9.org/showthread.php?p=1003847#post1003847).

Search always in this thread.

BTW, I make a copy of GotDotNet info, if anybody need old sources ...

fight2win
15th July 2007, 06:47
Yes GotDotNet is out and the BeHappy author Dimzon is also out of this forum from long time.

The last 'official' release is from 2006-07-19, but there are mod's here (http://forum.doom9.org/showthread.php?p=998715#post998715) and here (http://forum.doom9.org/showthread.php?p=1003847#post1003847).

Search always in this thread.

BTW, I make a copy of GotDotNet info, if anybody need old sources ...

sir, mytempdir links are removed file,pls can u update the mytempdir links,please?

tebasuna51
16th July 2007, 01:27
sir, mytempdir links are removed file,pls can u update the mytempdir links,please?

Working links:

2007-03-24 Last Shon3i BeHappy package (http://www.box.net/shared/nkihizx1dh)

Last BeHappy mod (http://www.box.net/shared/5tyvsczuxo).

About enc_aacplus you can see this thread (http://forum.doom9.org/showthread.php?p=977901#post977901).

I think you have all the necessary.

fight2win
16th July 2007, 07:34
Working links:

2007-03-24 Last Shon3i BeHappy package (http://www.box.net/shared/nkihizx1dh)

Last BeHappy mod (http://www.box.net/shared/5tyvsczuxo).

About enc_aacplus you can see this thread (http://forum.doom9.org/showthread.php?p=977901#post977901).

I think you have all the necessary.

thanks

buzzqw
16th July 2007, 09:30
@tebasuna51

why not open a new thread , with the new links .. and ask for developers support?

BHH

tebasuna51
16th July 2007, 11:43
why not open a new thread , with the new links .. and ask for developers support?

Developers for what?

What is the TODO list for BeHappy?

BeHappy is only a GUI to write avs's and encoder parameters for inexpert users. We never can replace a expert user writing avs's and never can put all parameters (see Aften for instance) of a encoder without confuse the newbies.

Actually my only doubt about BeHappy is use the last enc_aacplus or not (see the thread mentioned (http://forum.doom9.org/showthread.php?p=977901#post977901)).

Other question is AviSynth Audio Encoding with more general issues, common with others tools to convert avs's to audio like BePipe, Wavi (http://forum.doom9.org/showthread.php?p=1019016#post1019016) or SoundOut (http://forum.doom9.org/showthread.php?t=120025).

I'm testing Bass libraries 2.3 with a new BassAudio.dll (http://www.mybigdir.com/1893) and there are some improvements about aac multichannel decoding.
To be continued...

tebasuna51
17th July 2007, 17:43
Decoding the aac multichannel (in .mp4 container), with Bass_aac 2.3.0.1 the channel mapping is ok. But ...

- Decoding .aac, instead .mp4, SoundOut and BeHappy/BePipe crash (Fatal stack overflow error with BePipe). Wavi work but there are some artifacts.

- Decoding .mp4, Wavi and SundOut work with a few artifacts but BeHappy/BePipe have a lot of artifacts.

- Also I get artifacts decoding two channel aac, Bass 2.2 works fine.

I can't recommend the use of Bass 2.3 for aac or ac3.

I can't see changes with Bass 2.2 decoding wav (WAVE_FORMAT_EXTENSIBLE), ogg, mp2, mp3 or wma then using Bass 2.2 at least aac stereo can be used.

fight2win
17th July 2007, 18:37
does bassaudio enhance ac3 to aac encoding in any way?

tebasuna51
17th July 2007, 19:10
does bassaudio enhance ac3 to aac encoding in any way?
Nope, you can use NicAc3Source like decoder and Nero or CT for encoding ac3 -> aac.

We are searching a dedicated multichannel aac AviSynth decoder to use instead the problematic DirectShowSource method.

Bluedeep
18th July 2007, 09:47
I'm trying to convert ac3 file on raw pcm.

It show this error:

Starting job VTS_01_1 T01 2_0ch 192Kbps DELAY -192ms.ac3->VTS_01_1 T01 2_0ch 192Kbps DELAY -192ms_0f4e7507bf9748eaaa7d22b8485d4cb8.dat
Error: BeHappy.AviSynthException: unexpected character ""
in BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
in BeHappy.Encoder.encode()


Any idea?

Thanks

EDIT: I've tried also Last BeHappy mod, but there is an windows error crash (I think is AvisynthWrapper.dll )

EDIT2: Oh my bad! I used Directshow and now works ;)

DiGiT@LON€
9th August 2007, 16:28
Hello, I'm italian and I'm trying to convert some audio tracks with BeHappy (I'm sorry about some mistakes for the language).
Unfortunately, I'm having problems.
Everytimes I try to convert (from some format to another one), an error occurs and the tool is closed by windows XP.
Here's a screenshot before the quit of the tool.
http://img128.imageshack.us/img128/5185/errorbehappybi8.th.jpg (http://img128.imageshack.us/my.php?image=errorbehappybi8.jpg)

I have 0.1.9.35190 version, with Avisynth 2.8 and Net Framework 2.0.
How can I resolve?
Thanks.

vlada
9th August 2007, 16:36
Avisynth 2.8? I don't think there is such a version. You probably meant 2.58? If it's so, I would try the latest stable version which is 2.57.

DiGiT@LON€
9th August 2007, 17:42
Avisynth 2.8? I don't think there is such a version. You probably meant 2.58? If it's so, I would try the latest stable version which is 2.57.I'm a totally careless. I installed 2.08 version.
But I have installed 2.57 version and the problem has occurred again.
What can I do?:(

DiGiT@LON€
9th August 2007, 21:54
I have reinstalled BeHappy and now it is running perfectly.

tebasuna51
13th August 2007, 20:40
A new release (http://www.mytempdir.com/2002112) of Behappy, for shon3i request.

Maybe shon3i can offer a new full release, but here are sources, last .exe's from BeHappy team and links to external free tools.

The changelog is:

2007-08-13 (Tebasuna)
+ New changes to support new enc_aacPlus.exe from Shon3i: select between Mp4Box and Mp4Mux. (CodingTechnologiesAAC.cs)
+ New FraunhoferMp3.extension to support free mp3sEncoder.exe from Fraunhofer (http://www.all4mp3.com/tools/sw_fhg_cl.html).
+ New wavSplit.extension and wavSplit.exe to replace wav2mono and wav2stereo
+ Only literals changes. (AssemblyInfo.cs, OggVorbisEncoder.cs)

The test are welcome.

ACrowley
24th August 2007, 09:29
Is there any Way/ Plugin/Mod to output mono waves instead of mutichannel interleaved wave ?

I use NicsAC3Source and Timestretch on PAL AC3s and it would be nice to have 6 mono wave Output .
For now i use wavewizard to split interleaved to mono

tebasuna51
24th August 2007, 13:15
Is there any Way/ Plugin/Mod to output mono waves instead of mutichannel interleaved wave ?

I use NicsAC3Source and Timestretch on PAL AC3s and it would be nice to have 6 mono wave Output .
For now i use wavewizard to split interleaved to mono

In precedent Shon3i package there are Wav2mono and Wav2Stereo .exe and .extension.

In the new release in my precedent post there are WavSplit .exe and .extension to replace Wav2mono and Wav2Stereo.
You need only put the files in BeHappy folder, run BeHappy, select WavSplit in BeHappy (4) Destination, instead Wav Writer, and configure (...) mono/stereo.

ACrowley
24th August 2007, 20:28
THX

what is the difference to old wave2mono Output ? Outputs 6 mono waves too...

I found Wavesplit.extension ins \Behappy\src Folder, works fine..nice. Thats all i need :)

Behappy Default Wave output is 32Bit right ?
For AC3 i set it to "Convert Sample to 16bit"

Other Question :
Now i prefer NicAC3Source 1.92 over Azid, because Behappy/NicAudio is more Updated
Is there any Quality Difference in AC3 to Wave decoding ? I dont think so...

And with NicDTSSource compared with Tranzcode 0.4 ?

tebasuna51
25th August 2007, 03:39
what is the difference to old wave2mono Output ? Outputs 6 mono waves too...

None, only reduce the files needed.

Behappy Default Wave output is 32Bit right ?

Nope, now BeHappy don't touch the bitdepth (before the output is always 16 int) if the output encoder accept the bitdepth.

The 32 bit float come from NicAc3Source.

AviSynth can change also the bitdepth if any function don't support the actual.

For AC3 i set it to "Convert Sample to 16bit"

Never, the first thing Aften do is convert to 32 float then you have a double conversion 32 float -> 16 int -> 32 float.
Let the 32 float.

Now i prefer NicAC3Source 1.92 over Azid, because Behappy/NicAudio is more Updated
Is there any Quality Difference in AC3 to Wave decoding ? I dont think so...

Is updated but not in AC3 decoder. I think the quality is the same, only for special num_channels 3, 4, 5 Azid is still necesary.

And with NicDTSSource compared with Tranzcode 0.4 ?

I don't know very much about DTS.

ACrowley
25th August 2007, 08:21
Nope, now BeHappy don't touch the bitdepth (before the output is always 16 int) if the output encoder accept the bitdepth.
The 32 bit float come from NicAc3Source.
AviSynth can change also the bitdepth if any function don't support the actual.
Never, the first thing Aften do is convert to 32 float then you have a double conversion 32 float -> 16 int -> 32 float.
Let the 32 float.
AH, ok NicAC3 Decoder output 32bit..allright
I dont use Aften :) so its no double Conversion
I use Behappy/NicAC3Source only to decode AC3 to wave / Timestretch ( no Pitch Correction).
For AC3 encoding i use a only cert DD Encoder.
For example the cert DD Encoder from Sonic Scenarist accepts only 16bit Wave source.
I think 16bit Output from standard DVD AC3 is enough ? In my case its AC3 Audio from DVD which is 48khz 16bit.
However, NicsAC3Source outputs 32bit and maybe i should leave it to avoid the 16bit conversion

Interesting, what is Default Azids Bitdepth Output ?
And when i set it to 16bit in Besweet, is it "Conversion" too?

thx

tebasuna51
25th August 2007, 10:02
I think 16bit Output from standard DVD AC3 is enough ? In my case its AC3 Audio from DVD which is 48khz 16bit.

AC3 don't have bitdepth because the samples are in frequency domain instead time domain. Maybe the source is 16 bit but not the ac3.

The dynamic range in ac3 is equivalent to 24 bits depth.

Interesting, what is Default Azids Bitdepth Output ?
And when i set it to 16bit in Besweet, is it "Conversion" too?
The default is 16 bits but azid.exe have the parameter:
-F FILE_TYPE, --filetype=FILE_TYPE
----------------------------------

Default: wav

Selects the file type to generate. Possible values are:

o wav. Generates "normal" 16-bits wav.
o wav24. Generate 24-bit integer wav.
o wav32. Generate 32-bits integer wav
o wav_float. Generate 32-bits floating-point (IEEE) wavs.
o pcm. Generate 16-bit pcm (equal to wav, only without
the wav-header)
o pcm32. Generate 32-bit integer PCM
o pcm_float. Generate 32-bits floating-point (IEEE) PCM
output.

ACrowley
25th August 2007, 10:20
AC3 don't have bitdepth because the samples are in frequency domain instead time domain. Maybe the source is 16 bit but not the ac3.


Thats what i mean...more or less

So, What which Bitdepth do you recommend "generally" to decode AC3 to Wave ? I decode without DRC/DialoNorm

I think 32bit is good and you can make nothing wrong,right ? Especially for NicsAC3SOurce to avoid extra 32-16 bit Conversion

tebasuna51
25th August 2007, 12:25
So, What which Bitdepth do you recommend "generally" to decode AC3 to Wave ? I decode without DRC/DialoNorm

I think 32bit is good and you can make nothing wrong,right ? Especially for NicsAC3SOurce to avoid extra 32-16 bit Conversion

If your ac3 encoder support 32 bit float, or you need make some edit, of course is the best option.

But if your encoder only support 16 int ...

ACrowley
25th August 2007, 19:13
If your ac3 encoder support 32 bit float, or you need make some edit, of course is the best option.

But if your encoder only support 16 int ...

Yeah, i use Sony Vegas Dolby Digital Pro Encoder 7
It takes 32bit Input

cweb
4th September 2007, 11:30
The main behappy site is down ...

Nikos
4th September 2007, 12:41
Yeah, i use Sony Vegas Dolby Digital Pro Encoder 7
It takes 32bit Input

Yes the Sony Vegas accept 32 bits wavs input but i think it converts to 16 or 24 bits.

http://blue-whitegt.com/covers/vegas.jpg

tebasuna51
4th September 2007, 12:42
@cweb
Yes...
Use the last shon3i package and mods.
Read this post (http://forum.doom9.org/showthread.php?p=1023021#post1023021) and next ones.

cweb
4th September 2007, 12:48
@cweb
Yes...
Use the last shon3i package and mods.
Read this post (http://forum.doom9.org/showthread.php?p=1023021#post1023021) and next ones.
thanks

ACrowley
4th September 2007, 13:51
@Nikos

No, Vegas dont convert anything.
Because you simply drag and drop your 6 mono waves into it.
Theres no internal Wave Processing or somewaht in this Case
Only when you export/edit the waves ,the internal ProjectSetting is active
So Vegas dont touch the Waves. When you disable View-"Waveform and Frames" ,you can see theres absolutly no internal preprocessing/conversion.
And to display the Waveform Vegas simply read the Input. Theres no writing/Conversion too

32Bit Float Wave after drag&drop into the 5.1 Project :
http://img252.imageshack.us/img252/2396/sshot4nd0.th.png (http://img252.imageshack.us/my.php?image=sshot4nd0.png)
You can see its still 32Bit "before" you render it to AC3 .

@tebasuna51
You told me Behappy dont touch the Input wave Bitdepth ,right ?
But when i run a 16 bit (mono) wave i get 32bit Output from 16Bit Source by default ?
"Channels=1, BitsPerSample=32 float, SampleRate=48000Hz"

Mhh, not nice when i have to select a extra 16 bit Conversion to get my 16bit back from Behappy

tebasuna51
4th September 2007, 16:46
@tebasuna51
You told me Behappy dont touch the Input wave Bitdepth ,right ?
But when i run a 16 bit (mono) wave i get 32bit Output from 16Bit Source by default ?
"Channels=1, BitsPerSample=32 float, SampleRate=48000Hz"

Mhh, not nice when i have to select a extra 16 bit Conversion to get my 16bit back from Behappy

Actually Behappy only touch the bitdepth if the output encoder don't support it, never for uncompressed output.

From AviSynth docs:
"Starting from v2.5 the audio samples will be automatically converted if any filters requires a special type of sample. This means that most filters will accept several types of input, but if a filter doesn't support the type of sample it is given, it will automatically convert the samples to something it supports."

If you use Timestretch, also from AviSynth docs:
"SoundTouch is used in float sample mode."

And if you want 16 bit output a final ConvertAudioTo16bit() must be included explicitly.

ACrowley
4th September 2007, 19:18
AH ,Ok Thx

Nikos
4th September 2007, 20:30
Thanks ACrowley for the explanation about 32 bit wavs in Vegas.

bagge1
16th October 2007, 00:16
A new release (http://www.mytempdir.com/2002112) of Behappy, for shon3i request.

Maybe shon3i can offer a new full release, but here are sources, last .exe's from BeHappy team and links to external free tools.

The changelog is:

2007-08-13 (Tebasuna)
+ New changes to support new enc_aacPlus.exe from Shon3i: select between Mp4Box and Mp4Mux. (CodingTechnologiesAAC.cs)
+ New FraunhoferMp3.extension to support free mp3sEncoder.exe from Fraunhofer (http://www.all4mp3.com/tools/sw_fhg_cl.html).
+ New wavSplit.extension and wavSplit.exe to replace wav2mono and wav2stereo
+ Only literals changes. (AssemblyInfo.cs, OggVorbisEncoder.cs)

The test are welcome.

The links are expired on mytempdir.com. Can somebody please upload Behappy again?

tebasuna51
16th October 2007, 09:14
The links are expired on mytempdir.com. Can somebody please upload Behappy again?

Here (http://www.mytempdir.com/2041184) is a new link to last BeHappy.

Only one change:
2007-10-16 (Tebasuna)
+ New RaWav.extension and AviSynth plugin RaWav.dll. Open files > 4 GB with uncompressed formats like:
wav (WAVE_FORMAT_EXTENSIBLE and others), bwf, raw, au, aif, w64, RF64, or caf (see RaWav_readme)

bagge1
16th October 2007, 09:57
Here (http://www.mytempdir.com/2041184) is a new link to last BeHappy.

Only one change:
2007-10-16 (Tebasuna)
+ New RaWav.extension and AviSynth plugin RaWav.dll. Open files > 4 GB with uncompressed formats like:
wav (WAVE_FORMAT_EXTENSIBLE and others), bwf, raw, au, aif, w64, RF64, or caf (see RaWav_readme)

Thank you, tebasuna51!

Chumbo
4th January 2008, 03:41
I think I found the problem with the stdout stuff. I've removed the link until I get it fixed. It may be tomorrow. Sorry.

Here is another BeHappy update.

Changes:
2008-01-03 (Chumbo)
+ Updated the DSP Move buttons to behave according to selection and position.
+ Added a multiple file feature for the new Aften to create ac3 files from multiple wav sources. I'm sure there's a better way to implement this, but I put it together quickly. Note that this feature is for Aften only. It will launch a command window when executed as I couldn't get the process object to work for some reason. So if anyone can check out the code and get the process stdout redirection working that would be great. That way the output status can be displayed within BeHappy like it normally does. Here are the rules:


When you select Multiple Mono File List,

only the Aften encoder is allowed
avisynth is not used
DSP is disabled along with all other avisynth features

The input file must be a plain text file with either .src, .txt or .lst extension
The input file format is to have each mono wav file on its own line and the file name must have the following indicators in the file name:
_fl = front left
_fr = front right
_c = front center
_lfe= LFE
_sl = surround left
_sr = surround right

See the included SampleMultiMonoFile.txt for an example input file (see below)

C:\Documents and Settings\userx\My Documents\For encoding tests\audio\Test_FL.wav
C:\Documents and Settings\userx\My Documents\For encoding tests\audio\Test_FR.wav
C:\Documents and Settings\userx\My Documents\For encoding tests\audio\Test_C.wav
C:\Documents and Settings\userx\My Documents\For encoding tests\audio\Test_SL.wav
C:\Documents and Settings\userx\My Documents\For encoding tests\audio\Test_SR.wav
C:\Documents and Settings\userx\My Documents\For encoding tests\audio\Test_LFE.wav

Note that the files do not have to be in any specific order as long as you have the correct indicator in the file name. You also do not have to have all 6 channels if you only need FL, FR, LFE for example, you only need to use those files and so on.

For some reason, I couldn't upload the file to mytempdir this time as it kept failing. I uploaded it to rapidshare which I hate because of the waiting crap they do. If someone else can grab this from rapidshare and see if you can put it on mytempdir and share that link, it would be appreciated.

DiGiT@LON€
4th January 2008, 11:10
Here (http://www.mytempdir.com/2041184) is a new link to last BeHappy.

Only one change:
2007-10-16 (Tebasuna)
+ New RaWav.extension and AviSynth plugin RaWav.dll. Open files > 4 GB with uncompressed formats like:
wav (WAVE_FORMAT_EXTENSIBLE and others), bwf, raw, au, aif, w64, RF64, or caf (see RaWav_readme)Wrong File ID. Can somebody upload it?
Thanks.

shon3i
4th January 2008, 12:00
@Chumbo, nice stuff, you should enable to use all multichannel encoders like AAC, and aslo WAV.

Is it possible to make reverse process one multichannel wave to 6 waves?

tebasuna51
4th January 2008, 13:20
@Chumbo, nice stuff, you should enable to use all multichannel encoders like AAC, and aslo WAV.

I can't understand this new stuff.

For what use BeHappy to encode six monowavs to ac3/aac out off AviSynth environment? There are others GUI's to do this.

You always can use BeHappy to do this inside AviSynth with DSP's actives and with any output: ac3, aac, ogg, wav
Instead your .src, .txt or .lst file you only need an .avs file like:

fl = WavSource("X:\Path\Test_FL.wav")
fr = WavSource("X:\Path\Test_FR.wav")
fc = WavSource("X:\Path\Test_C.wav")
lf = WavSource("X:\Path\Test_LFE.wav")
sl = WavSource("X:\Path\Test_SL.wav")
sr = WavSource("X:\Path\Test_SR.wav")
MergeChannels(fl, fr, fc, lf, sl, sr)

And open this .avs in BeHappy with all AviSynth DSP's and features available: delay, timestretch, resample, ...

Maybe we can construct a utility to write this .avs with a graphical interface like BeLight or Wisodev WavtoAc3, but the Chumbo mod I think is out off the BeHappy scope.

Is it possible to make reverse process one multichannel wave to 6 waves?

I don't understand your request. WavSplit can output six monowavs or three stereo wav's from a multichannel input.

tebasuna51
4th January 2008, 14:18
Wrong File ID. Can somebody upload it?
Thanks.

BeHappy_20071016 (http://files.filefront.com/BeHappy+200710167z/;9377564;/fileinfo.html)

In the second post (http://forum.doom9.org/showthread.php?p=758076#post758076) of this thread I try to maintain the last useful links.

DiGiT@LON€
4th January 2008, 16:19
BeHappy_20071016 (http://files.filefront.com/BeHappy+200710167z/;9377564;/fileinfo.html)

In the second post (http://forum.doom9.org/showthread.php?p=758076#post758076) of this thread I try to maintain the last useful links.
Thank you.

Chumbo
4th January 2008, 16:40
...but the Chumbo mod I think is out off the BeHappy scope.
...
Believe it or not, I agree with you regarding the scope. I was just tinkering around to see if it can be done, i.e., without avs and using aften directly. I had some down time and this is what I wasted it on. ;) I may scrap this altogether, but I wanted to get the input/output redirection working just so I learn how that stuff works too.

Personally, I use WAV to AC3 Encoder when my source is multiple wav files. It's quick and I don't have to build a batch file. :)

shon3i
5th January 2008, 00:22
well tebasuna51, you right, i totaly forgot metods :).

Chumbo
6th January 2008, 22:54
Okay, here (http://www.filefactory.com/file/5de667/) is the link to my previous post (http://forum.doom9.org/showthread.php?p=1082618#post1082618).

Like tebasuna51 said, this feature is really something that's out of the scope of BeHappy, but I just wanted to tinker and see if it can be done. It's there if you want to use it, otherwise, it can be ignored.

Included is wisodev's 703 build of aften.

[EDIT]FYI, I just went to wisodev's site (http://win32builds.sourceforge.net/aften/index.html) and there's a newer 723 build available.

Chumbo
6th January 2008, 23:00
...fl = WavSource("X:\Path\Test_FL.wav")
fr = WavSource("X:\Path\Test_FR.wav")
fc = WavSource("X:\Path\Test_C.wav")
lf = WavSource("X:\Path\Test_LFE.wav")
sl = WavSource("X:\Path\Test_SL.wav")
sr = WavSource("X:\Path\Test_SR.wav")
MergeChannels(fl, fr, fc, lf, sl, sr)
...
Maybe we can construct a utility to write this .avs with a graphical interface like BeLight or Wisodev WavtoAc3...
tebasuna, what do you think about adding a gui button to BeHappy that brings up a new UI that allows the user to select the wav files, assign them to the channel and then it creates the avs script for them and puts it directly into BeHappy to encode? It would be a friendly way to have the user construct it without having to manually put it into an avs file.

tebasuna51
6th January 2008, 23:26
tebasuna, what do you think about adding a gui button to BeHappy that brings up a new UI that allows the user to select the wav files, assign them to the channel and then it creates the avs script for them and puts it directly into BeHappy to encode? It would be a friendly way to have the user construct it without having to manually put it into an avs file.

Can be helpful for many users yes.

dimzon
24th January 2008, 19:52
Hi!
I'm moving BeHappy to CodePlex.
http://www.codeplex.com/BeHappy
I will create separate project's for AvisynthWrapper, WinampAAC etc...

dimzon
24th January 2008, 20:08
WARNING 2 ALL BeHappy "moders"
Dear friends! I decide to continue BeHappy development.
Current CodePlex project (http://www.codeplex.com/BeHappy) contains latest official build (from 2006-07-19). So welcome to join this project and upload your improvements ;) Otherwise You must start Your own BeHappy fork with different project name (to avoid version mishmash).


If You want to participate post Your CodePlex nick's here, I will add You to this project.

2 tebasuna51 I trust You, so do You want to be BeHappy project coordinator?

PS. Sorry for my really crappy english, I have no practics for last 2 years :mad:

shon3i
24th January 2008, 22:03
I can't belive, Dimzon you are still alive :D, where are you been man. I miss you :D:D WELCOME BACK!!!!

tebasuna51
25th January 2008, 05:02
Dear friends! I decide to continue BeHappy development.
Hi, dimzon!
You are welcome back. You need explain us your 'holidays' :rolleyes:

If You want to participate post Your CodePlex nick's here, I will add You to this project.
2 tebasuna51 I trust You, so do You want to be BeHappy project coordinator?
Thanks for your trust, of course if can help to BeHappy project you can add my CodePlex nick (always tebasuna51).

And, I think, the project coordinator job is not so hard like you can see by the thread activity. Or you have new ideas about?
For me BeHappy is near perfect and only need some update when AviSynth/decoders/encoders change.

Actually the free soft audio development seems focused to decode new audio formats of HD/BD specs. Maybe (also for Megui) we need new AviSynth decoders for eac3, TrueHD, ...

And about 'mods' don't worry, I think the more important is only delete some code in AviSynthWrapper to take advantage of the new AviSinth 2.5.7 about 32 bit float output.

The last sources are in the second post of this thread. Do you want talk about these finish sources or one per one with all the 'moders'?

patul
25th January 2008, 05:50
OMG Dimzon, I am very glad you're back... where have you been? :D :D Nice to see you again, buddy...

You know, meanwhile you were off, tebasuna51, Chumbo and shon3i were doing very good job to add quite a lot of updates, kudos for them.

I agree with tebasuna51 that BeHappy is nearly perfect and my wish is just keep it as simple as it can be, it will help n00b like me a LOT...

I'm looking forward for updates :D :D

dimzon
25th January 2008, 15:01
Hi 2 all!
I was extremely busy in my real life. Unfortunately I still doesn't have much free time now too...
I'm very surprised (really, I was shocked after quick look at this thread after 2 years) for Your updates e.t.c. But Why You doesn't create project hosting on some service like CodePlex / SourceForge / GoogleCode? File exchange via FileFactory is a really ugly solution for project management...

now talking about "mods"
first of all I have commited latest (2007-10-16) BeHappy sources onto CodePlex. it doesn't include custom avisynth filters etc.
I think we must create different project for AviSynth filters (one for all or one project per filter) bcz they can be used without BeHappy itself.

Now about float processing into AviSynth wrapper ( http://www.codeplex.com/AvisynthWrapper ). I don't like current solution bcz it can broke compatibility. I think we must keep dimzon_avs_init as is and add new dimzon_avs_init_2 and use it. Don't take me wrong, I really want to avoid all possible Version/Fork Hell.

Now about binary releases. I think somebody can combine full package with installer and upload it onto CodePlex.

2 tebasuna51 - You are BeHappy/AvisynthWrapper coordinator now, welcome! Feel free to add new developers to this projects.

tebasuna51
25th January 2008, 21:23
first of all I have commited latest (2007-10-16) BeHappy sources onto CodePlex. it doesn't include custom avisynth filters etc.
Thanks, I see.

I think we must create different project for AviSynth filters (one for all or one project per filter) bcz they can be used without BeHappy itself.
Is true, there are not only for BeHappy, maybe:
- AviSynthWrapper (MeGUI, ...)
- enc_aacPlus (WinampAAC) (command-line or with Foobar, eac3to, ...)
- enc_AudX_CLI (command-line or with Foobar, eac3to, ...)
- Bepipe (command-line used to automate jobs)
- WavSplit (can work in comand-line or with Foobar)
- BassAudio (AviSynth input filter)
- RaWav (AviSynth input filter)

Now about float processing into AviSynth wrapper ( http://www.codeplex.com/AvisynthWrapper ). I don't like current solution bcz it can broke compatibility. I think we must keep dimzon_avs_init as is and add new dimzon_avs_init_2 and use it.
No problem, we can use dimzon_avs_init_2() in AvisynthWrapper.cs and the AvisynthWrapper.dll can remain unique

Now about binary releases. I think somebody can combine full package with installer and upload it onto CodePlex.
Yes, Shon3i was make this job until now.
I think we can make a release after the AvisynthWrapper change and enc_aacPlus solution (actually there are a little bug, but maybe there are also other problems).
Please check the enc_aacPlus thread (http://forum.doom9.org/showthread.php?p=977901#post977901) and open the WinampAAC project with a unified code.

You are BeHappy/AvisynthWrapper coordinator now, welcome! Feel free to add new developers to this projects.
Thanks, first I must learn how CodePlex work.

Chumbo
26th January 2008, 02:59
Hey guys,
What's the best way to get this mod into the project? I think this is a useful UI "fix" for the DSP stuff. I had added it to the last test mod I did.

+ Updated the DSP Move buttons to behave according to selection and position.

I'll have to check how CodePlex works too.

tebasuna51
26th January 2008, 14:13
Hey guys,
What's the best way to get this mod into the project? I think this is a useful UI "fix" for the DSP stuff. I had added it to the last test mod I did.

+ Updated the DSP Move buttons to behave according to selection and position.

I'll have to check how CodePlex works too.

First you need register in CodePlex, after you can say me the nick (if other than Chumbo) and I can add you to the project like developer.

BTW, I don't know what do your recent update (Updated the DSP Move buttons ...) for me work fine with old version.

Chumbo
26th January 2008, 15:13
First you need register in CodePlex, after you can say me the nick (if other than Chumbo) and I can add you to the project like developer.

BTW, I don't know what do your recent update (Updated the DSP Move buttons ...) for me work fine with old version.
Okay, sounds good. Yes it worked fine, but things like when you select the first item the Move Up shouldn't be active, likewise, when you select the last item the Move Down shouldn't be active. And if you have none selected, then none of the Move buttons should be active and so on. Just a way to keep the user from getting in trouble and more intuitive. :)

[EDIT]Okay, I registered over there using Chumbo.

tebasuna51
26th January 2008, 16:17
Okay, I registered over there using Chumbo.

Now you are BeHappy project developer.
At Source Code tab visit the CodePlex Client project

Chumbo
27th January 2008, 00:56
Now you are BeHappy project developer.
At Source Code tab visit the CodePlex Client project
Okay, I've checked out everything using TortoiseSVN and made the modifications. How do you want me to check it back in? You want me to commit the changes or branch it to a new repository? Or something else? I may have a few more questions until we solidfy developer protocol. Thanks much.

[EDIT] Okay, it was easy enough to figure out. The CodePlex Client will be easy enough to use, so I won't use the SVN stuff. I checked in the update and created a hidden maintenance mod under the Releases tab with a status of Planned. It only contains my latest .exe compiled release build. You can decide on making it an official release or not. I included the changes in the Description too.

shon3i
27th January 2008, 23:17
Yes, Shon3i was make this job until now.
I think we can make a release after the AvisynthWrapper change and enc_aacPlus solution (actually there are a little bug, but maybe there are also other problems).
Please check the enc_aacPlus thread and open the WinampAAC project with a unified code.i will continue to release packages, and aslo to update enc_aacplus. Currently i am busy until next month, when i will release new package and fixed enc_aacplus like you suggest

Chumbo
28th January 2008, 01:41
tebasuna,
When you have a minute. I moved my last build to the Planned stage. If you can check it out and then decide if you want to make it a release so when shon3i is ready the new package can include it. :) Thanks much.

tebasuna51
28th January 2008, 13:27
I wait until AviSynthWrapper and enc_aacplus are modified to do a new release. Thanks.

grennis
29th January 2008, 20:46
What happened to BePipe?

tebasuna51
1st February 2008, 13:54
@Dimzon
I know you are busy, I try to do the job I can:
- There are a new AviSynthWrapper release (init_2 and strncpy_s), BeHappy work like with the old_one (only 16 bit output) then don't be used yet until the mod to call init_2 (I'm over this).

But we need you about the enc_aacplus project and, maybe, with Bepipe project:
- The last bepipe binary have little bugs and can be improved but the sources in old GotDotNet are from a pre-alpha build (.NET v1.1). Do you have the last sources?

dimzon
1st February 2008, 15:35
@Dimzon
I know you are busy, I try to do the job I can:
- There are a new AviSynthWrapper release (init_2 and strncpy_s), BeHappy work like with the old_one (only 16 bit output) then don't be used yet until the mod to call init_2 (I'm over this).
fine

But we need you about the enc_aacplus project
It's easy, I will create it @ CodePlex and make You coordinator
http://www.codeplex.com/aacPlusCLI


The last bepipe binary have little bugs and can be improved but the sources in old GotDotNet are from a pre-alpha build (.NET v1.1). Do you have the last sources?
No. Actually BePipe was very easy application, it's possible to recreate it by striping down BeHappy ;) Does anybody really need BePipe?

tebasuna51
5th February 2008, 18:10
Well, I hope all sources and binaries needed for BeHappy can be obtained from:

BeHappy - Home (http://www.codeplex.com/BeHappy)
AvisynthWrapper - Home (http://www.codeplex.com/AvisynthWrapper)
aacPlusCLI - Home (http://www.codeplex.com/aacPlusCLI)

Shon3i and Alwa, like recent collaborators, are explicitly invited to work like developers but any suggestion are welcome.

@Chumbo, your mod are included (read my message in your Planned build)

Chumbo
5th February 2008, 19:44
Well, I hope all sources and binaries needed for BeHappy can be obtained from:

BeHappy - Home (http://www.codeplex.com/BeHappy)
AvisynthWrapper - Home (http://www.codeplex.com/AvisynthWrapper)
aacPlusCLI - Home (http://www.codeplex.com/aacPlusCLI)

Shon3i and Alwa, like recent collaborators, are explicitly invited to work like developers but any suggestion are welcome.

@Chumbo, your mod are included (read my message in your Planned build)
Yep, no problem.

alwa
6th February 2008, 17:46
Add me, name is alwa. Thanks. :)

shon3i
6th February 2008, 20:10
Add me, name is alwa. Thanks. :)
Me to, as shon3i :)

@tebasuna51, did you compile last enc_aacplus?

tebasuna51
6th February 2008, 20:49
Add me, name is alwa. Thanks. :)

Done

@shon3i, first you must register your name in CodePlex.

And yes, I make a compile from the actual source (many warnings about deprecated functions but seems work). There are any problem?
I'm not a expert C programmer and I need your help.

NorthPole
8th February 2008, 00:12
No. Actually BePipe was very easy application, it's possible to recreate it by striping down BeHappy ;) Does anybody really need BePipe?

Actually, I still use Bepipe...(Probably the only one). Although I did made a couple of minor, local mods to the code which I can't seem to remember right now. Works good for my needs.

Dimzon, Glad to have your back!

NorthPole
8th February 2008, 00:19
The last bepipe binary have little bugs and can be improved but the sources in old GotDotNet are from a pre-alpha build (.NET v1.1). Do you have the last sources?

@tebasuna51

I have the original code from November 2005 if you are interested. (Probably the same as your).

tebasuna51
8th February 2008, 03:21
I have the original code from November 2005 if you are interested. (Probably the same as your).

Yes from 2005-11-25, but I think is not the last.

Bepipe is useful for command line usage and I see some GUI's than use Bepipe also. BTW we can use also Wavi and SoundOut for avs script's.

NorthPole
15th February 2008, 20:43
Has anyone had success using the TTA encoder with BeHappy/Bepipe. http://tta.sourceforge.net/

I can't seem to get the pipe to work. I can get it to encode correctly using the command line with a wav file but not with the pipe.

Thanks.

NorthPole
15th February 2008, 22:26
Update:

Found a working patched version here http://etree.org/shnutils/shntool/

Seems to work OK with BeHappy.

tebasuna51
16th February 2008, 01:02
Found a working patched version here http://etree.org/shnutils/shntool/

Seems to work OK with BeHappy.

Yep, with this version and a ttaenc.extension file like:
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioEncoder Name="TTAenc 3.4.1" UniqueID="e482a270-dc16-11dc-95ff-0800200c9a66">
<ExecutableFileName>ttaenc.exe</ExecutableFileName>
<Script>32==Audiobits(last)?ConvertAudioTo24bit(last):last</Script>
<ExecutableArguments>-e -o "{0}" -</ExecutableArguments>
<SupportedFileExtension>tta</SupportedFileExtension>
</AudioEncoder>
</BeHappy.Extension>

we can support output lossless tta files.

NorthPole
16th February 2008, 22:07
@tebasuna51,

Thanks for the extension... saved me the work!

tebasuna51
16th April 2008, 02:16
New BeHappy 0.1.9.50201 (http://www.codeplex.com/BeHappy) release, include:

- NicAudio v2.0.1 (http://www.codeplex.com/NicAudio)
- BassAudio for Bass 2.4 libraries. Now seems work with multichannel aac and others formats.
- enc_aacPlus (http://www.codeplex.com/aacPlusCLI)
- TTA support and other minor changes.

Geleodor
16th April 2008, 09:33
BassAudio seems to make incorrect channel mapping, when I decode .ac3 to mono .wavs. I have just got FL, but it is central channel; BR, but it is LFE....and so on
NicAudio make it correctly...

tebasuna51
16th April 2008, 10:50
BassAudio seems to make incorrect channel mapping, when I decode .ac3 to mono .wavs. I have just got FL, but it is central channel; BR, but it is LFE....and so on
NicAudio make it correctly...

You are right, like you can read in the plugins/readme.txt I don't recommend bass_ac3 for ac3 decode because there are problems with channelmapping for some acmod-lfeon options.

Always use NicAudio v2 (with this acmod-lfeon options revised) for ac3, dts, mpeg, lpcm and other uncompresed formats.

For aac, ogg, wma, flac, and others you can use BassAudio.

mob
17th April 2008, 01:07
Hey guys,

I got BeHappy from http://www.codeplex.com/BeHappy/ and it is very good!

So I have a question about how it is adding a switch to the command line of LAME.

When I set it up to do VBR 5 it give this command:

lame.exe -v -V 5 --nohist --vbr-new -S --silent - "C:\test.mp3"

So why is it -v -V 5? Instead it should be only -V 5 right?

And also, another question. In the LAME encoder configuration, what is that setting: comply as much as possible to ISO MPEG spec?

Thanks! :)

tebasuna51
17th April 2008, 03:15
Hey guys,

I got BeHappy from http://www.codeplex.com/BeHappy/ and it is very good!

So I have a question about how it is adding a switch to the command line of LAME.

When I set it up to do VBR 5 it give this command:

lame.exe -v -V 5 --nohist --vbr-new -S --silent - "C:\test.mp3"

So why is it -v -V 5? Instead it should be only -V 5 right?

And also, another question. In the LAME encoder configuration, what is that setting: comply as much as possible to ISO MPEG spec?

Thanks! :)
Yes, maybe we need some update :

-v -V 5 --vbr-new

actually is enough use only -V 5 because the default is --vbr-new and -v is superfluous.

'comply as much as possible to ISO MPEG spec'

do nothing because the corresponding parameter:
--strictly-enforce-ISO
is not included, BTW I don't know if anybody need this.

mob
17th April 2008, 05:04
Yes, maybe we need some update :

-v -V 5 --vbr-new

actually is enough use only -V 5 because the default is --vbr-new and -v is superfluous.

'comply as much as possible to ISO MPEG spec'

do nothing because the corresponding parameter:
--strictly-enforce-ISO
is not included, BTW I don't know if anybody need this.

Yeah I knew something had to be wrong because I always check the hydrogenaudio for the best settings for LAME: http://wiki.hydrogenaudio.org/index.php?title=LAME#Recommended_encoder_settings

and they never use that -v switch. Only -V as in -V 4 --vbr-new

Well, perhaps you can add a feature so we can use our own commandline switches. Sometimes I like to just use my own commandline switches without using the dialog with all the options. It gives more control if you let the user make his own commandline options. Can this be added maybe?

Geleodor
17th April 2008, 10:06
What settings should I use to encode multichannel AAC from multichannel.wav? Or multichannel AAC can be just as input, not output ?

tebasuna51
17th April 2008, 12:08
and they never use that -v switch. Only -V as in -V 4 --vbr-new
Don't worry about this. Using more parameters we guarantee compatibility with old and beta versions because the defaults can change. See that:
VBR options: 3.97
-v use variable bitrate (VBR) (--vbr-old)
--vbr-old use old variable bitrate (VBR) routine
--vbr-new use new variable bitrate (VBR) routine
-V n quality setting for VBR. default n=4
0=high quality,bigger files. 9=smaller files

VBR options: 3.98 beta 7
-V n quality setting for VBR. default n=4
0=high quality,bigger files. 9=smaller files
-v the same as -V 4
--vbr-old use old variable bitrate (VBR) routine
--vbr-new use new variable bitrate (VBR) routine (default)
The syntax:
-v -V 5 --vbr-new
work fine with 3.96, 3.97 and 3.98 beta Lame versions.

Well, perhaps you can add a feature so we can use our own commandline switches. Sometimes I like to just use my own commandline switches without using the dialog with all the options. It gives more control if you let the user make his own commandline options. Can this be added maybe?
What is your BeHappy version?
Only the bitrate, with the allowed values, are forced in the dialog.
There are a window to add your commandline switches, I always add at least -h.

tebasuna51
17th April 2008, 12:41
...multichannel AAC can be just as input, not output ?
Maybe a input if you select BassAudioSource (BassAudio.dll, Bass.dll and bass_aac.dll required in ...AviSynth 2.5\plugins folder) or DirectShowSource with some DS filter to decode aac well configured.

And can be a output if you have the encoders. BeHappy can work with:
- Nero Digitall AAC (NeroAacEnc.exe in BeHappy folder or encoder subfolder)
- Coding Technologies aacPlus (enc_aacPlus.exe, enc_aacplus.dll and nscrt.dll in BeHappy folder or encoder subfolder)

What settings should I use to encode multichannel AAC from multichannel.wav?

1) With NeroAacEnc I recommend you use:
- VariableBitRate with quality between 2.5 and 4 (is your choice)
- Aac Profile: Automatic
- The rest unchecked
The output is always in m4a/mp4 container.

2) With CT only CBR is allowed and for multichannel:
- Profile LC-AAC with bitrates between 224-320 Kb/s
- Or Profile HE-AAC for bitrates between 192-223 Kb/s
- Ignore the Channel Mode valid only for stereo.
- The rest unchecked
The output is .aac if you need m4a/mp4 container you need also Mp4Box.exe in BeHappy folder or encoder subfolder.

mob
17th April 2008, 21:38
Hey tebasuna51, try to test it out like I did and see how it happens:

I used any MP3 file for testing. I input the MP3 file to BeHappy and I want to transcode it with -V 2 --vbr-new so I set it up like this with the dialog:

http://img378.imageshack.us/img378/5493/95187853mk0.th.jpg (http://img378.imageshack.us/my.php?image=95187853mk0.jpg)

But then it sends the MP3 to LAME with this command instead: -v -V 2 --nohist --vbr-new -S --silent

Now, you said this going to be working fine for all the versions of LAME, but I find that this is not true.

I am using LAME 3.97 from: http://rarewares.org/dancer/dancer.php?f=lame-current

And when I pass my test MP3 file to the LAME commandline encoder (without using BeHappy) then I get a totally different file. So BeHappy is adding unwanted command options and it's causing the encode to be different. Take a look at my findings:

_____________________________________

test.mp3 -> BeHappy -> output.mp3 with these settings:

http://img378.imageshack.us/img378/5493/95187853mk0.th.jpg (http://img378.imageshack.us/my.php?image=95187853mk0.jpg)

Gives me: output.mp3 (5.94 MB) CRC: d4502ba8

_____________________________________


But if I only use LAME encoder in the commandline:

test.mp3 -> LAME.exe -> output.mp3 with these settings:

-V 2 --vbr-new

Gives me: output.mp3 (6.21 MB) CRC: d4238540

_____________________________________


So you can see, using BeHappy is not accurate because you are adding switches that are confusing it.

That is why I need an advanced option so I can disable all the things that BeHappy is adding to the commandline and then I'll use my own commandline switches.

btw, I'm using the same version/build of LAME for BeHappy in my test. So the output should come out as the same file. But it is different as you can see. Try to do the test also and see how it happens. This is why you should allow the people to make their own switches. If you add switches to their commands then it will mess up the output :(

tebasuna51
18th April 2008, 00:20
Believe me! :)
The parameters are ok.

Your test is not correct, you can't compare this:

1.mp3 -> Lame Decoder -> Lame Encoder -> 11.mp3

with:

1.mp3 -> NicMPG123/BassAudio decoder (32 float) -> 32 int conversion -> Lame Encoder -> 12.mp3

When BeHappy decode a file use the max precision (32 bits float here) to allow operations like stretch, resample, ... without lose quality.

Unfortunately Lame don't accept 32 bits float and we need convert to 32 int before send the data to Lame.

Like you see the process is different. But you can do the test using a uncompressed wav file. I get a wav file (ripped from CD) and I make the test (with -V 2):

1.wav -> Lame.exe -> 11.mp3 4.196.754 bytes
1.wav -> BeHappy -> 12.mp3 4.196.754 bytes

And bitidentical (Total Commander) of course.
Make the test yourself. :rolleyes:

mob
18th April 2008, 00:58
LOL tebasuna51 :)

So maybe I don't know much about all of this stuff. But if you say it is good then I believe you because you know a lot more about this kind of stuff then me :)

Anyway, see my whole problem is that I am going to convert a PAL mp3 to a NTSC mp3 and I found BeHappy to be the best one to do the job.

I need to do this PAL -> NTSC conversion because the PAL audio is messed up with a high pitch sound. I need to get it back to 23.976 and get it back to the original sound.

So I do a timestretch with BeHappy and I select the option Rate for the Rate Control:

http://img443.imageshack.us/img443/8636/sdf1ie2.th.jpg (http://img443.imageshack.us/my.php?image=sdf1ie2.jpg)

This gives me the exact kind of conversion that I need. And BeHappy really makes me Happy :)

Except now I found this is what they say about Timestretch on the AviSynth website:

Timestretch() by the nature of the algorithm used causes noticeable distortion in the result, generally use it for speech only, never for high quality music.

So is it true? Is it really causing "noticeable distortion" and bad artifacts? Maybe there is a method of doing the conversion that will not cause noticeable distortion?

tebasuna51
18th April 2008, 02:19
Anyway, see my whole problem is that I am going to convert a PAL mp3 to a NTSC mp3 and I found BeHappy to be the best one to do the job.

I need to do this PAL -> NTSC conversion because the PAL audio is messed up with a high pitch sound. I need to get it back to 23.976 and get it back to the original sound.

So I do a timestretch with BeHappy and I select the option Rate for the Rate Control

Please don't use with audio:
"convert a PAL mp3 to a NTSC mp3"
because the audio is the same in PAL or NTSC systems.

The correct way to do a PAL -> NTSC conversion is modify the video and let untouched the audio.

Seems you have a 25 fps video and want play this video at 23.976, without conversion the duration is greater and you need enlarge also the audio to match the new video duration. Like the initial audio have high pitch (maybe by the inverse conversion) the desired method is Rate.

Then you are lucky because this method don't produce "noticeable distortion or bad artifacts". Is a simple change of samplerate.

Only when we need change the duration preserving the pitch (or change the pitch without change the duration) the conversion can't be perfect.

mob
18th April 2008, 02:35
Seems you have a 25 fps video and want play this video at 23.976
Yep that's exactly what I have to do. I already got the video from 25fps -> 23.976. My only trouble now is to get the audio to match it.

And the only reason I need to do it is because when they made the PAL version of my DVD, they speed up the audio and it sounds too high pitch. If I slow it back down to the normal 23.976fps then it will sound normal again. They make the PAL DVDs so bad like this :(

Like the initial audio have high pitch (maybe by the inverse conversion) the desired method is Rate.

Then you are lucky because this method don't produce "noticeable distortion or bad artifacts". Is a simple change of samplerate.

Yep! I used the Rate method like you see in this screenshot:

http://img443.imageshack.us/img443/8636/sdf1ie2.th.jpg (http://img443.imageshack.us/my.php?image=sdf1ie2.jpg)

So you mean, with this method I can be safe because it doesn't have the distortion problem?

If yes, than that's good. And it fixes all my problems :)

tebasuna51
18th April 2008, 03:20
So you mean, with this method I can be safe because it doesn't have the distortion problem?

Yep, the process is change the samplerate from 48000 Hz to 50050 Hz then there are more samples, and after play the audio at 48000 Hz then the duration grow and the pitch decrease.

mob
18th April 2008, 06:21
Yep, the process is change the samplerate from 48000 Hz to 50050 Hz then there are more samples, and after play the audio at 48000 Hz then the duration grow and the pitch decrease.

WOW :)

This is perfect!

BeHappy really makes me Happy hehe

...but tebasuna51 makes me smart. :)

Thanks for helping me and explaining everything to me. I really appreciate it man :)

:thanks:

adrianmak
29th April 2008, 13:52
the gui looks complex.

How do I use it to convert a 5.1 ac3 to 6 individual wave file ?

tebasuna51
29th April 2008, 19:32
How do I use it to convert a 5.1 ac3 to 6 individual wave file ?
System requirements
* Microsoft .NET Framework Version 2.0
* Avisynth v2.57

Install
1) From the BeHappy package uncompress the following files/subfolders in a folder at your choice:
AvisynthWrapper.dll
BeHappy.exe
encoder
extensions
plugins

2) Copy nicaudio.dll from plugins subfolder to your AviSynth 2.5/plugins subfolder.

Process
Run BeHappy.exe and in New Job Tab:

1) Select the [1] Source method NicAc3Source and [...] Configure. I suggest you don't use DRC.
Select [...] your source ac3 file.

2) Select the desired [2] Tweak functions.
Maybe you need include a Delay detected in your source.

3) Select the desired [3] Digital Signal Processing functions. Each function can be Configured and Moved Up/Down because are executed in descending order.
The NicAudio decoder output have 32 bit float samples. Maybe you want Convert Sample To 16 bit (or 24 int ...)

4) Select the [4] Destination format WavSplit and [...] Configure like Mono Wav's.
Select [...] your desired output filename. This filename is used like prefix and each channel is suffixed with _FL, _FR, ... and so on.

5) Enqueue. Go to Queue Tab and Start the job.

cweb
30th April 2008, 11:19
When I quite BeHappy v0.19.50201 I get an error "Unhandled exception has occurred in your application. If you click Continue the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Item has already been added. Key in dictionary:
'58ab9132-50c8-11dc-8314-0800200c9a66' Key being added:
'58ab9132-50c8-11dc-8314-0800200c9a66'
"

Any ideas on what could be wrong?

tebasuna51
30th April 2008, 13:29
Item has already been added. Key in dictionary:
'58ab9132-50c8-11dc-8314-0800200c9a66' Key being added:
'58ab9132-50c8-11dc-8314-0800200c9a66'
"

Any ideas on what could be wrong?
Seems the NicAudio ID (see Nicaudio.extension) is duplicated in your machine:
<AudioSource UniqueID="58ab9132-50c8-11dc-8314-0800200c9a66">


If you don't know what is the problem try edit Nicaudio.extension and change the line by other one, for instance:
<AudioSource UniqueID="58ab9132-50c8-11dc-8314-0800200c9b66">

tebasuna51
30th April 2008, 18:08
@cweb

Maybe you have the old RaWav.extension in BeHappy folder.
Now is inside NicAudio.extension (same ID), and you need delete RaWav.extension and also RaWav.dll in AviSynth 2.5\plugins folder if exist.

EpheMeroN
5th May 2008, 05:52
BeHappy v0.1.9.50201 is reporting the following error when trying to do AC3 > mp3 transcode:

Starting job VTS_01_1 T80 3_2ch 384Kbps DELAY 0ms.ac3->dvd-xvid-audio.mp3
Error: BeHappy.AviSynthException: Script error: there is no function named "NicAc3Source"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

I have the latest NicAudio.dll in both BeHappy\Plugins dir and AviSynth\Plugins dir. What could be causing this?

cweb
5th May 2008, 08:52
@cweb

Maybe you have the old RaWav.extension in BeHappy folder.
Now is inside NicAudio.extension (same ID), and you need delete RaWav.extension and also RaWav.dll in AviSynth 2.5\plugins folder if exist.
For the time being I have downgraded to the previous version.

But thanks, I will reinstall the latest version and try that.

tebasuna51
5th May 2008, 09:41
BeHappy v0.1.9.59201 is reporting the following error when trying to do AC3 > mp3 transcode:
Maybe BeHappy v0.1.9.50201?

I have the latest NicAudio.dll in both BeHappy\Plugins dir and AviSynth\Plugins dir. What could be causing this?

Check your registry. A correct AviSynth install make the keys (translate to your language):
[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
@="C:\\Archivos de programa\\AviSynth 2.5"
"plugindir2_5"="C:\\Archivos de programa\\AviSynth 2.5\\plugins"

NicAudio.dll must be at "plugindir2_5" folder

EpheMeroN
5th May 2008, 10:00
@tebasuna51: You were correct about the version number. I corrected it on my previous post!

Does BeHappy look for the NicAudio.dll in just the default install location? Because I have all my a/v apps installed to "C:\Multimedia" so AviSynth is in "C:\Multimedia\AviSynth 2.5\Plugins". Every other program I have that uses AviSynth functions fine.

tebasuna51
5th May 2008, 13:16
Does BeHappy look for the NicAudio.dll in just the default install location? Because I have all my a/v apps installed to "C:\Multimedia" so AviSynth is in "C:\Multimedia\AviSynth 2.5\Plugins". Every other program I have that uses AviSynth functions fine.

Well, BeHappy call AviSynth, and AviSynth load the plugins in the folder indicated by the "plugindir2_5" registry value.

If, in your machine, is "C:\Multimedia\AviSynth 2.5\Plugins", then NicAudio.dll, BassAudio.dll, bass_*.dll, sox.dll ... must be there.

EpheMeroN
5th May 2008, 20:26
@tebasuna51: All the files are in the plugins directory so I have no clue why BeHappy is giving me that error.

Anyone have ideas?

tebasuna51
5th May 2008, 22:17
@EpheMeroN
To discard others problems try this:

1) Instead 'Enqueue' you job, use 'Export AviSynth Script'

2) Edit the .avs created with Notepad and insert like first line:
LoadPlugin("C:\Multimedia\AviSynth 2.5\Plugins\NicAudio.dll")
Save the file.

3) Open the .avs file with BeHappy instead your source. You don't need add DSP functions, only encode with Lame.

EpheMeroN
5th May 2008, 23:19
@EpheMeroN
To discard others problems try this:

1) Instead 'Enqueue' you job, use 'Export AviSynth Script'

2) Edit the .avs created with Notepad and insert like first line:
LoadPlugin("C:\Multimedia\AviSynth 2.5\Plugins\NicAudio.dll")
Save the file.

3) Open the .avs file with BeHappy instead your source. You don't need add DSP functions, only encode with Lame.
Starting job audio-tst.avs->audio-tst.mp3
Found Audio Stream
Channels=6, BitsPerSample=32 int, SampleRate=48000Hz
encoder\lame.exe --abr 128 --nohist -h -S --silent - "C:\Users\xxxxxxx\Desktop\audio-tst.mp3"
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()

tebasuna51
6th May 2008, 01:03
Ok. One problem solved.
The actual problem is evident.
You try encode 'Channels=6' with Lame.
Lame only support mono/stereo.
You need select a downmix DSP function, I recommend you use DPL II

EpheMeroN
6th May 2008, 03:39
Ok. One problem solved.
The actual problem is evident.
You try encode 'Channels=6' with Lame.
Lame only support mono/stereo.
You need select a downmix DSP function, I recommend you use DPL II
Okay. Doing that worked just fine!
Starting job test.avs->test.mp3
Found Audio Stream
Channels=2, BitsPerSample=32 int, SampleRate=48000Hz
encoder\lame.exe --abr 128 --nohist -h -S --silent - "C:\Users\xxxxxxx\Desktop\test.mp3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder

So based on what we've figured out, BeHappy looks (by default) for the NicAudio.dll in the "C:\Program Files\AviSynth 2.5\Plugins" directory regardless of where you really have AviSynth installed. Could this be manually corrected in that NicAudio.extension file? Or what could be done?

Btw, for the purpose of diagnosing this issue, I have been using the latest BeHappy (stated in previous post), and using Windows Vista Home Premium as my operating system.

tebasuna51
6th May 2008, 10:08
So based on what we've figured out, BeHappy looks (by default) for the NicAudio.dll in the "C:\Program Files\AviSynth 2.5\Plugins" directory regardless of where you really have AviSynth installed.
BeHappy don't load AviSynth plugins at all.
I think is a AviSynth issue.
Could this be manually corrected in that NicAudio.extension file? Or what could be done?
Yep, you can patch NicAudio.extension changing each line:
<Value></Value>
For instance:
<Value>NicAc3Source("{0}")</Value>
must be
<Value>LoadPlugin("C:\Multimedia\AviSynth 2.5\Plugins\NicAudio.dll")
NicAc3Source("{0}")</Value>

Btw, for the purpose of diagnosing this issue, I have been using the latest BeHappy (stated in previous post), and using Windows Vista Home Premium as my operating system.
And can you confirm your registry is correct?
Must be like this:
[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
@="C:\\Multimedia\\AviSynth 2.5"
"plugindir2_5"="C:\\Multimedia\\AviSynth 2.5\\plugins"

EpheMeroN
6th May 2008, 18:42
And can you confirm your registry is correct?
Must be like this:
[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
@="C:\\Multimedia\\AviSynth 2.5"
"plugindir2_5"="C:\\Multimedia\\AviSynth 2.5\\plugins"
Confirmed!
http://img225.imageshack.us/img225/714/90001324wu4.jpg

tebasuna51
6th May 2008, 23:38
Confirmed!

Thanks. Then I don't know what is the problem.

EpheMeroN
7th May 2008, 00:45
I don't either! Maybe the author of BeHappy can take a look.

EpheMeroN
7th May 2008, 07:56
1) More options for DRC from NicAudio.dll please? So instead of just DRC you can choose Light, Normal, Heavy DRC in the option box.

I assume the default DRC option uses Normal DRC correct?

2) My previous issue (last 2 pages within this thread) with not being able to load NicAudio.dll without first having to save as .avs and then manually type in plugin location.

tebasuna51
7th May 2008, 12:58
1) More options for DRC from NicAudio.dll please? So instead of just DRC you can choose Light, Normal, Heavy DRC in the option box.

I assume the default DRC option uses Normal DRC correct?
Inside the ac3 stream can have a unique attenuation value for each block (256 samples) of audio data. Some decoders offer the option of modify this internal value by half or double (Azid, PowerDVD, ...). Other decoders can ignore the internal DRC value (Ac3Filter) and offer drc methods with continuous adjust.

The liba52 decoder offer the option to write external routines to manage DRC but the spirit of the AviSynth decoders I think must be:
- The decoder just decode the internal format to uncompressed audio data with the minimum process.
- Any data transformation must be done out of decoders to be generic. For instance liba52 have downmix functions, but I think this process must be done with more flexible AviSynth functions and independent of source format.

Then the object of DRC option in ac3 (and dts) decoder is recover the unique value present in ac3 stream recommended by the source author.

If you want some other distinct adjust you can write your filters using the compand function of sox filter. You have some samples in this post (http://forum.doom9.org/showthread.php?p=779165#post779165)

2) My previous issue (last 2 pages within this thread) with not being able to load NicAudio.dll without first having to save as .avs and then manually type in plugin location.

To know more about this problem, I suggest another test with bepipe:

- In last BeHappy_r50201.7z release there are a encoder\Bepipe.7z, please decompress the file and you have a bepipe folder with:
Bepipe.bat
Bepipe.exe
WavFix.exe
Edit with Notepad the Bepipe.bat:
@echo off
rem Sample of use to write correct wav header with Bepipe (if < 4GB). Not neded with encoders.
Bepipe --script "BassAudioSource(^D:\Musica\Ejemplos\High.wma^)" | Wavfix - output.wav
pause
and replace "BassAudioSource" with "NicAc3Source", and the example wma file with an ac3 in your system (let the necessary ^)

Run (Double Click) Bepipe.bat and let me know the result.

Chumbo
7th May 2008, 15:05
I don't either! Maybe the author of BeHappy can take a look.
Like tebasuna said, it's not a BeHappy issue. What you may consider doing is getting the latest install package from Shon3i on the 2nd post here (http://forum.doom9.org/showthread.php?p=758076#post758076) and then update the latest BeHappy and plug-ins after that. The install package has everything including avisynth. I'd remove your existing avisynth and BeHappy installations first and then install the Shon3i package.

EpheMeroN
8th May 2008, 18:14
Like tebasuna said, it's not a BeHappy issue. What you may consider doing is getting the latest install package from Shon3i on the 2nd post here (http://forum.doom9.org/showthread.php?p=758076#post758076) and then update the latest BeHappy and plug-ins after that. The install package has everything including avisynth. I'd remove your existing avisynth and BeHappy installations first and then install the Shon3i package.
Is there something different in the older Shon3i package than w/ the official latest BeHappy that might make a difference?

tebasuna51
9th May 2008, 00:01
Is there something different in the older Shon3i package than w/ the official latest BeHappy that might make a difference?

Is a installer (also AviSynth) to be sure. Of course with a official installation all must work, like in many others PC's, but here the interest is know for what don't work with your custom install.

You say:
"Every other program I have that uses AviSynth functions fine."
Please, what others programs?
You need load plugins?
And the Bepipe test I suggest?

masscamp24
9th May 2008, 19:21
Can Behappy transcode 2 stereo wav to a 5.1 ac3 stereo

tebasuna51
9th May 2008, 19:52
Can Behappy transcode 2 stereo wav to a 5.1 ac3 stereo

Please clarify your question.
'2 stereo wav' can be 2 wav files with 2 channel each, but what is '5.1 ac3 stereo'?

masscamp24
9th May 2008, 20:45
Please clarify your question.
'2 stereo wav' can be 2 wav files with 2 channel each, but what is '5.1 ac3 stereo'

I mean wav 2 channel to ac3 5.1 channel

tebasuna51
10th May 2008, 00:01
I mean wav 2 channel to ac3 5.1 channel

Of course, there are 6 profiles to choose in 5.1 Upmix DSP function.

jangai
11th May 2008, 19:17
With BeHappy to convert an AAC 6 ch file to AC3 5.1 with following script :
########################################
#Created by BeHappy v0.1.9.50201
#Creation timestamp: 11/05/2008 18:30:53
########################################
#Source FileName:C:\Documents and Settings\Jangai\Mes documents\Mes videos\Audio.aac
#Target FileName:C:\Documents and Settings\Jangai\Mes documents\Mes videos\Audio.ac3
########################################

########################################
# [Source: AviSynth]
########################################
Import("C:\Documents and Settings\Jangai\Mes documents\Mes videos\Audio.aac")

########################################
# [BeHappy: Delay Audio by -10 ms ]
DelayAudio( -10.0/1000.0)

########################################
# [Encoder: Aften AC3 CBR @ 448 kbps, L+R, ReadToEof, DRC: None]
########################################

I get following error at the beginning of process :

Starting job Audio.aac->Audio.ac3
Error: BeHappy.AviSynthException: unexpected character "˙"
ŕ BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
ŕ BeHappy.Encoder.encode()

Same error with ffmpeg AC3 encoder...

Anybody has a small idea to steer my searches ?
Thanks in advance :thanks:

tebasuna51
11th May 2008, 22:55
With BeHappy to convert an AAC 6 ch file to AC3 5.1 with following script :
...
# [Source: AviSynth]
########################################
Import("C:\Documents and Settings\Jangai\Mes documents\Mes videos\Audio.aac")
...


You must select the appropriate method (decoder) to open your source file.
The AviSynth method Import() is for .avs files
To decode aac you need BassAudio() method.

When you select an .aac like input file the BassAudio method is automatically selected.

jangai
12th May 2008, 09:24
You must select the appropriate method (decoder) to open your source file.
The AviSynth method Import() is for .avs files
To decode aac you need BassAudio() method.

When you select an .aac like input file the BassAudio method is automatically selected.
OK ! I was far of the right way...
Unfortunately, BassAudio method seems hard to activate for me :

Command panel with (good ?) input method :
http://i41.servimg.com/u/f41/11/71/09/36/behapp11.jpg (http://www.servimg.com/image_preview.php?i=59&u=11710936)

Preview:
http://i41.servimg.com/u/f41/11/71/09/36/behapp13.jpg (http://www.servimg.com/image_preview.php?i=61&u=11710936)

Log :
http://i41.servimg.com/u/f41/11/71/09/36/behapp12.jpg (http://www.servimg.com/image_preview.php?i=60&u=11710936)

Checked my BassAudio installation into AviSynth/plugin folder...
All seems right... But... is not ! :-)
A missing DLL somewhere ?

tebasuna51
12th May 2008, 09:54
OK ! I was far of the right way...
Unfortunately, BassAudio method seems hard to activate for me :

...
Checked my BassAudio installation into AviSynth/plugin folder...
All seems right... But... is not ! :-)
A missing DLL somewhere ?

1) Check your registry. A correct AviSynth install make the keys (translate to your language):
[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
@="C:\\Archivos de programa\\AviSynth 2.5"
"plugindir2_5"="C:\\Archivos de programa\\AviSynth 2.5\\plugins"

2) Check the needed .dll at "plugindir2_5" folder:
BassAudio.dll
Bass.dll
Bass_aac.dll

3) If don't work, you can patch (Notepad) BassAudio.extension replacing the black part with your "plugindir2_5" folder:
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioSource Name="BassAudio" UniqueID="368e0760-ae08-11da-a746-0800200c9a66">
<Script>LoadPlugin("C:\Archivos de programa\AviSynth 2.5\Plugins\BassAudio.dll")
bassAudioSource("{0}")</Script>
<SupportedFileExtension>aac</SupportedFileExtension>
<SupportedFileExtension>aiff</SupportedFileExtension>
<SupportedFileExtension>ape</SupportedFileExtension>
<SupportedFileExtension>cda</SupportedFileExtension>
<SupportedFileExtension>flac</SupportedFileExtension>
<SupportedFileExtension>m4a</SupportedFileExtension>
<SupportedFileExtension>mp1</SupportedFileExtension>
<SupportedFileExtension>mp2</SupportedFileExtension>
<SupportedFileExtension>mp3</SupportedFileExtension>
<SupportedFileExtension>mp4</SupportedFileExtension>
<SupportedFileExtension>mpc</SupportedFileExtension>
<SupportedFileExtension>ogg</SupportedFileExtension>
<SupportedFileExtension>tta</SupportedFileExtension>
<SupportedFileExtension>wav</SupportedFileExtension>
<SupportedFileExtension>wma</SupportedFileExtension>
<SupportedFileExtension>wv</SupportedFileExtension>
</AudioSource>
</BeHappy.Extension>

jangai
12th May 2008, 14:12
Many thanks... I had to follow the 1-2-3 parts of your advices.

-Create a "plugindir2_5" folder and fill it with right dll collection :
http://i41.servimg.com/u/f41/11/71/09/36/behapp14.jpg (http://www.servimg.com/image_preview.php?i=62&u=11710936)

-Check registry to see plugindir2_5 folder access key was right (it was) :http://i41.servimg.com/u/f41/11/71/09/36/behapp15.jpg (http://www.servimg.com/image_preview.php?i=63&u=11710936)

-Patch the xml Behappy BassAudio.extension file with correct order and path :http://i41.servimg.com/u/f41/11/71/09/36/behapp16.jpg (http://www.servimg.com/image_preview.php?i=64&u=11710936)

And : it would have been working... No ! Arrgggggghhhhhhh! I check and check again my syntaxes... The DLL doesn't load ...
http://i41.servimg.com/u/f41/11/71/09/36/behapp17.jpg (http://www.servimg.com/image_preview.php?i=65&u=11710936)

Is it a bad DLL release or a so big mistake that I can see it ???

tebasuna51
12th May 2008, 20:11
Must be
C:\Program Files\AviSynth 2.5\plugins

BassAudio.dll 69.632 14/03/2008 09:08
bass.dll 97.336 08/04/2008 15:07
bass_aac.dll 150.904 27/02/2008 17:10
bass_ac3.dll 16.736 27/02/2008 17:10
bass_alac.dll 12.144 27/02/2008 20:03
bass_ape.dll 33.112 27/02/2008 17:10
bass_cda.dll 16.952 02/04/2008 12:28
bass_flac.dll 25.152 02/04/2008 12:26
bass_midi.dll 25.152 24/03/2008 15:07
bass_mpc.dll 16.200 27/02/2008 21:46
bass_ofr.dll 5.960 27/02/2008 17:11
bass_spx.dll 47.936 27/02/2008 18:25
bass_tta.dll 8.536 27/02/2008 21:49
bass_wma.dll 15.416 02/04/2008 12:32
bass_wv.dll 27.704 02/04/2008 12:36
The 'plugindir2_5' is the name in regedit.
And check the dates, seems you have v2.3 bass files.

jangai
12th May 2008, 22:54
And check the dates, seems you have v2.3 bass files.

OK I understand my mistakes, but I have also a release problem...
For Bass files, I have only BassAudio.dll from 2008 and bass.dll, bass_aac.dll, bass_xxx.dll are all from 2007...

Now, I think file linkage is good, but I have serious releases mismatch into all BassAudio DLLs from my AviSynth plugins folder...

My sources for these files (BeHappy, BassAudio and updates) are :
-BeHappy_20070324.exe for main package and
-BassAudio23.7z

My question is : Are theses references OK and if not, what are the good ones and where to find the good ones ?

Thank you for your patience, but the actual "packaging" of BeHappy with BassAudio extensions is not a very intuitive cruise... ;-)

tebasuna51
12th May 2008, 23:00
Thank you for your patience, but the actual "packaging" of BeHappy with BassAudio extensions is not a very intuitive cruise... ;-)
In ...\plugins\readme.txt:

(1) The oficial releases v2.4 are in http://www.un4seen.com/bass.html

EpheMeroN
16th May 2008, 11:15
Hey guys! Sorry I didn't run the BeHappy tests for my current issues. I had to leave for a week on short notice.

I'll run the tests come Saturday morning. Thanks for the help!

cweb
18th May 2008, 15:05
@cweb

Maybe you have the old RaWav.extension in BeHappy folder.
Now is inside NicAudio.extension (same ID), and you need delete RaWav.extension and also RaWav.dll in AviSynth 2.5\plugins folder if exist.

I just reinstalled the new version. I followed your tip to delete the old RaWav extension and dll in behappy's plugins directory. All seems to be working fine.

Something I noticed also, I might be doing something wrong, I have a demuxed ac3, trying to convert it to an ogg vorbis file, and I choose to DownMix it, well the end result contains a lot of hissing. Not sure what's the problem, but I'm using the latest oggenc2 from rarewares (P3/amd build) - oggenc2.85-aoTuVb5.5-P3.zip

tebasuna51
18th May 2008, 17:13
Something I noticed also, I might be doing something wrong, I have a demuxed ac3, trying to convert it to an ogg vorbis file, and I choose to DownMix it, well the end result contains a lot of hissing. Not sure what's the problem, but I'm using the latest oggenc2 from rarewares (P3/amd build) - oggenc2.85-aoTuVb5.5-P3.zip

Sorry, my fault.

I forget use the parameter
--raw-format=3
when send float samples in last BeHappy revision, must be corrected in the next revision.

To work until next revision you can use, like last DSP, a Convert Sample To 32 bit int.

Adub
18th May 2008, 21:43
Oh, good. I was just about to post about the ogg problem, and look! Here it is. Good to know that it wasn't something I was doing. Can't wait for the next version!! This is THE audio conversion software now, so keep going tebasuna51!! Your work is very appreciated.

cweb
19th May 2008, 06:39
Sorry, my fault.

I forget use the parameter
--raw-format=3
when send float samples in last BeHappy revision, must be corrected in the next revision.

To work until next revision you can use, like last DSP, a Convert Sample To 32 bit int.
thanks! I too wanted to say you are doing a great job!

tebasuna51
21st May 2008, 20:13
New BeHappy release BeHappy 0.1.9.50202 (https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=BeHappy&ReleaseId=13626)

+ Solved bug when sending float samples to oggenc2 encoder.

+ Added new experimental features related with headers for multichannel audio data:

-ChannelMask: CMask in [2] Tweak. When checked the header is WAVE_FORMAT_EXTENSIBLE.
Selecting 0 the default for the current NumChannels is applied.

-HeaderType: Head. in [2] Tweak. 0 for WAV, 1 for W64, 2 for RF64, 3 for W64 if >4GB, 4 for RF64 if >4GB
Use only for Wav Writer or encoders with support for these headers.

We can output WAVE_FORMAT_EXTENSIBLE, w64 and rf64 uncompressed files.
Is recommended, but not mandatory, rename the W64 files like .w64

At least Flac seems go support these formats >4GB in next version.

Adub
26th May 2008, 03:51
Great!! Thanks a lot tebasuna51!! I'll test it out soon.

cweb
26th May 2008, 10:00
Great!! Thanks a lot tebasuna51!! I'll test it out soon.
I'll be doing the same myself.. thanks for this update!

DaniH
1st June 2008, 22:17
Hi!
What about 5.1 AC3 to 5.1 HE-AAC (Nero), is it supported?
I tried it and got 2 channel AAC-s every time...

tebasuna51
2nd June 2008, 01:31
Hi!
What about 5.1 AC3 to 5.1 HE-AAC (Nero), is it supported?
I tried it and got 2 channel AAC-s every time...
Maybe use you DirectShowSource to open the ac3?

Use NicAc3Source or configure properly your DirectShow decoder.

If still obtain stereo from 5.1 please put the log (copy the output window and paste here), and the avs generated by 'Export AviSynth script' button.

DaniH
2nd June 2008, 08:07
Maybe use you DirectShowSource to open the ac3?

Use NicAc3Source or configure properly your DirectShow decoder.

If still obtain stereo from 5.1 please put the log (copy the output window and paste here), and the avs generated by 'Export AviSynth script' button.

Dear tebasuna51,

I used NicAC3Source of course. Didn't try DirectShowSource. I'll do some more tests and post the log.
I checked the channel count in SMPlayer's information window. Is there a dedicated program that analyzes sound streams, maybe even channel mapping? I would like to check whether channels gets mixed up after encoding or not (many people had similar problems)

UPDATE: sorry it seems SMplayer info is b0rked, downloaded GSpot, nice prog, but there is no channel mapping info :(
Now I get another error:
Error: System.IO.IOException: Pipe ended (or something) when using NicAC3Audio. Tried to convert to WAV, then to AAC, same IO problem...
Here is the output
-------------------------------------------------------------------------------
Starting job test_Track1.wav->test_Track1_b9624cce58bf4e8a8f05db6536ef8296.mp4
Found Audio Stream
Channels=6, BitsPerSample=32 float, SampleRate=48000Hz
encoder\neroAacEnc.exe -ignorelength -he -q 0.6 -if - -of "D:\Test\test_Track1_b9624cce58bf4e8a8f05db6536ef8296.mp4"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: A pipe használata befejeződött. //(Meaning pipe ended - my addition)

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()
#### Encoder StdOut ####
ERROR: no valid SBR configuration found
-------------------------------------------------------------------------------
This is the wav input - with AC3 input I get the same error.

DaniH
2nd June 2008, 08:58
Okay, me again, sorry :)
So I found out about this IO problem: I get this when i choose HE-AAC with VBR (quality)...
LC-AAC with VBR, or HE-AAC with CBR works... So why no VBR???

The only question that remains is how I could check the channel mappings of the AC3 input and the AAC output (recommend a program please)!

P.S. I did some research on the forums, found this (http://forum.doom9.org/showthread.php?t=120192&highlight=channel):
Skelsgard @ 4th Jan. 2007 wrote
"Nero AAC encoder CLI has proper mapping. As long as your WAV is correctly mapped as a multichannel WAV, you will have no problem."
So i presume if a correctly mapped AC3 (and I see no reason for it to be not correct - it's the DVD source itself) gets converted to AAC via NicAC3Decoder and NeroAacEnc CLI (latest), the channel mapping will be correct (and I can sleep calmly :))?
Tebasuna51, you too recommended the CLI encoder in the same topic.

tebasuna51
2nd June 2008, 10:12
Okay, me again, sorry :)
So I found out about this IO problem: I get this when i choose HE-AAC with VBR (quality)...
LC-AAC with VBR, or HE-AAC with CBR works... So why no VBR???
When use VBR quality use the 'Automatic' set. Only in the limits you can select the mode HE or LC.
The HE-AAC option is for low quality and q=0.6 is high quality then Neroaacenc reject the petition. I don't remember now, but the limit is near q=0.3

The only question that remains is how I could check the channel mappings of the AC3 input and the AAC output (recommend a program please)!

I don't know what you want check. An ac3 5.1 only have one possible channels configuration: LFE on, acmod=7 (mean left, right and center front channels and left, right surround channels)

You can see the acmod/lfeon possible values is this post (http://forum.doom9.org/showthread.php?p=1134394#post1134394)

About aac I don't know other info than the number of channels.

You can use MediaInfo to know data about media streams.

DaniH
2nd June 2008, 11:12
I don't know what you want check. An ac3 5.1 only have one possible channels configuration: LFE on, acmod=7 (mean left, right and center front channels and left, right surround channels)
Thank you for your post!
What I've meant was that the AV forums of the net are full of topics that discuss the mixed-up channel order that results from an 5.1AC3->5.1AAC encode. Left gets mixed up with Right etc... But none of the topics came to a conclusion, and that confused me a bit, that's why I asked.

tebasuna51
2nd June 2008, 12:25
Thank you for your post!
What I've meant was that the AV forums of the net are full of topics that discuss the mixed-up channel order that results from an 5.1AC3->5.1AAC encode. Left gets mixed up with Right etc... But none of the topics came to a conclusion, and that confused me a bit, that's why I asked.

Don't worry about this. BeHappy always produce correct channel mapping output.

Only old style decoders/encoders can have channel mapping problems. Between the decoders/encoders used by BeHappy, only ffmpeg(for ac3) and oggenc2(ogg) need a remapping done automatically.

masscamp24
3rd June 2008, 00:50
How does one install ffmpeg programme for ac3 in behappy? I install it in the encoder folder. try to convert a wav file to ac3 (upmix to 5.1 channels) got a error indicating that encoder not found.

tebasuna51
3rd June 2008, 01:42
How does one install ffmpeg programme for ac3 in behappy? I install it in the encoder folder. try to convert a wav file to ac3 (upmix to 5.1 channels) got a error indicating that encoder not found.

Maybe is a ffmpeg without the ac3 encoder. There are many ffmpeg binary and you must select the appropriate.
Not problem with my old version:
Starting job Jap6.wav->zzJap6.ac3
Found Audio Stream
Channels=6, BitsPerSample=16 int, SampleRate=48000Hz
encoder\ffmpeg.exe -i - -y -acodec ac3 -ab 384 "E:\zzJap6.ac3"
Writing RIFF header to encoder's StdIn
Writing PCM data to encoder's StdIn
Finalizing encoder
Complete
#### Encoder StdErr ####
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mingw32 --enable-memalign-hack --enable-gpl --enable-a52 --enable-dts --enable-mp3lame --enable-faac --enable-amr_nb --enable-faad --enable-amr_wb --enable-pp --enable-x264 --enable-xvid --enable-theora --enable-libogg --enable-vorbis
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on May 13 2006 18:31:30, gcc: 4.1.0 [Sherpya]
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 4608 kb/s
Stream #0.0: Audio: pcm_s16le, 48000 Hz, 5:1, 4608 kb/s
Output #0, ac3, to 'E:\zzJap6.ac3':
Stream #0.0: Audio: ac3, 48000 Hz, 5:1, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0

video:0kB audio:938kB global headers:0kB muxing overhead 0.000000%

SpAwN_gUy
3rd June 2008, 09:33
Hi guys ... it's me :) ..again.. i've moved to Vista x64 ... and.. i'm having all king of troubles :) ..

Starting job Rus_25fps.ac3->Rus_25fps_a2f77829a9834bdba1e700f216907c71.ac3
Error: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at BeHappy.AviSynthClip.dimzon_avs_init_2(IntPtr& avs, String func, String arg, AVSDLLVideoInfo& vi, AviSynthColorspace& originalColorspace, AudioSampleType& originalSampleType, String cs)
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.AviSynthScriptEnvironment.ParseScript(String script)
at BeHappy.Encoder.encode()
and this happens all the time.. it seems like i'm doing something wrong.. :( (latest BeHappy.. previous has the same problem)

any solution, please?

(well, it may be due to x86 and x64 bitness of various software.. i'll try BePipe now...)
UPD: BePipe decodes.. but ffmpeg - does not encode (something like "Can't open file for writing")
btw.. same stuff happens to allmost latest megui ... (i'll move there)

masscamp24
3rd June 2008, 20:01
[QUOTE=tebasuna51;1145102]Maybe is a ffmpeg without the ac3 encoder. There are many ffmpeg binary and you must select the appropriate.

Where can I find the correct binary? :stupid:

tebasuna51
3rd June 2008, 23:54
Maybe is a ffmpeg without the ac3 encoder. There are many ffmpeg binary and you must select the appropriate.

Where can I find the correct binary? :stupid:

I can't recommend ffmpeg like ac3 encoder, use aften (http://win32builds.sourceforge.net/aften/index.html) instead.

dimzon
4th June 2008, 11:38
Hi guys ... it's me :) ..again.. i've moved to Vista x64 ... and.. i'm having all king of troubles :) ..

Starting job Rus_25fps.ac3->Rus_25fps_a2f77829a9834bdba1e700f216907c71.ac3
Error: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at BeHappy.AviSynthClip.dimzon_avs_init_2(IntPtr& avs, String func, String arg, AVSDLLVideoInfo& vi, AviSynthColorspace& originalColorspace, AudioSampleType& originalSampleType, String cs)
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.AviSynthScriptEnvironment.ParseScript(String script)
at BeHappy.Encoder.encode()
and this happens all the time.. it seems like i'm doing something wrong.. :( (latest BeHappy.. previous has the same problem)

any solution, please?

it means BeHappy is started as 64-bit process and attept to load 32-bit dll...
to solve this problem we need rebuild BeHappy using target CPU x86 (not Any CPU)
it's also possible via special compiler key too

tebasuna51
4th June 2008, 18:17
it means BeHappy is started as 64-bit process and attept to load 32-bit dll...
to solve this problem we need rebuild BeHappy using target CPU x86 (not Any CPU)
it's also possible via special compiler key too
Hello, Dimzon. Thanks for your post, this question is out of my knowledge.

Last version was compiled with:
%windir%\Microsoft.NET\Framework\v2.0.50727\MSBuild BeHappy.csproj /t:Rebuild /p:Configuration=Release /p:Platform=x86 /p:OutputPath=.\Dist

and inside BeHappy.csproj also:
...
<PlatformTarget>x86</PlatformTarget>
...

The files (BeHappy.csproj and compile.bat) are in BeHappy source code.

dimzon
4th June 2008, 19:40
Hello, Dimzon. Thanks for your post, this question is out of my knowledge.

Last version was compiled with:
%windir%\Microsoft.NET\Framework\v2.0.50727\MSBuild BeHappy.csproj /t:Rebuild /p:Configuration=Release /p:Platform=x86 /p:OutputPath=.\Dist

and inside BeHappy.csproj also:
...
<PlatformTarget>x86</PlatformTarget>
...

The files (BeHappy.csproj and compile.bat) are in BeHappy source code.
Actually BeHappy works fine onto my Windows Server 2003 x64.
Unfortunally I have not Vista to debug this bug...

dimzon
5th June 2008, 15:53
finally System.BadImageFormatException solved
code (not binary) commited to codeplex

cweb
5th June 2008, 16:35
I had an error with the latest version, sorry I didn't keep track of it, converting mp3 to ac3 using the bundled aften, but I solved it by updating to the latest aften.

Menedas
6th June 2008, 09:25
I'm currently trying to time stretch a 6 channel FLAC, which I made from a eac3, and save it to a 6 channel WAV.

With version 0.1.0.35190 I get a WAV which seems to have asynchronous channels. It sounds not as it should.

With an upgrade to version 0.1.9.50202 I get this error message:

Starting job LiW.flac->LiW.wav
Error: BeHappy.AviSynthException: Script error: there is no function named "bassAudioSource"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

tebasuna51
6th June 2008, 11:15
I'm currently trying to time stretch a 6 channel FLAC, which I made from a eac3, and save it to a 6 channel WAV.

With version 0.1.0.35190 I get a WAV which seems to have asynchronous channels. It sounds not as it should.
Use you DirectShowSource in this version to open the LiW.flac?

With an upgrade to version 0.1.9.50202 I get this error message:

Starting job LiW.flac->LiW.wav
Error: BeHappy.AviSynthException: Script error: there is no function named "bassAudioSource"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

If you want use BassAudioSource instead DirectShowSource like flac decoder, you need in your 'c:\Program files\AviSynth 2.5\plugins' folder these 3 files (see the readme.txt in BeHappy\plugins folder):
BassAudio.dll
Bass.dll
Bass_flac.dll

Menedas
6th June 2008, 11:35
Use you DirectShowSource in this version to open the LiW.flac?

No I also use BassAudio here. With DirectShow Source I get this error:
Error: BeHappy.AviSynthException: DirectShowSource: couldn't open file C:\LiW.flac:
Unsupported format.
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()



If you want use BassAudioSource instead DirectShowSource like flac decoder, you need in your 'c:\Program files\AviSynth 2.5\plugins' folder these 3 files (see the readme.txt in BeHappy\plugins folder):
BassAudio.dll
Bass.dll
Bass_flac.dll

Its still in the AviSynth plugins directory, else it would not work in version version 0.1.0.35190, too.

tebasuna51
6th June 2008, 15:40
Its still in the AviSynth plugins directory, else it would not work in version version 0.1.0.35190, too.

Yep, for this my first question.

And your SO, Vista, 32/64 bits?

Menedas
6th June 2008, 18:04
And your SO, Vista, 32/64 bits?

XP Pro 32

tebasuna51
6th June 2008, 20:25
XP Pro 32
I don't know what is the problem.

Try inserting the line (or equivalent):
LoadPlugin("C:\Program files\Avisynth 2.5\plugins\BassAudio.dll")
in the avs generated with 'Export Avisynth script'

Menedas
6th June 2008, 20:55
I have tried to copy the bassAudio.dll to different paths, thats why it is D root here, but I always get this message:

Error: BeHappy.AviSynthException: LoadPlugin: unable to load "D:\BassAudio.dll"

AviSynth is correct installed. For example MeGUI works.

DenisKanone
22nd June 2008, 16:53
Gratulation for this great Programm. I use BeHappy since the first Release. With WinXP 32bit (NET.Framework 2) works the Programm perfect. But with Win VISTA 32bit (NET.Framework 3) i have a little Problem. The Programm encode the File correct, but after the Encode-Processe BeHappy close from self without Error-Reporting. When I will use Batch-Encoding (more Jobs), then BeHappy encode the first File (first Job) and then close from self.
Then I want me a new Feature: Fade In/Out with seperatly Preferences.

Sorry for my "School-English". I hope all understand me.

dimzon
28th June 2008, 10:22
I found some little bugs in the last released BeHappy ver.0.1.9.50202.
1.enc_aacplus limit bitrate is 16kbps not 8kbps,this is just converse to neroAacEnc.
2.neroAacEnc limit bitrate is 8k not 16,but the different neroAacEnc_SSE limit also is 16k no longer support 8k.
3.when I new get the behappy and download the neroaacenc form internet, put in behappy encoder folder, but its not work if I choose p4 support.bocs the original file name is "neroAacEnc_SSE.exe" not "neroAacEnc_SSE2.exe".So I must rename the codec.
All the really little bugs,but hope correct in next version,make BeHappy perfect..
if received,give me reply pls.
Chris
2008-06-28 14:12
tebasuna51, just rebuild last sources and make new relesase...

Reference: http://forum.doom9.org/showthread.ph...75#post1146075

I'm using windows vista 64, and i've got this bug!

Where I can find the binary of your bugfix?

Thank you

tebasuna51
28th June 2008, 17:39
tebasuna51, just rebuild last sources and make new relesase...

Done. New BeHappy v0.2.2.30338 released.

Please report if all bugs are solved

Menedas
28th June 2008, 20:31
Still have the same bug. :(

tebasuna51
29th June 2008, 00:20
Still have the same bug. :(

I don't know what is your problem, try this:

Put this Test1.exe (http://www.sendspace.com/file/yhulvl) in D:\, DoubleClick (execute) and accept decompress in D:\.

DoubleClick D:\Test1\Test1.bat and say me what happen.

Menedas
29th June 2008, 00:43
It opens cmd without output and one hidden window with the title "Incorrect BASS.DLL version" I could only see in the task bar.

tebasuna51
29th June 2008, 02:45
It opens cmd without output and one hidden window with the title "Incorrect BASS.DLL version" I could only see in the task bar.
Check if you have in your system other bass.dll with a version lower than 2.4

The three dll files in Test1 are 2.4 and work fine for me. Sorry.

shon3i
4th July 2008, 10:18
New package is out:

Based on BeHappy 0.2.2.30338 (2008-06-28)
All encoders and avsplugins are upto date.
New installer system: Inno Setup, to downsize package size, Installshield uses bigger overhead.

Link (http://tom.niko.users.sbb.co.yu/BeHappy_20080704.exe), Mirror (http://www.box.net/shared/epiguyhkco), Alternative site (tom.niko.users.sbb.co.yu)

Menedas
4th July 2008, 13:22
Check if you have in your system other bass.dll with a version lower than 2.4


Ok, I found the Problem. It was the bass_flac.dll in my AviSynth Plugin Directory which came for the previous BeHappy Package (installer). When I removed the bass_flac.dll the Test works. When I install the new Package from shon3i I get the error, that OptimFROG.dll could not been found, but process finished successful.

I will test later to convert my flac and tell the results.

shon3i
4th July 2008, 14:49
When I install the new Package from shon3i I get the error, that OptimFROG.dllConfirmed. Just remove bass_ofr.dll from avs plugins dir.

chriszxl
5th July 2008, 09:05
use enc_aacplus output .aac format...I can't give the --mpeg4aac order by Behappy..So only version2 aac I can get...not version 4.
but if output .mp4 or .m4a format mux by mp4box/mp4mux the defualt is aac version4

tebasuna51
5th July 2008, 09:45
use enc_aacplus output .aac format...I can't give the --mpeg4aac order by Behappy..So only version2 aac I can get...not version 4.
but if output .mp4 or .m4a format mux by mp4box/mp4mux the defualt is aac version4

Yep, the default output of last Winamp CT dll's is mpeg2, before was mpeg4.

Only when go to be put in mp4 container we change the header flag to mark mpeg4 (the data stream is always the same).

If there are any other reason to select mpeg2/4 flag we can put a checkbox in Configure CT-AAC GUI.

masscamp24
5th July 2008, 13:06
I download the installer package and tried to use ffmpeg ac3. The program crashed I got this message "Application has failed to start because optimFROG.dll was not found. Re-installing may fix the problem" I reinstall but get the same message. What does this mean. I'm useing windows xp system32.

PS I get the same message when I start VDUBMod and try to use WMP2 via AviSynth 2.58. I never had this problem before useing these programe. Can someone please help.

Menedas
5th July 2008, 13:19
Look three posts above your post.

masscamp24
5th July 2008, 13:43
That was quick I love this forum. Thanks Mate

Menedas
5th July 2008, 14:50
Now that I can handle flac files with Bass again, I tried to convert my 6 channel flac to aac. The resulting file is still does have async channels.

shon3i
5th July 2008, 15:11
Now that I can handle flac files with Bass again, I tried to convert my 6 channel flac to aac. The resulting file is still does have async channels.
What setting you use, CT or Nero AAC, can you split this flac and upload small segment here? You can aslo try to decode flac to wav, and report what you get?

Menedas
5th July 2008, 15:43
I also created a wav with the same problem. Output format seems not the problem. I think the TimeStretch is the problem, because if I only just convert the flac to aac without TimeStretch the channels are synchron.

Here is the header of the flac. Hope it works without the footer:
http://www.megaupload.com/?d=2UAALBSP

You can hear that it is unsync at 28 sec, when the narrator starts to talk.

I time stretched from 23,976 to 25.

chriszxl
6th July 2008, 15:21
When the source sampling rate is lower than 32000,use the enc_aacplus code will be error,as:
Error: System.IO.IOException:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
because of enc_aacplus only allows the source as 32000-48000,hope can present the correct prompt in Behappy,or Behappy can auto choose a resample rate to fit to encaacplus is better...
and another problem is I cant choose the bitrate to 8kbps when use neroaacenc,but actually neroaacenc can recoding to 8kbps(neroaacen_sse can not),bcos I really care about the file size when I make some stuff to my handphone...so fix it pls..

tebasuna51
6th July 2008, 17:34
When the source sampling rate is lower than 32000,use the enc_aacplus code will be error,as:
Error: System.IO.IOException:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
because of enc_aacplus only allows the source as 32000-48000,hope can present the correct prompt in Behappy,or Behappy can auto choose a resample rate to fit to encaacplus is better...
BeHappy is a GUI for AviSynth audio and don't check the input sources.
and another problem is I cant choose the bitrate to 8kbps when use neroaacenc,but actually neroaacenc can recoding to 8kbps(neroaacen_sse can not),bcos I really care about the file size when I make some stuff to my handphone...so fix it pls..
Maybe in next release.

Deckard2019
16th July 2008, 22:50
Just a small note : ffmpeg need more details for bitrates. So in ffmpeg.extension, "Value" tags become :
... <Value>-i - -y -acodec mp2 -ab 224kb "{0}"</Value> ...
... <Value>-i - -y -acodec mp2 -ab 192kb "{0}"</Value> ...

Menedas
16th July 2008, 23:02
Does someone checking my problem with the asynchronous channels after time stretch?

tebasuna51
17th July 2008, 00:44
Just a small note : ffmpeg need more details for bitrates. So in ffmpeg.extension, "Value" tags become :

Well, not in my version.

We can't support all ffmpeg versions/compiles.

Everybody is free to adapt ffmpeg.extension to their ffmpeg version.

I can't recommend ffmpeg to encode audio (float samples, channelmap bugs, ...)

tebasuna51
17th July 2008, 01:26
I also created a wav with the same problem. Output format seems not the problem. I think the TimeStretch is the problem, because if I only just convert the flac to aac without TimeStretch the channels are synchron.

Here is the header of the flac. Hope it works without the footer:
http://www.megaupload.com/?d=2UAALBSP.

Sorry but I can't recover the wav file.

BTW I need the original wav file (first minute) to try reproduce the problem.

Menedas
17th July 2008, 07:02
Whats the problem with the flac file? It is the original. Don't wanna have a very large wav lying around and have to upload it. Just use the flac and create a wav (or what ever format you like) with behappy and with time stratch as I said with the flac. It should work. As it does here. The conversion will take a while, I know. The same time as when you have the whole flac file.

Or do you mean that you don't have that bug with your created time stretched audiofile?

Deckard2019
17th July 2008, 22:49
Well, not in my version.
I'm talking about the version found in shon3i's package.

Everybody is free to adapt ffmpeg.extension to their ffmpeg version
Sure. shon3i too ;)

tebasuna51
18th July 2008, 02:30
I'm talking about the version found in shon3i's package.
...
Sure. shon3i too ;)

Yep, I think the next shon3i package come without ffmpeg.

tebasuna51
18th July 2008, 02:34
Whats the problem with the flac file?
I can't decode it.

Menedas
18th July 2008, 18:58
I wonder. Normally I'm the one who has problems :)

Ok, here is the header as wav file:
http://www.megaupload.com/?d=KRR980YC

tebasuna51
18th July 2008, 20:37
I wonder. Normally I'm the one who has problems :)

Ok, here is the header as wav file:
http://www.megaupload.com/?d=KRR980YC

Thanks. Now I have 33.9816 sec of wav 5.1 file with begin talk at 28 sec like you say (in FL, FR and FC channels in sync.).

I try a Timestretch 23.976 -> 25 and obtain a 32.5897 sec. wav file with Rate and Tempo modes, and the same time 33.9816 with Pitch mode.

In Tempo and Rate modes now begin talk at 27 sec. and in all modes FL, FR and FC are sync.

What async. you detect?

Menedas
18th July 2008, 20:59
Hard to tell how it sounds. Maybe its again only a problem on my side. So here is the file I get when I make a Timestretch on the header file I've uploaded:
http://www.megaupload.com/?d=PB0SI21B

I'm using the Rate Control "Tempo changed, pitch correction". Hope you can hear the difference to the original, else tell me which software do you use to hear it. I have tested it with foobar2000, ffdshow and vlc. All with the same problem.

tebasuna51
19th July 2008, 02:42
Hard to tell how it sounds.
...
Hope you can hear the difference to the original, else tell me which software do you use to hear it. I have tested it with foobar2000, ffdshow and vlc. All with the same problem.

Sorry, I can't hear the difference (Foobar2000). There are, of course, a pitch change, but async?

But, also, I can't see the diference. I use audio editors (Audacity, Wavosaur, ...) to see the exact ms.

Menedas
19th July 2008, 03:50
I have tested the Timeshifted audio file on a different computer with Linux. I can also hear there that the sound is wrong. And its not a problem of pitch. I have tried all three time shift options with the same result. For me its easy to hear. I can hear that the channels are not sync which results in an echo and some other effect. Maybe you should use a headphone. Also the ABX comparison of foobar2000 may help you to hear the difference.

tebasuna51
19th July 2008, 10:54
I have tested the Timeshifted audio file on a different computer with Linux. I can also hear there that the sound is wrong. And its not a problem of pitch. I have tried all three time shift options with the same result. For me its easy to hear. I can hear that the channels are not sync which results in an echo and some other effect. Maybe you should use a headphone. Also the ABX comparison of foobar2000 may help you to hear the difference.

Is well know than a timestretch transformation is not perfect (the Rate option with only samplerate change can be the more accurate).

I always say, also, than the audio never is the culprit of different video framerate problems. The video must be changed to mantain the same duration than original and the audio don't need change. This is the correct way and I recommend you use this method.

Menedas
19th July 2008, 11:11
To just change the frame rate the video is not a solution for me, because I mostly have 25fps and 23,976fps audio which I both need. So one of them have to be time shifted.

And as I said, I tested all three time shift modes. Also the one option without pitch correction you mentioned makes it wrong, so the explanation seems not accurate to me.

tebasuna51
19th July 2008, 12:24
To just change the frame rate the video is not a solution for me, because I mostly have 25fps and 23,976fps audio which I both need. So one of them have to be time shifted.

Try with not free soft: TimeFactory (http://www.prosoniq.com/main/timefactory-2-windows/)

And as I said, I tested all three time shift modes. Also the one option without pitch correction you mentioned makes it wrong, so the explanation seems not accurate to me.

?

Menedas
19th July 2008, 12:47
The "?" means that you don't understand my writing or my conclusion? Can't you still don't hear it?

tebasuna51
19th July 2008, 13:06
The "?" means that you don't understand my writing or my conclusion? Can't you still don't hear it?

Like I say you the Rate transform can't introduce audible artifacts like the Tempo and Pitch can do.

Menedas
19th July 2008, 13:17
Of which DSP do you talk now? Not Timestretch?

tebasuna51
19th July 2008, 16:32
Of which DSP do you talk now? Not Timestretch?

Yes TimeStretch. There are 3 modes in 'Rate Control':
- Rate ...
- Pitch ...
- Tempo ...

The Rate mode don't need sophisticated algorithms to do the job, only change the samplerate then the waveform is very similar and only the pitch change can be detected. This is the -slowdown/speedup from eac3to.

Pitch or Tempo modes need more complex job.
You can try also different parameters in TimeStretch AviSynth function (http://avisynth.org/mediawiki/TimeStretch)

lchiu7
19th July 2008, 22:45
Our new DVB-T broadcasts are using this audio format. About the only way to hear the recorded files is to have PowerDVD8 which has a DS filter that can handle this audio format.

Since Behappy uses DS I wonder if it's possible to use this tool to convert this audio format to something common - say MP4 or even 2 channel AC-3 so that it could be muxed back with the original (or even re-compressed) AVC video into something that is easier to play.

Thanks

Menedas
19th July 2008, 23:46
Ok, then I have understood you right. But how can you explain, that there is the same effect hearable with the Rate option? Hence, the effect I can hear could not come from the pitch. Thats what I wanted to say the whole time.

I wasn't really aware that the speedup option of eac3to is maybe the thing I wanted. I tested it and it does not have the same "bug" as the AviSynth function (Rate). Thank you for that information. But thats only a solution for eac3 files. I need also something for AC3 or DTS files.

tebasuna51
20th July 2008, 00:31
Our new DVB-T broadcasts are using this audio format. About the only way to hear the recorded files is to have PowerDVD8 which has a DS filter that can handle this audio format.

Since Behappy uses DS I wonder if it's possible to use this tool to convert this audio format to something common - say MP4 or even 2 channel AC-3 so that it could be muxed back with the original (or even re-compressed) AVC video into something that is easier to play.

Seems there are also a free LATM aac DS decoder (http://forum.doom9.org/showthread.php?p=1082416#post1082416)

You can try open the file with the DirectShowSource method.

tebasuna51
20th July 2008, 01:04
Ok, then I have understood you right. But how can you explain, that there is the same effect hearable with the Rate option? Hence, the effect I can hear could not come from the pitch. Thats what I wanted to say the whole time.

I can't explain a effect that I don't hear.

I wasn't really aware that the speedup option of eac3to is maybe the thing I wanted. I tested it and it does not have the same "bug" as the AviSynth function (Rate). Thank you for that information. But thats only a solution for eac3 files. I need also something for AC3 or DTS files.

I'm happy you found the solution because eac3to also decode ac3 and dts files.

Menedas
20th July 2008, 01:17
I can't explain a effect that I don't hear.
Strange. You can't even hear it with headphones?

lchiu7
20th July 2008, 04:22
Seems there are also a free LATM aac DS decoder (http://forum.doom9.org/showthread.php?p=1082416#post1082416)

You can try open the file with the DirectShowSource method.

Tried that (under Vista SP1). Demuxed the audio from the ts file using tsremuxer (saved as a aac file)

Had the Monogram filter already installed

Opened the aac file using behappy and chose Directshow (also tried avisynth).

Both times in a few second Behappy just died (program has stopped responding).

So it looks like Behappy is unable to open these files

gtpboy
28th August 2008, 22:11
Maybe I’m doing something wrong but I'm trying to take a 6 channel AC3 file splitting into individual mono WAV files then re encode it into a single WAV file in WME.

Well once BeHappy gets done splitting the AC3 file into the individual WAV files I go to convert it in WME and it tells me that the source files need to be mono WAV files, well I thought that’s what I just did. I've double and triple checked all the settings in BeHappy but can't figure it out.

Is there an easier way to do this like a straight encode AC3->WMA 10 instead of splitting and then rejoining?

tebasuna51
29th August 2008, 02:00
Maybe I’m doing something wrong but I'm trying to take a 6 channel AC3 file splitting into individual mono WAV files then re encode it into a single WAV file in WME.
What is WME?
Do you need a single WAV or a WMA?

Well once BeHappy gets done splitting the AC3 file into the individual WAV files I go to convert it in WME and it tells me that the source files need to be mono WAV files, well I thought that’s what I just did. I've double and triple checked all the settings in BeHappy but can't figure it out.
BeHappy can decode ac3 files to a single WAV multichannel (Destination Wav Writer) file or to monowav files (Destination WavSplit @ Mono Wav's).
Is there an easier way to do this like a straight encode AC3->WMA 10 instead of splitting and then rejoining?
If MS supply a WMA encoder with STDIN input we can add a direct transcode AC3->WMA in BeHappy.

Snowknight26
29th August 2008, 03:15
WME = Windows Media Encoder.

tebasuna51
29th August 2008, 09:46
WME = Windows Media Encoder.
Sorry, I don't know this tool.
I supose you want output a multichannel WMA.

And WME need 6 monowavs always to encode a multichannel WMA?
And WME don't recognize the monowavs generated by BeHappy-WavSplit?

gtpboy
29th August 2008, 13:02
BeHappy can decode ac3 files to a single WAV multichannel (Destination Wav Writer) file or to monowav files (Destination WavSplit @ Mono Wav's).

I did see that option in there but didn't know it generated a multichannel WAV file I'll have to try that thanks.

And WME don't recognize the monowavs generated by BeHappy-WavSplit?

Aparently i've tried it on a few different AC3 files and get the same message "source must be mono WAV file"

Oh well as long as the other method works i'll be fine Thanks again

WME is a fickle program some AC3 files it will transcode with no problems others it will generate a "source file type is invalid" error same with some DTS files

DiGiT@LON€
31st October 2008, 11:52
Hi everyone.
I'm an Italian user, sorry for my bad English.

I have to make 2 questions:

- I have an ac3 2.0 audio file. I want to convert it in wav with behappy latest release.
I select wav writer like encoder, and the encode works good.
But the output wav file don't have sound.
I can see from foobar that it is a PCM 32 bit floating point, but there's not sound.
How can I convert better?

- Does Behappy add a delay to output file? If yes, how much?

Thanks...

tebasuna51
31st October 2008, 14:12
- I have an ac3 2.0 audio file. I want to convert it in wav with behappy latest release.
I select wav writer like encoder, and the encode works good.
But the output wav file don't have sound.
I can see from foobar that it is a PCM 32 bit floating point, but there's not sound.
How can I convert better?
This is a NicAudio ac3 decoder behaviour more than BeHappy related.

When the decoder found a valid ac3 frame set some basic parameters (num_channels, samplerate, bitrate) and after reject (filling with silence) any other frame don't match the initial basic parameters.

Probably your ac3 source is from a TV capture and you have some initial frames 2.0 (commercials) and after change to 5.1 (movie), sorry but NicAudio can't begin supply 2.0 and change to 5.1 on the fly. You can use DelayCut to check the ac3 file and cut the initial 2.0 frames (if is the problem).

- Does Behappy add a delay to output file? If yes, how much?

Behappy have a box to include any desired delay. By default BeHappy don't add delay.

NicAudio.dll v2.0.2 ac3 decoder can add delay (a multiple of 32 ms) when found invalid data (until 1 MB) before the first valid ac3 frame, then can compensate pseudo-delays in VirtualDub style. If you don't want this delay you can use DelayCut to fix the ac3 before decode.

There are also little delays introduced by encoders, for instance ac3 encoders do a 5.333 ms delay (with Aften you can disable this delay with the -pad 0 parameter)

DiGiT@LON€
31st October 2008, 18:08
This is a NicAudio ac3 decoder behaviour more than BeHappy related.

When the decoder found a valid ac3 frame set some basic parameters (num_channels, samplerate, bitrate) and after reject (filling with silence) any other frame don't match the initial basic parameters.

Probably your ac3 source is from a TV capture and you have some initial frames 2.0 (commercials) and after change to 5.1 (movie), sorry but NicAudio can't begin supply 2.0 and change to 5.1 on the fly. You can use DelayCut to check the ac3 file and cut the initial 2.0 frames (if is the problem).Yes, you're right. It comes from a TV capture.
Can you suggest me another tool that convert ac3 (in this status) in wav?
Have I to use Delaycut imperatively?

There are also little delays introduced by encoders, for instance ac3 encoders do a 5.333 ms delay (with Aften you can disable this delay with the -pad 0 parameter)Does Ac3 encoder in BeHappy have this behaviour?
If yes, have I to set -5.333 in BeHappy for synchronizing?

DiGiT@LON€
31st October 2008, 23:39
I have resolved with Azid-BeSweet.
Now I want to know only if azid is between those encoders that apply a delay during the encode.

Then, if someone explains me why the encode works with azid-beesweet, I appreciate...
Thanks...

Kurtnoise
2nd January 2009, 17:27
@Tebasuna:

I found a bug in the AvisynthWrapper. Using your dll + the wrapper with megui, I got a buffer overrun issue. :eek:

Here is the fix (http://pastebin.com/f11b1bda1)...

tebasuna51
3rd January 2009, 02:32
You are rigth Kurtnoise. Next release must correct that. Thanks.

Isn't a problem for BeHappy because seems never read video frames but MeGUI ...

I don't know if AvisynthWrapper.cs can work with MeGUI my unique change was 'dimzon_avs_init' -> 'dimzon_avs_init_2'

Kurtnoise
3rd January 2009, 10:04
well...the AvisynthWrapper.cs is the same (quite normal because we uses the same lib ;)). The main difference comes from the encoder routines (wav header writing, etc...). Yesterday, I tried to drop the ConvertAudio16Bits() restriction from the megui script but unfortunately, it produces some garbage as ouput whereas with BeHappy and the same script, all it's fine. So, I suspect something wrong with the wav header. I've seen that the wav header writing is more accurate with BeHappy (wav > 4GB detection, different headertypes, etc...) but I'm busy with other things right now so I can't check it out more carefully...

tebasuna51
3rd January 2009, 17:20
You are writing always INT wav files.

In AviSynthAudioEncoder.cs (line 482) you need only write the correct Format_tag:
- target.Write(BitConverter.GetBytes((short)0x01), 0, 2);
+ target.Write(BitConverter.GetBytes((a.SampleType==AudioSampleType.FLOAT) ? (short)0x03) : (short)0x01), 0, 2);

Where (in AviSynthWrapper.cs):
public enum AudioSampleType:int {
Unknown=0,
INT8 = 1,
INT16 = 2,
INT24 = 4,
INT32 = 8,
FLOAT = 16
};

Seraphic-
3rd January 2009, 21:29
Nero AAC Codec 1.3.3.0 was released a few weeks ago.
Is neroAacEnc built into BeHappy or do you just have to put the neroAacEnc in the BeHappy "encoder" folder before BeHappy can encode NeroAAC. (i've been doing the latter)

Also, does anyone have any experiance with "save extra non audio information"?
Generally, if you are going directly from an audio editor like adobe premiere/audition to an audio encoder like BeHappy for NeroAAC, would it be recommended to disable or enable "save extra non audio information"?

Kurtnoise
3rd January 2009, 23:01
You are writing always INT wav files.

In AviSynthAudioEncoder.cs (line 482) you need only write the correct Format_tag:

thanks for the trick...it seems to work fine now. ;)


btw, did you noticed that with any sources, the bits per samples returned as info is always 32 ? even with 16 bits sources ?

to reproduce w/ BeHappy : take an ac3 (2.0) and transcode it to aac without applying any dsp. At the end, check the log, you'll see that the bps is always 32. Is it due to float conversion or is it a bug ?

tebasuna51
4th January 2009, 04:21
btw, did you noticed that with any sources, the bits per samples returned as info is always 32 ? even with 16 bits sources ?

to reproduce w/ BeHappy : take an ac3 (2.0) and transcode it to aac without applying any dsp. At the end, check the log, you'll see that the bps is always 32. Is it due to float conversion or is it a bug ?

NicAudio/Bass decoders always output 32 bits float (also many others functions work in 32 float). Behappy select the high resolution supported by the encoder, most the times supply 32 bit float.

Only lossless formats can be preserved.

How do you know than one ac3 have 16 bitdepth sources?
Also the dts field header about source bitdepth can be wrong (Surcode write 24 when sources are 16)
And what is the problem when supply the best precission know?.
Encoders convert to float any input most the times. Then we can skip two conversions.

tebasuna51
4th January 2009, 04:35
Nero AAC Codec 1.3.3.0 was released a few weeks ago.
Is neroAacEnc built into BeHappy or do you just have to put the neroAacEnc in the BeHappy "encoder" folder before BeHappy can encode NeroAAC. (i've been doing the latter)
Yes NeroAacEnc can't be build with BeHappy the you must dowload and include in same folder than BeHappy or in the sibfolder "encoder".

Now only exist 1 version (for Windows) and you don't need check the 'Use SSE CPU instructions' (must disapear for next version)

Also, does anyone have any experiance with "save extra non audio information"?
Generally, if you are going directly from an audio editor like adobe premiere/audition to an audio encoder like BeHappy for NeroAAC, would it be recommended to disable or enable "save extra non audio information"?

The "extra non audio information" is always ignored. Only if wav files are >4GB and the "extra info" is writed at end of file, after the 'data' chunk can be treated as audio data and produce a final click.

b66pak
27th January 2009, 19:39
i am encoding Madagascar 2 for my psp but the final audio (.m4a) has a really low volume...
i rip the 6ch.ac3 track > remove dialnorm (eac3to [other free options for this?]) > transcoded with behappy with nicac3source + downmix to stereo + normalize to 100% >.mp4 output is very low volume!
please advise...
_

tebasuna51
28th January 2009, 01:20
i am encoding Madagascar 2 for my psp but the final audio (.m4a) has a really low volume...
i rip the 6ch.ac3 track > remove dialnorm (eac3to [other free options for this?]) > transcoded with behappy with nicac3source + downmix to stereo + normalize to 100% >.mp4 output is very low volume!
please advise...
_
Your process is more or less correct but if you need the sound for low end audio equipment you need compress the dynamic range (less quality but more volume after normalize).
Then:
- You don' need remove DialNorm, NicAudio don't apply DialNorm.
- Open with BeHappy-NicAc3Source(DRC), Configure at (...)
Then the high volume are attenuated and low volume amplified (Dynamic Range Compresion)
- Downmix
- Normalize at end (must be the last DSP function).
Now are max amplified without overflow

b66pak
28th January 2009, 18:36
ok...thanks a lot for the help...

i use this .avs


#
NicAc3Source("F:\audio.ac3", DRC=1)
#
#
caaa4eafb6a2f44a1ae9bbae242a91a24=ConvertAudioToFloat(last)
#
function faaa4eafb6a2f44a1ae9bbae242a91a24(clip a)
{
#
flr = GetChannel(a, 1, 2)
#
fcc = GetChannel(a, 3)
#
lfe = GetChannel(a, 4)
#
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
#
mix = MergeChannels(lfc, lfc)
#
lrc = MixAudio(flr, mix, 0.2929, 1.0)
#
blr = GetChannel(a, 5, 6)
#
return MixAudio(lrc, blr, 1.0, 0.2929)
#
}
#
faaa4eafb6a2f44a1ae9bbae242a91a24(caaa4eafb6a2f44a1ae9bbae242a91a24)
#
#
Normalize(100.0/100.0)
#

and the volume level is higher...i am a little confused....why is behappy using normalize function before the downmix and not after?

i also find that Normalize(200.0/100.0) is busting the volume even higher...is this wrong?

by the way the psp is not low end audio...you must use headphones for proper audio output...
_

L.E. it would be very nice if someone experimented will make a tutorial (or guidance) for proper audio transcoding...
_

L.E.2 i have a .mp2 (2channel 192k cbr) from a TV recording that i need to transcode to .m4a...it is proper to normalize it to 100%?

#
NicMPG123Source("F:\audio.mp2")
#
#
Normalize(100.0/100.0)
#

what is the difference between the above and below (beside the level of normalization)?

#
NicMPG123Source("F:\audio.mp2", true)
#
#
_

best regards...

tebasuna51
29th January 2009, 01:26
...
and the volume level is higher...i am a little confused....why is behappy using normalize function before the downmix and not after?
In your sample Normalize is after.
The function definition can be at any place, only the execution line is important.
You have Up and Down buttons to put the DSP functions at desired order.

i also find that Normalize(200.0/100.0) is busting the volume even higher...is this wrong?
Yes, the sound is cliped and distorted

what is the difference between the above and below (beside the level of normalization)?
Nothing, if you don't need any other DSP function after you can use the decoder included normalize.

b66pak
31st January 2009, 20:25
how can i add delayaudio() and downmixing 3 or 4 or 5 channels to stereo to BeHappy's extensions?
_

L.E. a trim() extension too...
_

L.E.2 considering that mediainfo.dll is free for use in other apps it is posible to add an info button to display the audio track info?
_

tebasuna51
1st February 2009, 00:06
how can i add delayaudio() and downmixing 3 or 4 or 5 channels to stereo to BeHappy's extensions?

L.E. a trim() extension too...
You have the Delay and Split (Trim) boxes in (2) Tweak section.

You always can write your own avs scripts. We can't cover all the situations.

Select your desired downmix function:
function Dmix3Stereo(clip a) { # 3 Channels L,R,C or L,R,S
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
return MixAudio(flr, fcc, 0.5858, 0.4142)
}
function Dmix3Dpl(clip a) { # 3 Channels only L,R,S
flr = GetChannel(a, 1, 2)
sl = GetChannel(a, 3)
sr = Amplify(sl, -1.0)
blr = MergeChannels(sl, sr)
return MixAudio(flr, blr, 0.5858, 0.4142)
}
function Dmix4lStereo(clip a) { # 4 Channels L,R,C + LFE
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lfe = GetChannel(a, 4, 4)
clf = MixAudio(fcc, lfe, 0.2929, 0.2929)
return MixAudio(flr, clf, 0.4142, 1.0)
}
function Dmix4qStereo(clip a) { #4 Channels Quadro L,R,SL,SR
flr = GetChannel(a, 1, 2)
blr = GetChannel(a, 3, 4)
return MixAudio(flr, blr, 0.5, 0.5)
}
function Dmix4qDpl(clip a) { # 4 Channels Quadro L,R,SL,SR
flr = GetChannel(a, 1, 2)
bl = GetChannel(a, 3)
br = GetChannel(a, 4)
sl = MixAudio(bl, br, 0.2929, 0.2929)
sr = MixAudio(bl, br, -0.2929, -0.2929)
blr = MergeChannels(sl, sr)
return MixAudio(flr, blr, 0.4142, 1.0)
}
function Dmix4qDpl2(clip a) { # 4 Channels Quadro L,R,SL,SR
flr = GetChannel(a, 1, 2)
bl = GetChannel(a, 3)
br = GetChannel(a, 4)
sl = MixAudio(bl, br, 0.3714, 0.2144)
sr = MixAudio(bl, br, -0.2144, -0.3714)
blr = MergeChannels(sl, sr)
return MixAudio(flr, blr, 0.4142, 1.0)
}
function Dmix4sStereo(clip a) {# 4 Channels L,R,C,S
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.4142, 0.2929)
blr = GetChannel(a, 4, 4)
return MixAudio(lrc, blr, 1.0, 0.2929)
}
function Dmix4sDpl(clip a) { # 4 Channels L,R,C,S
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.4142, 0.2929)
sl = GetChannel(a, 4)
sr = Amplify(sl, -1.0)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 0.2929)
}
function Dmix5Stereo(clip a) { # 5 Channels L,R,C,SL,SR -> Stereo
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3694, 0.2612)
blr = GetChannel(a, 4, 5)
return MixAudio(lrc, blr, 1.0, 0.3694)
}
function Dmix5Dpl(clip a) { # 5 Channels L,R,C,SL,SR -> dpl
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3205, 0.2265)
bl = GetChannel(a, 4)
br = GetChannel(a, 5)
sl = MixAudio(bl, br, 0.2265, 0.2265)
sr = MixAudio(bl, br, -0.2265, -0.2265)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
function Dmix5Dpl2(clip a) { # 5 Channels L,R,C,SL,SR -> dpl II
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3254, 0.2301)
bl = GetChannel(a, 4)
br = GetChannel(a, 5)
sl = MixAudio(bl, br, 0.2818, 0.1627)
sr = MixAudio(bl, br, -0.1627, -0.2818)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
function Dmix6Stereo(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3694, 0.2612)
blr = GetChannel(a, 5, 6)
return MixAudio(lrc, blr, 1.0, 0.3694)
}
function Dmix6Dpl(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3205, 0.2265)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.2265, 0.2265)
sr = MixAudio(bl, br, -0.2265, -0.2265)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
function Dmix6Dpl2(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3254, 0.2301)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.2818, 0.1627)
sr = MixAudio(bl, br, -0.1627, -0.2818)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
function Dmix6StereoLfe(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3)
lfe = GetChannel(a, 4)
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
mix = MergeChannels(lfc, lfc)
lrc = MixAudio(flr, mix, 0.2929, 1.0)
blr = GetChannel(a, 5, 6)
return MixAudio(lrc, blr, 1.0, 0.2929)
}
function Dmix6StereoLfe2(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.2929, 0.2071)
lfe = GetChannel(a, 4, 4)
lrc = MixAudio(lrc, lfe, 1.0, 0.2071)
blr = GetChannel(a, 5, 6)
return MixAudio(lrc, blr, 1.0, 0.2929)
}
function Dmix6DplLfe(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.2613, 0.1847)
lfe = GetChannel(a, 4, 4)
lrc = MixAudio(lrc, lfe, 1.0, 0.1847)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.1847, 0.1847)
sr = MixAudio(bl, br, -0.1847, -0.1847)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
function Dmix6Dpl2Lfe(clip a) {
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.2646, 0.1870)
lfe = GetChannel(a, 4, 4)
lrc = MixAudio(lrc, lfe, 1.0, 0.1870)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.2291, 0.1323)
sr = MixAudio(bl, br, -0.1323, -0.2291)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}


L.E.2 considering that mediainfo.dll is free for use in other apps it is posible to add an info button to display the audio track info?
I suppose, yes.

You can try, the BeHappy code is public and free. But you can always ask to MediaInfo before open BeHappy

b66pak
1st February 2009, 22:48
thank you very much...this is very usefull...the reason for asking for it is that if you don't know about this avs scripts and try to downmix anything but 5.1 you get an error (in megui is worse because you get same number of channels as you input!!!)...also i suggest to rename "downmix to stereo" to "downmix 5.1 to stereo" or "5.1 to stereo" to avoid this confusion...
i also noticed that megui don't use anymore EnsureVBRMP3Sync() when transcoding from .mp3...is this obsolete?
_

tebasuna51
2nd February 2009, 01:16
i also noticed that megui don't use anymore EnsureVBRMP3Sync() when transcoding from .mp3...is this obsolete?

I don't know if is obsolete because there are changes in buffer sizes in last AviSynth releases.

The decoder used with BeHappy/MeGUI (NicAudio) don't need this tool, maybe with DirectShowSource, but using DirectShow we can't know the decoder used.

buzzqw
2nd February 2009, 16:35
thanks for the downmix preset tebasuna51!

update in automkv!

BHH

Chumbo
17th February 2009, 16:05
I made some changes to fix a crash that was occurring on my system and may affect others. The executable is available in this download which also includes the up to date release notes and the changed class file.

http://www.mediafire.com/?dyndymymnmo2009-02-16
+ Added stability by handling exceptions in the main form's saveConfiguration method.
+ Added checks in the same method to make sure that items added to any collections do not already exist.
+ Project solution updated to Visual Studio 2008

@tebasuna51,
I sent you an email regarding the changes and the little mess I created on codeplex, i.e., extra Change Sets that can be removed if possible. Not sure if you got it or not.

tebasuna51
20th February 2009, 12:28
@Chumbo
Restored the sources in Codeplex, but I don't know how delete the empty/bad extra Change Sets.
Could you explain your crash (OS, AviSynth version, ...)?
I always compile using .NET (compile.bat), I don't know if the change to Visual Studio 2008 can affect others.

Some minor changes added:
- Kurtnoise fix (http://forum.doom9.org/showthread.php?p=1231145#post1231145) for AvisynthWrapper.cs
- Low limit for NicAacEnc to 8 Kb/s (NeroDigitalEncoder.cs)
- SSRC SpeedUp and SlowDown methods (SSRC.extension)
- NicAc3Source internal downmix (simple DolbyProLogic) to stereo, this work with any source channels. (NicAudio.extension)

Chumbo
20th February 2009, 14:55
@Chumbo
Restored the sources in Codeplex, but I don't know how delete the empty/bad extra Change Sets.
Could you explain your crash (OS, AviSynth version, ...)?
I always compile using .NET (compile.bat), I don't know if the change to Visual Studio 2008 can affect others.

Some minor changes added:
- Kurtnoise fix (http://forum.doom9.org/showthread.php?p=1231145#post1231145) for AvisynthWrapper.cs
- Low limit for NicAacEnc to 8 Kb/s (NeroDigitalEncoder.cs)
- SSRC SpeedUp and SlowDown methods (SSRC.extension)
- NicAc3Source internal downmix (simple DolbyProLogic) to stereo, this work with any source channels. (NicAudio.extension)
I don't know that we can. I've tried everything over the last few days to get rid of the change sets that are not needed. Anyway, I hope you didn't get rid of the change in set 18494 because that one is fine.

The crash I was getting was this:
http://img16.imageshack.us/img16/2962/behappycrashti5.jpg
Which is why I put checks in the fix I added to make sure the collection items check for already existing items prior to adding because that's what's causing this exception.

This started happening after one of the builds last year but I was too lazy to check into it until now. It happened every time I closed the app which meant I lost all my state changes, e.g., the queue.

tebasuna51
20th February 2009, 16:33
<AudioSource UniqueID="58ab9132-50c8-11dc-8314-0800200c9a66"> is defined for RaWavSource in NicAudio.Extension.
Maybe you have a old RaWav.extension not needed now.
Also RaWav.dll must be deleted in AviSynth plugins, now is fully integrated in NicAudio.dll

The set 18532 is the 18494 with the 4 changes in my post.

Chumbo
20th February 2009, 19:21
<AudioSource UniqueID="58ab9132-50c8-11dc-8314-0800200c9a66"> is defined for RaWavSource in NicAudio.Extension.
Maybe you have a old RaWav.extension not needed now.
Also RaWav.dll must be deleted in AviSynth plugins, now is fully integrated in NicAudio.dll

The set 18532 is the 18494 with the 4 changes in my post.
Good to know and you're probably right. Thanks.

b66pak
21st February 2009, 19:20
@tebasuna51 thank for update but where can i find it?
_

tebasuna51
22nd February 2009, 03:05
@tebasuna51 thank for update but where can i find it?
_
There are very little changes to do a new official release.

You have the BeHappy.exe with Chumbo changes in the Chumbo post (set 18494).

The Kurnoise patch don't affect to BeHappy, the NicAudio.extension and SSRC.extension can be downloaded from CodePlex (Source Code) and put in \extensions folder.

And, if you need the low limit for NeroAAcEnc to 8 Kb/s instead 16 Kb/s, you always can download the full set 18532 and double click to 'compile.bat' to obtain the last BeHappy.exe (in \release subfolder).

b66pak
22nd February 2009, 19:21
thanks...
_

Chumbo
25th February 2009, 04:36
I've been wanting this for awhile now and had some time tonight to work on it. The test build is available here (http://www.mediafire.com/?ttzl5ghuyxy).

2009-02-24 (Chumbo)
+ Added process priority control. Available when jobs are started and
persists through all the jobs in the queue. Defaults to Idle every time
a job or set of jobs are started.

@tebasuna,
I've not checked anything in yet to codeplex. I figured I'd wait until a few have used it and I've received some feedback. I used your latest branch as the base for this to ensure all the latest changes are included.

Chumbo
28th February 2009, 03:24
Here's another update. Build is available here (http://www.mediafire.com/?mwglx0zzoeg).

2009-02-27 (Chumbo)
+ Fixed a bug. It's possible the creation of the .State file may fail due to the use of an enumerated type. I changed it to use an int since it can be cast easily and works fine.
+ Added exception handling in the SaveToFile() method so if a problem occurs we'll be made aware of it in the future.
+ (forgot this one in the linked rar) Fixed the issue where selecting the priority before the encoder actually starts (that small delay between hitting Start and, for example, aften starts) would not affect the priority.

@tebasuna,
I'll check this code base in either later today or tomorrow.

[EDIT]Source updated under change set 18658. A new release is now available as 0.2.3.38071 with the release notes and .exe.

~bT~
4th March 2009, 03:16
has the flac profile been removed from the latest version?
also, there is no longer an sse2 version of neroaacenc.exe. if i tick sse then it fails.

tebasuna51
4th March 2009, 12:37
has the flac profile been removed from the latest version?
You need the flac.extension file present in last full release (set 18532).
also, there is no longer an sse2 version of neroaacenc.exe. if i tick sse then it fails.
Now there are only a NeroAacEnc version.
Check the sse2 box only if you have the old NeroAacEnc with two versions.

ANGEL_SU
27th March 2009, 17:30
Very nice tool, but i found a small problem on its GUI. BeHappy cannot remember GUI location & size. After several restart, it is either hidden or maximized(not adjustable).
I can read a litte of the source code. It should be better to initial MainForm position at (0, 0). Also, to apply its size firstly, and next, its location. I have tested, and now it displays much normal.

cobo
30th July 2009, 06:02
I'm trying to convert 5.1 AC3 track from a PAL DVD to NTSC. I have split it into 6 16bit mono WAV files with BeLight. Is there some way to do the 25 to 23.97 conversion with BeHappy that will result in timestretched 16bit mono WAV files? I've only figured out how to get 32bit WAV files with WAV Writer which I can't play because they are unknown to DirectShow. I wan't to be able to encode back into AC3 using Sonic encoder so I can set the metadata and be sure of correct AC3 encoding.

BTW everytime I start the queue I get the message: "This application has failed to start because OptimFrog.dll was not found. Re-installing the application may fix this problem." Why is that? I've searched for the dll, but haven't been able to find it.

tebasuna51
30th July 2009, 10:36
I'm trying to convert 5.1 AC3 track from a PAL DVD to NTSC. I have split it into 6 16bit mono WAV files with BeLight. Is there some way to do the 25 to 23.97 conversion with BeHappy that will result in timestretched 16bit mono WAV files?
Of course, the last [3] DSP function checked must be 'Convert Sample To 16 bit int' (maybe Sonic can also accept 24 bit int with better resolution)

And select 'Wav Split @ Mono wav's' at [4] Destination format

BTW everytime I start the queue I get the message: "This application has failed to start because OptimFrog.dll was not found. Re-installing the application may fix this problem." Why is that? I've searched for the dll, but haven't been able to find it.

Seems your Bass package is incomplete.
You can obtain OptimFrog.dll + bass_ofr.dll (http://www.un4seen.com/filez/2/bass_ofr24.zip) from http://www.un4seen.com/
BTW, if you don't need decode OptimFROG encoded files the best solution is delete bass_ofr.dll from your ...\AviSynth 2.5\plugins folder.
To avoid overload of AviSynth plugins only put in your ...\AviSynth 2.5\plugins folder the really needed plugins

cobo
30th July 2009, 19:02
Thanks for the explanation tebasuna51. That works very well. Yes, Soft Encode does seem to accept 24bit input files.

I geuss I couldn't turn up any references to OptimFrog.dll because I was spelling it wrong when I searched.

cobo
2nd August 2009, 00:47
What bitdepth does NicAc3Source return? Does it depend on the AC3 file? What bitdepths is NicAc3Source capable of putting out?

tebasuna51
2nd August 2009, 09:34
What bitdepth does NicAc3Source return? Does it depend on the AC3 file? What bitdepths is NicAc3Source capable of putting out?

Always 32 bit float.
If you want other you need use like last DSP (because other DSP funcitions can use also 32 bit float) a 'Convert sample to ...'

cobo
2nd August 2009, 13:26
Thanks. That's what I thought I read, but when I open an .avs with VirtualDub it says 16bit, so I thought I'd double check in case I got it wrong. I want to do the least number of conversions as SoftEncode will accept 32bit float as well.

Wilbert
3rd August 2009, 18:46
If the sample type is float, when AviSynth has to output the data, it will be converted to 16 bit, since float cannot be passed as valid AVI data.

source: http://avisynth.org/mediawiki/Internal_filters

You can circumvent that by setting

global OPT_AllowFloatAudio = True

at the start of your script.

tebasuna51
3rd August 2009, 23:39
You can circumvent that by setting

global OPT_AllowFloatAudio = True

at the start of your script.

Yes the:
global OPT_AllowFloatAudio = True
is needed if you want use Bepipe or Wavi to decode an avs audio script with 32 bit float output.

If you use the SoundOut AviSynth plugin, MeGUI or BeHappy is not needed.

With MeGUI and BeHappy is because the modified AvisynthWrapper.dll

EpheMeroN
12th September 2009, 20:49
Is there like a new build of BeHappy all inclusive with all updated plugins somewhere on here? I don't wanna hunt through all 43 pages for updates and I really miss BeHappy!!!

tebasuna51
13th September 2009, 03:00
Bass lib's, encoders like NeroAacEnc and others can't be distributed with BeHappy, you need download yourself.
In BeHappy 0.2.2.30338 there are Readme files with links.

EpheMeroN
13th September 2009, 21:10
I took the "Shon3i BeHappy package (2007-03-24) with installer and many plugins" and installed it, and then replaced the main BeHappy executable with the one from CodePlex (BeHappy r18658.rar) and every time I try to run a conversion I get errors.

Can anyone help? I used to have BeHappy working, but reinstalled Windows and can't recall what I had to do.

Here's the error output:
Starting job audio.wav->audio_04cf46ab95d148d3bcf3701639dd26ee.wav
Error: System.EntryPointNotFoundException: Unable to find an entry point named 'dimzon_avs_init_2' in DLL 'AvisynthWrapper'.
at BeHappy.AviSynthClip.dimzon_avs_init_2(IntPtr& avs, String func, String arg, AVSDLLVideoInfo& vi, AviSynthColorspace& originalColorspace, AudioSampleType& originalSampleType, String cs)
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

tebasuna51
14th September 2009, 02:24
I took the "Shon3i BeHappy package (2007-03-24) with installer and many plugins" and installed it, and then replaced the main BeHappy executable with the one from CodePlex (BeHappy r18658.rar) and every time I try to run a conversion I get errors.

Can anyone help?
Of course, you can't mix the last version with a old package.
If you preserve the old BeHappy.exe the application run, but without the last two year changes.

BeHappy is a portable package and not need a install, only AviSynth, if you want preserve your installation you need download BeHappy 0.2.2.30338 (http://behappy.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14812#DownloadId=37805) and:

1) Replace AvisynthWrapper.dll, (the culprit of the error message)

2) Replace the files in extensions folder

3) Replace the files in encoder folder and search the last versions for:
aften.exe
flac.exe
lame.exe
neroAacEnc.exe
oggenc2.exe
(Maybe if you have MeGUI you can use the included in Tools subfolder)

4) Replace the dll in plugins folder to the AviSynth plugins folder, and search for bass*.dll (version 2.4) in http://www.un4seen.com/bass.html

tebasuna51
12th October 2009, 11:08
New BeHappy version

2009-10-12 (Tebasuna) v0.2.4.20767 (Change Set 28802)
+ Now encAacPlus need libmp4v2.dll (Winamp folder) instead MP4Box/MP4Mux to output .mp4/.m4a files.
+ Recover the low limit for CT encAacPlus to 8 Kb/s, available for mono audio, and the option to force MPEG4 AAC streams.
- Delete the obsolete option to select NeroAacEnc SSE.
+ Add info over Header option.

There are also a new full release:
BeHappy20091012 (http://behappy.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34300#DownloadId=87266)
with last enc_aacplus, nicaudio, bassaudio and ssrc options.

elguaxo
27th December 2009, 15:56
I've just updated BeHappy and the encoders, but I have problems with encAacPlus. I got enc_aacplus.dll and libmp4v2.dll from the latest Winamp v5.571. nscrt.dll is no longer installed with winamp, so I guess it's no longer needed?

When I try to encode something with it I get this:

Starting job audio.ac3->audio.mp4
Found Audio Stream
Channels=2, BitsPerSample=16 int, SampleRate=48000Hz
encoder\enc_aacPlus.exe - "H:\audio.mp4" --rawpcm 48000 2 16 --br 96000 --he
Writing PCM data to encoder's StdIn
Error: System.IO.IOException: The pipe has been ended.

Any hints? TIA!

tebasuna51
27th December 2009, 21:26
Yes, seems Winamp v5.57 CT libraries enc_aacPlus don't work with the encoder enc_aacPlus.exe.

I always use NeroAacEnc (with new version now) but if somebody know how work with new v5.57 please put the solution

elguaxo
27th December 2009, 21:38
I always use NeroAacEnc (with new version now)

Me too! I was just curious why enc_aacPlus wasn't working.

Thanks for the quick replay. :)

b66pak
25th January 2010, 20:11
do you plan to support the new qtaacenc CLI tool?

http://tmkk.hp.infoseek.co.jp/qtaacenc/
_

P.S. a little omission in BeHappy...if you select BassAudio the .ac3 is not listed as supported extension...
_

tebasuna51
25th January 2010, 21:08
do you plan to support the new qtaacenc CLI tool?
Only work with mono/stereo audio.
You need install QuickTime 7.6.5, then I never can test this.
You can create a file qtaacenc.extension with this:
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioEncoder Name="QT AAC Encoder" UniqueID="58cf5690-09e8-11df-8a39-0800200c9a66">
<Plugin>
<MultiOptionEncoder Type="BeHappy.Extensions.MultiOptionEncoder, BeHappy">
<Script>32==Audiobits(last)?ConvertAudioTo24bit(last):last</Script>
<ExecutableFileName>qtaacenc.exe</ExecutableFileName>
<TitleFormatString>QTaacEnc M4A @ {0}</TitleFormatString>
<SupportedFileExtension>m4a</SupportedFileExtension>
<Option>
<Name>cbr 192 kbps</Name>
<Value>--cbr 192 - "{0}"</Value>
</Option>
<Option>
<Name>abr 128 kbps</Name>
<Value>--abr 128 - "{0}"</Value>
</Option>
<Option>
<Name>cvbr 160 kbps</Name>
<Value>--cvbr 160 - "{0}"</Value>
</Option>
<Option>
<Name>tvbr 64</Name>
<Value>--tvbr 64 - "{0}"</Value>
</Option>
</MultiOptionEncoder>
</Plugin>
</AudioEncoder>
</BeHappy.Extension>
Put the encoder at BeHappy\encoder folder and test.
Of course you can put other bitrates.
If all is fine we can think a more complex GUI with sliders and other encoder options.

P.S. a little omission in BeHappy...if you select BassAudio the .ac3 is not listed as supported extension...

In my first test the ac3 bass decoder don't work fine, and the ac3 is supported well with NicAudio.
Maybe last bass versions work, test yourself.

Add the ac3 in the list is easy:
edit BassAudio.extension and add a new line
<SupportedFileExtension>ac3</SupportedFileExtension>

b66pak
27th January 2010, 21:11
ok...i have done some tests...here are the results...

the qtaacenc encoder accepts wav's up to 32float (mono or stereo ONLY)...

if found that is limited (an old apple flaw!!!) to maximum 186 minutes for a 32float@48000hz wav or 279 minutes for a 24bit@48000hz wav and 327 minutes for a 16bit@48000hz wav!!!
_

P.S. @tebasuna51 the extension work great...could you make one similar to nero's aacenc?
_

shon3i
27th January 2010, 21:50
P.S. @tebasuna51 the extension work great...could you make one similar to nero's aacenc?Why? it's alredy included in behappy without extension.

tebasuna51
28th January 2010, 00:58
the qtaacenc encoder accepts wav's up to 32float (mono or stereo ONLY)...
To test 32 bit (int/float) I supose you remove the line:
<Script>32==Audiobits(last)?ConvertAudioTo24bit(last):last</Script>
I put the limit based in the Foobar2000 integration image
if found that is limited (an old apple flaw!!!) to maximum 186 minutes for a 32float@48000hz wav or 279 minutes for a 24bit@48000hz wav and 327 minutes for a 16bit@48000hz wav!!!
Seems the encoder need a parameter like -ignorelength for NeroAacEnc or -readtoeof 1 for Aften.
If you use wav file input I hope you use RaWawSource instead WavSource (limited to 4GB).
P.S. @tebasuna51 the extension work great...could you make one similar to nero's aacenc?
NeroAacEnc is already supported.
If you want test any encoder with STDIN input you can create your own file.extension
You have some samples, remember only change the UUID, get a new one here: http://kruithof.xs4all.nl/uuid/uuidgen

b66pak
28th January 2010, 18:26
@tebasuna51 the extension work great...could you make one similar to nero's aacenc?

i was talking about qtaacenc extension you made...i was trying to make it look like nero's extension (with radio buttons, sliders, checkboxes, dropdown menus, a nice image) but i suppose is built in because i don't find it in the extensions folder...that is why i ask if you could make the qtaacenc extension look more like nero's extension...i hope i was clear...

yes, i removed the "ConvertAudioTo24bit" line...

the 4gb limit is on apple side of the encoder...i test it using the STDIN input by feeding a +8hrs .ac3 file with 16, 24, 32, 32float bits...
_

P.S. what can i do to make bepipe/wavi to output 32float from an .avs (ex: --script "NicAc3Source(^sample.ac3^)"
_

tebasuna51
29th January 2010, 10:56
The integrated GUI for qtaacenc need more work and a new BeHappy release. New item for my TODO list.

To pipe Bepipe/wavi you only need the the pipe command '|':

bepipe --script "NicAc3Source(^sample.ac3^)" | qtaacenc -parameters - "output.m4a"

wavi need a physical .avs file
wavi "sample.avs" - | qtaacenc -parameters - "output.m4a"

b66pak
29th January 2010, 18:29
what can i do to make bepipe/wavi to output 32float from an .avs?

here is what i mean:

input 16bit > output 16bit

F:\>bepipe --script "NicAc3Source(^F:\sample.ac3^).ConvertAudioTo16bit()" | Wavfix - sample.wav
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
NicAc3Source("F:\sample.ac3").ConvertAudioTo16bit()
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Writing Header...
Writing Data...
Done!



input 24bit > output 24bit

F:\>bepipe --script "NicAc3Source(^F:\sample.ac3^).ConvertAudioTo24bit()" | Wavfix - sample.wav
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
NicAc3Source("F:\3\sample.ac3").ConvertAudioTo24bit()
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=24, SampleRate=48000Hz
Writing Header...
Writing Data...
Done!



input 32bit > output 32bit

F:\>bepipe --script "NicAc3Source(^F:\sample.ac3^).ConvertAudioTo32bit()" | Wavfix - sample.wav
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
NicAc3Source("F:\3\sample.ac3").ConvertAudioTo32bit()
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=32, SampleRate=48000Hz
Writing Header...
Writing Data...
Done!



input 32float > output 16bit

F:\>bepipe --script "NicAc3Source(^F:\sample.ac3^).ConvertAudioToFloat()" | Wavfix - sample.wav
***************************************
BePipe by dimzon
***************************************
Script used:
# BEGIN
NicAc3Source("F:\sample.ac3").ConvertAudioToFloat()
# END


Scanning for Audio Stream...
Found Audio Stream
Channels=6, BitsPerSample=16, SampleRate=48000Hz
Writing Header...
Writing Data...
Done!

_

tebasuna51
30th January 2010, 16:42
Sorry I don't see the float32 requirement.
In AviSynth you need enable the float output, default is False, with:
global OPT_AllowFloatAudio=True

Then we need make a physical sample.avs with:
global OPT_AllowFloatAudio=True
NicAc3Source("F:\sample.ac3")
Here you don't need ConvertAudioToFloat() because the NicAc3Source is already 32 float.

Now you can use Bepipe with:
bepipe --script "Import(^F:\sample.avs^)" | Wavfix - sample.wav

If you use BeHappy (or MeGUI) the global OPT_AllowFloatAudio=True isn't needed because the special AvisynthWrapper.dll

b66pak
30th January 2010, 18:24
global OPT_AllowFloatAudio=True

i did not know that...thanks a lot...

another problem is with rawavsource and 32float wav/dat/raw...

here is BeHappy's generated .avs:

########################################
#Created by BeHappy v0.2.4.20767
#Creation timestamp: 1/30/2010 7:17:06 PM
########################################
#Source FileName:E:\_audio.dat
#Target FileName:E:\_audio.wav
########################################

########################################
# [Source: RaWav 48000Hz, 32float, 6ch]
########################################
RaWavSource("E:\_audio.dat", 48000, 0, 6)

########################################
# [Encoder: Wav Writer]
########################################


and the error:

Starting job _audio.dat->_audio.wav
Error: BeHappy.AviSynthException: m2RaWavSource: unsupported sample precision

it should be:

RaWavSource("E:\_audio.dat", 48000, 33, 6)
_

L.E. also .dat is not listed as valid extension for RaWavSource...
_

Cozmec
30th January 2010, 21:45
I am trying to convert an .acc file to a .ac3 and i get the following error:


Error: BeHappy.AviSynthException: unexpected character ""
σε BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
σε BeHappy.Encoder.encode()


I am using the ffmpeg ac3

tebasuna51
31st January 2010, 00:48
...
it should be:

RaWavSource("E:\_audio.dat", 48000, 33, 6)
_

L.E. also .dat is not listed as valid extension for RaWavSource...
_
You are right, please edit the NicAudio.extension file until next release.

tebasuna51
31st January 2010, 01:08
I am trying to convert an .acc file to a .ac3 and i get the following error:

Error: BeHappy.AviSynthException: unexpected character ""

I am using the ffmpeg ac3

I don't know what is the problem.
Please use the 'Export AviSynth Script' and post here the script.

b66pak
31st January 2010, 16:35
here is the edited NicAudio.extension...
_

Lincoln Burrows
3rd February 2010, 09:52
Any idea how to fix this problem?

Starting job audiofile2.wav->audiofile2best.m4a
Found Audio Stream
Channels=2, BitsPerSample=16 int, SampleRate=44100Hz
encoder\ffmpeg.exe -i - -y -acodec aac -ab 128 "C:\Documents and Settings\Core Quad 9450\Desktop\audiofile2best.m4a"
Error: System.ApplicationException: Can't start encoder: System cannot find the specified file ---> System.ComponentModel.Win32Exception: System cannot find the specified file
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()

tebasuna51
3rd February 2010, 13:24
Put ffmpeg.exe in Behappy encoder folder

Lincoln Burrows
3rd February 2010, 14:57
Where are most BeHappy encoders? Did they come in the original BeHappy package? Ffmpeg.exe is not here, that's what this message is about. If I recall correctly, I had to download lame.exe myself to work. Not sure where I can find the rest BeHappy uses.

b66pak
3rd February 2010, 18:28
from readme.txt in BeHappy "encoder" folder:

The files in this folder can be included in BeHappy folder or in a subfolder called 'encoder'.
If the subfolder 'encoder' exists, all the encoders must be inside it.

Some files are interfaces created by BeHappy team and are included here, but the rest must be obtained from the authors.
Some special versions with STDIN input are included also, when the old link don't work.
There are also Bepipe.7z with the command line Bepipe.exe and some sample.
Here are the last know url to download the encoders and the last version tested:

WavSplit.exe (Included. Author Tebasuna, to split in mono/stereo wav's instead multichannel output)

-- lossless encoders
flac.exe (free lossless FLAC encoder http://www.rarewares.org/lossless.php, v1.2.1b)
ttaenc.exe (free lossless TTA True Audio encoder, special v3.4.1 with STDIN input, included)
wavpack.exe (free lossless WV WavPack encoder http://www.rarewares.org/lossless.php, http://www.wavpack.com/ v4.60)

-- lossy multichannel encoders
neroAacEnc.exe (free AAC-MP4 encoder from Nero, http://www.nero.com/eng/technologies-aac-codec.html)
aften.exe (free AC3 encoder by Justin Ruggles, in http://code.google.com/p/wavtoac3encoder/downloads/list or http://kurtnoise.free.fr/MeGUI)
oggenc2.exe (free OGG encoder, http://www.rarewares.org/ogg-oggenc.php v2.85)

enc_aacPlus.exe (Included. Author Dimzon and BeHappy team, interface for enc_aacplus.dll)
enc_aacplus.dll (free AAC CT encoder v1.27, from full Winamp)
nscrt.dll (needed for enc_aacplus.dll, from full Winamp)
libmp4v2.dll (needed for enc_aacplus.dll mp4 output, from full Winamp)

ffmpeg.exe (many options, maybe: http://ffdshow.faireal.net/mirror/ffmpeg/, v?.?)
enc_AudX_CLI.exe (Included. Author Dimzon, interface for audxlib.dll)
audxlib.dll (free MP3 encoder with surround features, http://www.aud-x.com/)
mp3sEncoder.exe (free MP3 Fraunhofer encoder, http://www.all4mp3.com/tools/sw_fhg_cl.html)

-- lossy only stereo encoders
lame.exe (free MP3 encoder http://www.rarewares.org/mp3-lame-bundle.php, v3.98)
twolame.exe (free MP2 encoder, version from rarewares don't work, included v0.3.10b)
mppenc.exe (free MPC MusePack encoder, http://www.musepack.net, v1.16)

Notes:
------
The GUI's to capture the encoder parameters are implemented in the main BeHappy.exe or in *.extensions files in the 'extensions' subfolder.
The *.extensions files can be edited with Notepad or similar to change a not supported option.
To change parameters to GUI encoder included in BeHappy.exe you need change the sources *.cs and compile.

The files in 'extensions' subfolder can also be placed at BeHappy folder.
The *.extension files can implement also DSP functions (ConvertSample, DownMix, DuplicateChannels, SSRC and UpMix), and AviSynth decoders (BassAudio.extension).

The mppenc v1.16 (SV7) was deprecated and the new MusePack encoder SV8 is named mpcenc.exe (actually v1.30) if you want use it you need edit MusePack.extension file.

_

b66pak
9th February 2010, 18:29
new version for qtaacenc (qtaacenc-20100210):

http://tmkk.hp.infoseek.co.jp/qtaacenc/

2010/2/10

* Added --ignorelength option
* This option lets qtaacenc ignore the size of data chunk of the input wave stream when encoding from pipe. This will be useful when you want to pass a huge (>4GB) wave stream using pipe. Note that if the data chunk size is set to zero, qtaacenc reads the stream until EOF without this option. Write max bitrate info and encoding parameter metadata (iTunes compatible)

_

Chumbo
8th August 2010, 16:52
@tebasuna51,
Have you had a chance to merge my changes per changeset 18658? They're still not in the latest and I'm no longer on the developers list so I can't access TFS.

tebasuna51
21st August 2010, 02:40
@tebasuna51,
Have you had a chance to merge my changes per changeset 18658? They're still not in the latest and I'm no longer on the developers list so I can't access TFS.
Added your changes in 18658 (deleted in 19601) to new Change Set 49787.

Chumbo
21st August 2010, 03:37
Added your changes in 18658 (deleted in 19601) to new Change Set 49787.
Great, thank you.

NoX1911
28th August 2010, 06:14
Anyone tested with NET Framework 4.0? It just crashes here on win7.

tebasuna51
28th August 2010, 09:55
No, I use NET 2.0, XP SP3 32 bits.
What version of AviSynth do you have installed?
Just crashes on open or when you make some job?

NoX1911
28th August 2010, 16:17
Wtf... it works now. Don't know what was wrong. Error was something with '2.0 CLR'. Error message came immediately after doublelclicking the exe.

Max_Cady
20th October 2010, 21:58
how to encode DTS-HD to DTS with this application? i dont see any option for DTS encoding.

tebasuna51
21st October 2010, 00:04
Because doesn't exist any free DTS encoder.

And there are better alternatives, AC3 is more efficient and more compatible, and AAC is even more efficient (but less compatible).
With less bitrate you can obtain the same quality than DTS.

BTW, you needn't encode DTS-HD to DTS, is enough extract the 'core' with eac3to, for instance:
eac3to input.dtshd output.dts -core

Chumbo
21st October 2010, 01:38
To add to what tebasuna51 already said, you can also use tsmuxer which can remux a dts-hd track to the core dts track.

DVDBob
31st October 2010, 19:02
I have some audio files from DVDs, and i want to use them to some MKV files from blurays.

So can i use this software to only TimeStretch 25 > 23,976???

tebasuna51
31st October 2010, 20:57
Yes, there are two methods:
- with SSRC (same than use eac3to), change the pitch. More accurate.
- with TimeStretch, if you use Tempo the pitch is preserved.

DVDBob
31st October 2010, 21:09
I just tried hour stretch but it reports errors immediately I press start.

I do not know whether it is best to use AviSynth, DirectShow source or NicAc3Source.

tebasuna51
31st October 2010, 23:50
NicAc3Source.
You need NicAudio.dll in your Avisynth plugin folder and Aften.exe in BeHappy Encoder subfolder.

DVDBob
1st November 2010, 00:16
Thanks it works now.

TDiTP_
17th December 2010, 15:01
One question

Why BeHappy's DPLII downmix matrix:
Lt = L + 0.7071 C + 0.7071 LFE + 0.866 BL + 0.5 BR
Rt = R + 0.7071 C + 0.7071 LFE - 0.5 BL - 0.866 BR

when at the same time here (http://forum.doom9.org/showthread.php?t=57988):
Lt = L + 0.7071 C + 0.7071 LFE - 0.866 BL - 0.5 BR
Rt = R + 0.7071 C + 0.7071 LFE + 0.5 BL + 0.866 BR

(azid and AC3Filter use such matrix: "-" surround with Lt and "+" surround with Rt)

tebasuna51
17th December 2010, 19:38
One question

Why BeHappy's DPLII downmix matrix:
...
Basically because I found than using (simplified coefficients):
M1 (like BeSweet/Azid)
LT = L + 0.7 C - 0.8 BL - 0.5 BR
RT = R + 0.7 C + 0.5 BL + 0.8 BR

M3 (with inverted signs for back channels)
LT = L + 0.7 C + 0.8 BL + 0.5 BR
RT = R + 0.7 C - 0.5 BL - 0.8 BR
I get, using DPL II upmix with Cyberlink PowerDVD 6, Audio Effect dsf (software decode, also tested with my hardware decoder)
M1 decoded in Movie mode
L' = 0.7 L
R' = 0.7 R
C' = 0.6 C
SL' = - 0.7 SL
SR' = - 0.7 SR

M3 decoded in Movie mode
L' = 0.7 L
R' = 0.7 R
C' = 0.6 C
SL' = 0.7 SL
SR' = 0.7 SR
Reference threads:
http://forum.doom9.org/showthread.php?t=111603
http://forum.doom9.org/showthread.php?t=112122

Then seems the original matrix mix produce inverted surround channels (difficult to listen the difference).

TDiTP_
20th December 2010, 08:29
tebasuna51
Thanks

What matrix do you recommend to use when downmix 7.1 and 6.1 -> 5.1 ? And what script i must use in BeHappy?

eac3to mix surround like:
Sur = 1.0 x Back + 0.7 x Side
and I can't understand why such coefficients.

if not difficult, I would want to know the theoretical explanation :)

---------------------
Upd. May be like this (http://forum.doom9.org/showthread.php?p=1144930#post1144930).

7.1/7.0:
B = 0,395 x Su -> Su1 = 2,53 x B
S = 0,742 x Su -> Su2 = 1,35 x S
=> Su = Su1 + Su2 = 2,53 x B + 1,35 x S
but we must normalize to the max signal, i.e. "B", then:
Su = B + 0,53 x S
sqrt:
Su = B + 0,73 x S

6.1/6.0:
BC is in 0,5 in left and 0,5 in right speaker
if we 6.1->5.1 we need add BC in Su: Su' = Su + 0,5 x BC
sqrt:
Su' = Su + 0,707 x BC

The right solution?
Remembering angle accuracy it may be close with what eac3to do - link (http://www.hydrogenaudio.org/forums/index.php?showtopic=59068).

tebasuna51
20th December 2010, 16:17
What matrix do you recommend to use when downmix 7.1 and 6.1 -> 5.1 ? And what script i must use in BeHappy?...
To avoid overflow, first convert to float, mix, Normalize and convert to desired output.
# Downmix 7.1 to 5.1
RaWavSource("341.wav") # or 341.w64
a = ConvertAudiotofloat()
fl = Getchannel(a,1)
fr = Getchannel(a,2)
fc = Getchannel(a,3)
lf = Getchannel(a,4)
bl = Getchannel(a,5)
br = Getchannel(a,6)
sl = Getchannel(a,7)
sr = Getchannel(a,8)
sul = Mixaudio(sl, bl, 1.0, 1.0)
sur = Mixaudio(sr, br, 1.0, 1.0)
Mergechannels(fl, fr, fc, lf, sul, sur)
Normalize()
#ConvertaudiotoX() # not needed to encode to ac3/aac
With:
sul = sl + bl
sur = sr + br
We preserve the acustic power relation between all channels. Don't mistake upmix (we need divide a channel in two, angle related) with downmix (we add channels and both must have the same contribution)

For 6.1
# Downmix 6.1 to 5.1
RaWavSource("331.wav") # or 331.w64, with channelmask like eac3to output, else alternate sintax
a = ConvertAudiotofloat()
fl = Getchannel(a,1)
fr = Getchannel(a,2)
fc = Getchannel(a,3)
lf = Getchannel(a,4)
bc = Getchannel(a,5) # bl = Getchannel(a,5)
sl = Getchannel(a,6) # br = Getchannel(a,6)
sr = Getchannel(a,7) # bc = Getchannel(a,7)
sul = Mixaudio(sl, bc, 1.0, 0.707) # Mixaudio(bl, bc, 1.0, 0.707)
sur = Mixaudio(sr, bc, 1.0, 0.707) # Mixaudio(br, bc, 1.0, 0.707)
Mergechannels(fl, fr, fc, lf, sul, sur)
Normalize()
#ConvertaudiotoX() # not needed to encode to ac3/aac
With:
sul = sl + 0.707xbc
sur = sr + 0.707xbc
Here the acustic power of bc must be divided in two channel. Like acustic power is proportional to bc^2:
bc^2 = ( 0.707xbc)^2 + (0.707xbc)^2

TDiTP_
20th December 2010, 16:32
we add channels and both must have the same contribution
=> eac3to's downmix 7.1->5.1 isn't correct?

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?

tebasuna51
18th July 2011, 02:28
If you have problems with the loundness then your player can't recover the 5 channels with a DPL II decoder.
And the stereo mix can be more loud than DPL II mix.

flapane
18th July 2011, 16:26
I tried to enable the Dolby Decoder check in ffdshow-Audio (playing back an ac3 downmixed with DPL II), but it didn't change anything.

tebasuna51
18th July 2011, 21:51
Please explain your test.
How output the audio from PC?
spdif, hdmi, 6 analogic output?

BlueCup
26th July 2011, 06:30
I've placed NicAudioSource.dll in my AVISynth 2.5 plugin DIR but I am still receiving an error.

Starting job track2.dts->track2.ac3
Error: BeHappy.AviSynthException: Script error: there is no function named "NicDtsSource"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

Does anyone have any ideas?

tebasuna51
26th July 2011, 09:55
Check the registry to see if your plugin DIR is correct, for instance for me:

[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
@="C:\\Archivos de programa\\AviSynth 2.5"
"plugindir2_5"="C:\\Archivos de programa\\AviSynth 2.5\\plugins"

BlueCup
29th July 2011, 07:09
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
@="c:\\program files (x86)\\avisynth 2.5"
"plugindir2_5"="c:\\program files (x86)\\avisynth 2.5\\plugins"

I added that to my registry and BeHappy is still giving me the same error.

EDIT: Added the @ line, same thing.

Iron Yuppie
8th August 2011, 07:19
Is there are way to retain audio pitch when converting an ntsc audio source to a pal one? Pardon my ignorance if there is an obvious answer, I can only find information on retaining the pitch for pal to ntsc conversions is all.

tebasuna51
8th August 2011, 10:42
Try with TimeStretch Tempo mode, works fine with stereo, with 5.1 maybe can obtain a litlle asinc between channels.

Iron Yuppie
8th August 2011, 10:58
It's only a 2.0 Stereo file, a commentary track that I've ripped off an old laserdisk on mine that isn't on the dvd version of the film. Annoyingly the DVD is PAL and the commentary is NTSC, so when I did a regular speedup poor Cronenberg sounded like he hadn't hit puberty yet.
So TimeStretch Tempo should work fine then. Thanks for the response, I'll give it a try and report back.

Iron Yuppie
9th August 2011, 09:05
Everything worked without a hitch, thank you so much for the help.

BlueCup
9th August 2011, 19:34
Check the registry to see if your plugin DIR is correct, for instance for me:

[HKEY_LOCAL_MACHINE\SOFTWARE\AviSynth]
@="C:\\Archivos de programa\\AviSynth 2.5"
"plugindir2_5"="C:\\Archivos de programa\\AviSynth 2.5\\plugins"

I'm running Windows 7 64bit, would that have anything to do it this not working?

tebasuna51
9th August 2011, 23:04
You must install AviSynth properly (I don't use W7), not put the values into the Registry manually.

BlueCup
11th August 2011, 17:43
How does one not install AVISynth properly? The values were not there after installing so I added them.

Is anyone running Win7 64bit and have BeHappy running NicAudio plugins just fine?

Xplorer4x4
25th September 2011, 22:42
Just wanted to sya thank you to all those who contribute to this project! I hope you keep up the good work!

tebasuna51
26th September 2011, 10:43
You are welcome.

flapane
15th October 2011, 21:02
Trying to convert 768kbps dts to 192kbps 2.0 ac3
The problem is that Media Info tells that it's a 5 channel dts file, but actually it's a stereo file (if I open it in Audacity, I have L, R and three empty channels)


Format : DTS
Format/Info : Digital Theater Systems
File size : 540 MiB
Duration : 1h 40mn
Overall bit rate : 755 Kbps

Audio
Format : DTS
Format/Info : Digital Theater Systems
Duration : 1h 40mn
Bit rate mode : Constant
Bit rate : 755 Kbps
Channel(s) : 5 channels
Channel positions : Front: L C R, Side: L R
Sampling rate : 48.0 KHz
Bit depth : 24 bits
Compression mode : Lossy
Stream size : 540 MiB (100%)


Any way to tell BeHappy that this is a 2.0 file and not a 5 channel one?


edit: I deleted the "ghost" tracks in Audacity and saved it as a 2.0 wav, then I converted it to ac3.

tebasuna51
16th October 2011, 00:37
The workaround with BeHappy is create a .avs file with:

NicDtsSource("your_file.dts")
GetChannel(1, 2)

and load the .avs file instead the .dts.

flapane
16th October 2011, 10:03
Thanks a lot!

Richard1485
17th October 2011, 21:53
Is there are a way to downmix multichannel audio to stereo and in the process discard the centre channel?

tebasuna51
18th October 2011, 02:31
For instance:

a = NicDtsSource("your_file.dts")
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
left = MixAudio(fl, bl, 0.5, 0.5)
right = MixAudio(fr, br, 0.5, 0.5)
MergeChannels(left, right)

Richard1485
18th October 2011, 21:47
Thanks, tebasuna! How do I use this script with Behappy?

EDIT: Okay, the .avs input option does work. It seemed to freeze, but it's just very slow. Thanks again!

Richard1485
29th October 2011, 19:13
Is it possible to downmix audio using other combinations of channels too? For example, downmix front left, center and front right to the right channel, and left surround and right surround to the left channel, and then merge them to make stereo. (I know it sounds strange, but I have a reason for doing this sort of thing.) GetChannel() seems to work for any channel in a mix, but I notice that MixAudio() only works with two channels.

Moreover, I understand from the recent discussion that the procedure for downmixing is decode, downmix, normalize, amplify. Is amplifying the same as turning up the volume slider in a NLE? I'm experiencing low volume too.

Thanks for any help.

tebasuna51
30th October 2011, 03:47
Strange but possible:

a = NicDtsSource("your_file.dts")
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
fc = GetChannel(a, 3)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
lef = MixAudio(fl, fc, 0.3333, 0.3333)
left = MixAudio(lef, fr, 1.0, 0.3333)
right = MixAudio(bl, br, 0.5, 0.5)
MergeChannels(left, right)


After Normalize you can't Amplify, Normalize gives you the max allowed volume.

Richard1485
31st October 2011, 21:36
Thanks, tebasuna. I changed the penultimate line to

right = MixAudio(bl, br, 0.5, 0.5)

but it seemed to work fine. Thanks for this!

After Normalize you can't Amplify, Normalize gives you the max allowed volume.

I don't understand this because in the previous discussion about stereo downmixing I see this workflow:

1) Decode with DRC
2) Downmix to stéreo
3) Normalize
4) Amplify at your choice


I don't understand how the two situations are different.

If you cannot increase the volume after normalization, then if you have two files of different volume in an NLE, you have to lower the volume of the louder one to make them match, and not the other way round. Is this correct?

tebasuna51
1st November 2011, 03:29
Thanks, tebasuna. I changed the penultimate line to

right = MixAudio(bl, br, 0.5, 0.5)
Sorry, you are right, is a typo.

but it seemed to work fine. Thanks for this!



I don't understand this because in the previous discussion about stereo downmixing I see this workflow:
...
4) Amplify at your choice
Maybe is:
"4) Amplify at your risk"

Because I say also:
"if you Amplify after Normalize always cut the max peaks. "

If you cannot increase the volume after normalization, then if you have two files of different volume in an NLE, you have to lower the volume of the louder one to make them match, and not the other way round. Is this correct?
The peak volume of a normalized audio (1) can't be less than other audio (2).
But the RMS volume yes. Seems you have two audios with different Dynamic Range. Yes lower the (2) is the best option.

Xplorer4x4
4th November 2011, 23:53
Is BeHappy capable of demuxxing the AC3 audio out of a video file with out reencoding or will I have to result to another tool for that? Currently I use AviDemux for extracting the audio, but it would be nice to eliminate the need for AviDemux.

tebasuna51
5th November 2011, 02:48
Nope, BeHappy is a GUI for AviSynth, inside AviSynth the audio is always decoded.

Xplorer4x4
5th November 2011, 02:50
Ok I was afraid of that. Shame there is nothing like mkvextract for avi to speed up this process. Thanks for the answer tebasuna51.

Richard1485
7th November 2011, 18:39
Yes lower the (2) is the best option.

Belated thanks for your reply, Tebasuna. :)

XMEN3
7th December 2011, 23:19
I've placed NicAudioSource.dll in my AVISynth 2.5 plugin DIR but I am still receiving an error.

Starting job track2.dts->track2.ac3
Error: BeHappy.AviSynthException: Script error: there is no function named "NicDtsSource"
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()

Does anyone have any ideas?
there's still this error and never been fixed...
When running on x64 i must use script with lines:
LoadPlugin("C:\Program Files (x86)\MeGUI-x86\tools\avisynth_plugin\NicAudio.dll")
NicDtsSource("audio.dts")
return last
Megui they solved this time ago and add itself the missing lines...
behappy does not add any line and avisynth does not load automatically plugins on x64

Anyway avisynth 2.6.0 alpha3 solved the autoloadplugin problem.
And i can now transcode loading files directly.

Xplorer4x4
2nd January 2012, 05:22
The download link/site(workspace.com) in the op is down and has been down for a few days. Can we get a mirror?

tebasuna51
2nd January 2012, 11:43
The download link/site(workspace.com) in the op is down and has been down for a few days. Can we get a mirror?
Please read the second post or follow my signature.

Reino
30th January 2012, 22:39
A couple of months ago I made a bugreport for foo_input_avs (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=42705&view=findpost&p=771962) (Foobar Avisynth input plugin), but I now just realized dimzon (who I assume is the author) has been banned over there.
I hope you allow me to post the bugreport here.

Bug report:

I've done some more testing with BassAudioSource() in combination with foo_input_avs and I'd like to revise my quoted statements. It seems foo_input_avs has some more shortcomings...

- When you've copied BeHappy's entire plugins directory (BassAudio.dll, bass.dll and bass_xxx.dll) to your Avisynth's plugins directory, foo_input_avs (and Foobar) will crash immediately upon playing anything through Avisynth! It will also even crash when trying to play an audio file with WavSource() or NicAc3Source() through Avisynth. Simply the presence of BassAudio.dll and bass.dll in Avisynth's plugins directory will crash Foobar upon playing anything through Avisynth. It seems foo_input_avs doesn't like non-Avisynth libraries (bass.dll and bass_xxx.dll) in Avisynth's plugins directory.

- foo_input_avs having its way, we can of course load BassAudio.dll from elsewhere: Loadplugin("X:\BeHappy 0.2.5.30809\plugins\BassAudio.dll"). This will let BassAudio.dll load bass.dll (WAV/AIFF/MP3/MP2/MP1/OGG)1 but somehow NONE of the other bass_xxx.dlls (AAC/M4A/WMA/FLAC/WV/APE/etc)! Dragging an avs-file with BassAudioSource("Sample.flac") into Foobar won't even load.
1 bass.dll also supports Tracker Audio (MOD/IT/XM/etc), but not through Avisynth. I guess Avisynth is limited to sample audio.

All of this happens because of foo_input_avs. Converting an audio file through Avisynth (no matter the ...Source()) with BeHappy works just fine. Playing the avs-file with Media Player Classic works fine too.

So to sum up...
If you want to convert audio files through Avisynth with Foobar, DON'T copy the content of BeHappy's plugins directory to Avisynth's plugin directory! Use Loadplugin("X:\BeHappy 0.2.5.30809\plugins\BassAudio.dll") instead. But even then, you have to settle for WAV/AIFF/MP3/MP2/MP1/OGG support only as far as BassAudio is concerned. Want to convert from FLAC for instance through Avisynth, use BeHappy.

tebasuna51
31st January 2012, 13:21
Sorry but I can't reproduce your problem.

Working with XP SP3, Foobar2000 1.1, foo_input_avs 0.2 or 0.3, BassAudio.dll + Bass.dll + Bass_*.dll in AviSynth plugins folder or loaded from other folder, always work fine playing FLAC with BassAudioSource("x:\path\sample.flac")

Maybe with other OS, or in countries than need Unicode support to read filenames, the old BassAudio.dll method to load bass_*.dll don't work with foo_input_avs.

I can't test anything here.
I only can supply the BassAudio.dll source if you want modify something:

Reino
31st January 2012, 17:31
Remarkable! I'm using WinXP SP3 (english) and foobar 1.1 too, but the situation is still the same over here. Updating foobar to 1.1.10 didn't help either. I've done some testing again this afternoon and...

- Loading everything the Bass supports (including ALAC for example, of which there's initially no additional bass-plugin in the BeHappy plugins directory) with BassAudioSource() and feeding the avs-file to MPC-HC works flawlessly IN ALL CASES. Not even Loadplugin("BassAudio.dll") is needed.

- But then foobar. I emptied my Avisynth plugins directory and copied BassAudio.dll, bass.dll and every bass_*.dll from the BeHappy plugins directory. No fatal memory crashes upon playing an avs-file, but they returned the moment I put back all my other Avisynth plugins.

I've also manually collected updated versions of bass.dll and every bass_*.dll and put them in the Avisynth plugins directory, again emptied beforehand. To my surprise this worked as well, but, updated versions or not, it only worked for bass.dll. None of the additional plugins ever worked in foobar. And of course when I put the Avisynth plugins back, the memory crashes were back as well.
However, when I load BassAudio.dll (again along with updated versions of bass.dll and bass_*.dll) straight from the BeHappy plugins directory and I drag an avs-file into foobar it crashes immediately! Application Error. The instruction at "0x084107f1" referenced memory at "0x084107f1". The memory could not be "read". (hexadecimal numbers are different every time)

Luckily loading BassAudio.dll straight from the BeHappy 0.2.5.30809 plugins directory (bass.dll etc. untouched) does work, but only for bass.dll (WAV/AIFF/MP3/MP2/MP1/OGG). When I drag an avs-file, pointing to a FLAC or WV file through BassAudioSource(), to foobar's playlist nothing happens, nothing is loaded. This happens and happened in all scenarios.

I now realize I've already told all this in the bugreport, but oh well :P.
I just can't figure it out. Thx for the source files, but too bad I don't have such programming qualities.
The fact that I'm using a portable foobar install doesn't have anything to do with it I hope?

tebasuna51
1st February 2012, 18:29
...
The fact that I'm using a portable foobar install doesn't have anything to do with it I hope?

I'm using a portable foobar install too.

I forget to say: XP 32 bits, AviSynth 2.5.8 (no MT)

Reino
1st February 2012, 18:39
Then I guess I have to accept my Windows installation is f*cked, or my physical RAM is beginning to fail.

Reino
2nd February 2012, 21:32
tebasuna51, although it's officially not listed on the un4seen website, could you please have a look if you can get bass_tak.dll (http://www10.plala.or.jp/nig/monooki/bass_tak_2.4.zip) (via http://blog.livedoor.jp/nig_luce/archives/51303211.html) to work with BassAudio? Most likely tak_deco_lib.dll (http://thbeck.de/Download/TAK_2.2.0.zip) is needed too.
And if it's not too much of a hassle, support for bass_ofr (http://www.un4seen.com/download.php?z/2/bass_ofr24) would be cool too. OptimFROG.dll (http://www.losslessaudio.org/Downloads/OptimFROG_All_Windows_x86_4910b.zip) would be needed too.

tebasuna51
2nd February 2012, 23:36
Support new bass_*.dll libraries is easy, only edit "BasAudio.extension" file and add new lines like:
<SupportedFileExtension>EXT</SupportedFileExtension>

Long time ago I test OptimFROG without problems.
Each user can add/delete libraries to have only the needed ones and avoid load unnecesaries dll's

Reino
3rd February 2012, 01:01
The "BasAudio.extension" file is for BeHappy. I'm talking about BassAudio only.
At first I also thought all bass_*.dll could be called forth through BassAudioSource() without having to change BassAudio, and I can confirm...everyone of 'em works (flac,wv,ape,tta, heck even cd's; BassAudioSource("E:\Track01.cda")), but just not ofr and tak.
Now, if bass_tak.dll is buggy, that could be a reason why it's not listed on the un4seen website and use of it is discouraged, but I just can't open OptimFROG files with BassAudio either! That's why I asked you to have a look.
I can give you two samples I made myself:
- http://www.degeelebosch.nl/reino/Across the River_sample(2ch).ofr
- http://www.degeelebosch.nl/reino/Across the River_sample(2ch).tak
Confirmed to play perfectly through DirectShow with DC-Bass Source Filter (http://dsp-worx.de/?n=15) (also uses OptimFROG.dll) and TAK DirectShow Source Filter (http://www.liviocavallo.altervista.org/) (also uses tak_deco_lib.dll).

tebasuna51
4th February 2012, 18:51
First I updated all dll's to last version in www.un4seen.com (bass.dll 2.4.8, ...).

After some test I see there are two times than OptimFROG.dll/tak_deco_lib.dll was needed:

- When BassAudio.dll load bass_ofr.dll/bass_tak24.dll a error message is sended if don't found OptimFROG.dll/tak_deco_lib.dll in same folder than bass_* or in env path (ie: c:\windows\system32). But the proccess can continue and ...

- At decoder time the proccess abort if don't found OptimFROG.dll/tak_deco_lib.dll in same folder than input file or in env path (ie: c:\windows\system32)

Then don't work with OptimFROG.dll/tak_deco_lib.dll only in plugins folder but work for me with OptimFROG.dll/tak_deco_lib.dll in c:\windows\system32
Tested with BeHappy and Wavi with:

wavi Test.avs Test.wav

and Test.avs:
#global OPT_AllowFloatAudio=True # Needed if you want 32 bits float output
#LoadPlugin("D:\bass24\BassAudio.dll") # Needed if don't exist dll's in AviSynth plugins folder
#bassAudioSource("D:\bass24\Samples\Across the River_sample(2ch).ofr") # Or
bassAudioSource("D:\bass24\Samples\Across the River_sample(2ch).tak")

Reino
4th February 2012, 21:29
So you're saying, having OptimFROG.dll and tak_deco_lib.dll in the same directory as bass.dll and bass_*.dll should be enough to you let play ofr- and tak-files through BassAudio? I've had these 2 library files in the BeHappy plugins directory right from the start, but no ofr- or tak-file would open. Luckily having copied them to the system32 dir has finally proven successful, so :thanks: a lot for that!

BUT, although I don't have the programming skills...it looks like in this part of bassAudio.cpp the only place to look for additional libraries is the Windows\System32 directory, isn't it?
// load plugins
{ // look for plugins (in the executable's directory)
WIN32_FIND_DATA fd;
HANDLE fh;
*fp = NULL;
strcat(fp,"bass_*.dll");
fh=FindFirstFile(fileName,&fd);
if (fh!=INVALID_HANDLE_VALUE)

tebasuna51
5th February 2012, 01:00
So you're saying, having OptimFROG.dll and tak_deco_lib.dll in the same directory as bass.dll and bass_*.dll should be enough to you let play ofr- and tak-files through BassAudio? I've had these 2 library files in the BeHappy plugins directory right from the start, but no ofr- or tak-file would open.
No, I say:
"don't work with OptimFROG.dll/tak_deco_lib.dll only in plugins folder"

"but work for me with OptimFROG.dll/tak_deco_lib.dll in c:\windows\system32"

BUT, although I don't have the programming skills...it looks like in this part of bassAudio.cpp the only place to look for additional libraries is the Windows\System32 directory, isn't it?
BassAudio load only bass_*.dll, but external dll's OptimFROG.dll/tak_deco_lib.dll are loaded by bass_ofr.dll/bass_tak24.dll, and I don't know how change this.

Reino
8th February 2012, 18:46
In the meantime I haven't been sitting still:
http://www.un4seen.com/forum/?topic=13442.0

tebasuna51, when you read Ian's post from today in the link above, do you think it's possible for BassAudio to assign the plugins directory to function as a sort of working directory?

tebasuna51
9th February 2012, 01:56
... do you think it's possible for BassAudio to assign the plugins directory to function as a sort of working directory?
Nope.

BassAudio.dll load bass.dll and all bass_*.dll in BassAudio.dll directory.
At this moment bass_ofr/tak seems check (but not load) if exist the external dll's in the same directory or in DLL search path, if not exist send a error message.

At the moment of decoder process AviSynth set the working directory to the directory of the .avs file, but seems read also the directory of the sample to decode. Now if the needed external dll exist in the sample directory, or the .avs directory, or in DLL search path, AviSynth load the dll and decode the sample without problems.

I thing the correct way is use the AviSynth LoadDll function, the other option is put the dll's in the DLL search path (in windows\system32 or adding your "plugins" directory to the PATH environment variable)

Reino
9th February 2012, 11:50
...or adding your "plugins" directory to the PATH environment variable)You mean the GetSystemEnv plugin from Stickboy (http://avisynth.org/stickboy/)?
SetWorkingDir("D:\BeHappy 0.2.5.30809\plugins(updated)\")
Loadplugin("BassAudio.dll")

#BassAudioSource("D:\TEST files\Audio\Across the River_sample(2ch).wv")
#BassAudioSource("D:\TEST files\Audio\Across the River_sample(2ch).ofr")
BassAudioSource("D:\TEST files\Audio\Across the River_sample(2ch).tak")
This doesn't work for me:
LoadPlugin: unable to load "BassAudio.dll", error=0x7e

tebasuna51
9th February 2012, 15:00
No.

I say modify the PATH environment variable, adding your "plugins" directory.

I put the procedure in spanish because I don't now the exact literals in english:
Rightclick over 'Mi PC' -> 'Propiedades' -> Tab 'Opciones Avanzadas' -> 'Variables de entorno' -> 'Variables del Sistema' -> Path -> Modify -> and add at the end ";D:\BeHappy 0.2.5.30809\plugins(updated)"

Reino
9th February 2012, 17:58
Oooh, this one you mean:
https://upload.wikimedia.org/wikipedia/en/b/be/Environment_Variables.png

Long time ago since I last had to use that one, but yeah, when I add the plugins directory, I can indeed open OptimFROG and TAK files. BUT imo this is yet another method, just like LoadDll, which shouldn't be necessary in the first place. Every time the path to the plugins directory changes you have to either change the LoadDll entry in the Avisynth script, or change the system variable.
Seeing BassAudio can't change this, I guess the only option left is changing bass_ofr.dll and bass_tak.dll.
Thanks so far tebasuna51.

Reino
10th February 2012, 18:50
Ian @ un4seen: I think it would be far simpler/better to make a small modification to the BassAudio.DLL, to have it set the current directory before loading the BASS add-ons, something like this...
char dir[MAX_PATH];
GetCurrentDirectory(sizeof(dir), dir); // get current directory
SetCurrentDirectory(...); // set current directory to the plugins directory
// load BASS add-ons via BASS_PluginLoad here
SetCurrentDirectory(dir); // restore current directoryCould this be of any help, tebasuna51?

I was just thinking; To open ofr- and tak-files with BeHappy, you would first have to add...

<SupportedFileExtension>ofr</SupportedFileExtension>
<SupportedFileExtension>tak</SupportedFileExtension>

...to BassAudio.extension, but because BeHappy doesn't allow you to edit the Avisynth script it creates in the background (to add LoadDll("tak_deco_lib.dll") for instance), you're left with, either putting the secondary DLLs (as Ian calls them) in the app's- or system32-directory, or add the path of the plugins directory in the environment variable. Not really practical.
In my opinion it would really help if BassAudio.dll would automatically load a secundary dll if a bass_*.dll needs it, especially for BeHappy users!

Gavino
10th February 2012, 19:36
Could this be of any help, tebasuna51?
tebasuna has already explained in post #995 why this will not work:
Nope.

BassAudio.dll load bass.dll and all bass_*.dll in BassAudio.dll directory.
At this moment bass_ofr/tak seems check (but not load) if exist the external dll's in the same directory or in DLL search path, if not exist send a error message.

At the moment of decoder process AviSynth set the working directory to the directory of the sample to decode. Now if the needed external dll exist in the sample directory, or in DLL search path, AviSynth load the dll and decode the sample without problems.
However, I'm not sure what you (tebasuna) mean by "AviSynth set the working directory to the directory of the sample to decode". The working directory will be the one containing the script, not the audio file.