PDA

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


Pages : 1 [2] 3 4 5

dimzon
18th May 2006, 17: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, 18:31
Fresh ffmpeg.extension is avaluable @ BeHappy Workspace

stax76
18th May 2006, 19: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, 19: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, 09:17
New version is out

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

Daodan
19th May 2006, 17: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, 20:51
Am I correct that posts 1 and 4 are the only current "reference" posts?

shon3i
19th May 2006, 23: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, 08:11
thanks shon3i !

BHH

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

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

dimzon
21st May 2006, 23: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, 09:59
OK, thanks you.

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

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

dimzon
22nd May 2006, 18: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, 20: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, 20: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, 21: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, 22: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, 01:28
fresh beta is out.
including UpMix extension ;)

tebasuna51
23rd May 2006, 02: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, 02: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, 08: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, 08: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, 09: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, 09:56
Oggenc2.83 using aoTuVb4.51 2006-04-26 from rarewares need the getchannel.
fixed

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

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

tebasuna51
23rd May 2006, 19: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, 20: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, 22:28
first post modified - now it contains some usefull info and installation manual ;)
still need user manual

buzzqw
23rd May 2006, 22: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, 23: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, 09: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, 13:07
tested with latest behappy

same error

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

BHH

Eric B
25th May 2006, 16: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, 16: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, 17:25
@Eric B download this (http://forum.doom9.org/showpost.php?p=829754&postcount=259) and enjoy

Avish
27th May 2006, 09: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, 13: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, 14: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, 16:55
Try to select instead Nic123Source, DirectShowSource and Vice Versa

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

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

Avish
27th May 2006, 17: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, 19:34
No everything is fine because that is HE-AAC, but when playing decoder upsample to 44Khz

tebasuna51
29th May 2006, 03: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, 10: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, 22: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, 19:39
for ac3 to aac conversion, how to increase volume of output file in behappy?

tebasuna51
1st June 2006, 21: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, 13:49
my behappy only says source as nicac3, not as nicac3drc, where to get it?

dimzon
2nd June 2006, 14: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, 18: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, 21: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, 21: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, 22:05
even when encoding ac3 6 channel or dts to 2-channel aac, should i use downmix to dpl2 ?

tebasuna51
11th June 2006, 00: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, 07: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, 11: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, 12:41
Is not the same. First downmix and after normalize.
Maybe this should be default in the GUI then?

tebasuna51
17th June 2006, 03: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, 20: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, 21: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, 17: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, 20: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
23rd June 2006, 00: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, 16: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, 23:54
Congratulation dimzon, realy great work.

thuongshoo
3rd July 2006, 11: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, 16: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
5th July 2006, 00: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, 09: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, 11: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, 12: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, 01: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, 03: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, 10: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, 14: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, 14: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, 14: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, 15: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, 17: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, 17: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, 08: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, 09: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, 09: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, 11: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, 12: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, 16:03
Robot
Wich OS did You use?
Are you able to play obtained script via mplayerc?

alwa
18th July 2006, 20: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, 21: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, 01:13
In BeHappy [1] Source you must select DirectShowSource instead AviSynth after the input file.

dimzon
19th July 2006, 02: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, 02:05
http://img232.imageshack.us/img232/274/aftenam4.png
Aften support (not tested yet, please report)

Robot
19th July 2006, 07: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, 07: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, 07:54
@nfm : I often install K-lite codec pack , and plugin which is need for Behappy is at gotdotnet

tebasuna51
19th July 2006, 12: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, 13: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, 19: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, 20: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, 22:01
That works great!

Thank you very much, tebasuna51 :)

BigDid
22nd July 2006, 21: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, 22: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, 23: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, 04: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, 13: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, 21: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, 15:24
@ dimzon

why Aften adjust max 448K and not 640K?

thanks.

tebasuna51
28th July 2006, 13: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, 10: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, 14:49
just a suggestion try removing @,[,] from name

BHH

thuongshoo
1st August 2006, 09: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, 16: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, 18: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, 19: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, 21: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, 01: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, 12: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, 16: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, 17: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, 20: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, 20: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, 21: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, 21: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, 10: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, 17: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, 18: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, 22:18
Just leave is as, but after encoding see what happens, is file real mono or is upmixed to stereo.

fight2win
16th August 2006, 13: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, 13: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, 13: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, 13: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, 13: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, 13: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, 14: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, 14: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, 14: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, 17: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, 17: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, 17: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, 17: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, 18: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, 18: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, 18: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, 19: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, 19:17
We not need boost, we need better first pass scener
Scanner, I suppose.
shon3i, really Normalize work fine. :)

shon3i
17th August 2006, 21: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, 23: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, 17: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, 06: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, 23:22
new Aften configuration dialog (in progress)
http://img206.imageshack.us/img206/5256/aftengq8.png

raquete
23rd August 2006, 01:17
seems cool dimzon.

:thanks:

BigDid
23rd August 2006, 04: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, 13: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, 01: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, 03: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, 04: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, 17: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, 14: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, 21: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...