PDA

View Full Version : How Using "Beesweet1.3b8.dll" with Delphi Prog ?


Dark-Cracker
7th April 2002, 19:01
i hope DspGuru could help me. i try to integrate the beesweet dll with an GUI in Delphi someone could help me because i can't translate in delphi how i must call the fonction of this dll.

Thank u for helping me :-)

PS: sorry for my crap english, i am a little frenchy

DSPguru
7th April 2002, 19:04
@Dark-Cracker
you're english is okay :)

i'm not a delphi programmer, so i can't help you much.
please check "example2.c" that included in the package, you'll see the main idea of usage.


EDIT : LigH is known to be a very good delphi programmer, mayB he could help you.

Dark-Cracker
7th April 2002, 19:26
Ok i will try to see in you file exemple2.c i have also the vstripGUi source (an delphi GUI who use Vstrip.dll, this will surely help me)
But if someone have an idear on how to use the beesweet dll in a Delphi prog, he can mail me an exemple :-)

thank dspguru for your quick answer and very nice work with "beesweet", good luck for the next release.

PS: if LIGH have an idear he can contact me. :)

Swede
8th April 2002, 10:55
I thought I could give Dark-Cracker a hand but..

Is there *any* more docs about using besweet.dll than the 2 short examples? (For instance: Why is there a deinit as the first command in example2? I think I've looked everywhere)

I was just going to check that i sent the pascal-params correctly but I don't seem to get anything working, perhaps I'm just stupid :)

If I trace the code I can see that the first command in the array (the deinit) seems to trigger something in the MVCRT.dll but anything else just dies, somewhere in the mvcrt.dll, perhaps there something wrong with the version of that .dll in my machine? Even though besweet.exe does the job perfect?

Nic
8th April 2002, 11:11
Hi ya Swede,

My changes to DVD2AVI kind of prompted DG to make the recent changes to BeSweet.DLL. So DG, (with a little input from me) invented the current interface for the DLL.

So if you need a hand then shout me, (but I know nothing about pascal/delphi so im not sure how much use ill be :( )

Cheers,
-Nic

Swede
8th April 2002, 11:35
Thnx, I've sent a mail to you. It's easier for me (at least) to move this discussion. :D

Dark-Cracker
8th April 2002, 14:03
I you try to use this dll with a frontend in Delphi think to mail me an exemple too :-)

Bye

Swede
8th April 2002, 18:47
I'm not trying to keep this secret, I assure you all... It's just that I don't like to be the one standing 'caught with you're pants down'. (AC/DC anyone?)

Right, I've been trying to get the besweet.dll to work in Delphi. I've got so far that I can make an .mp3 out of a .ac3 but not without the whole thing to crash on me with 'Floating point error' right at the end.

This is an part of the Delphi/Pascal-code:

const
argc = 18;
argv: Array [1..argc] of String = ('Project1','-core(','-input','Test.ac3','-output',
'Test.mp3','-logfile','besweet.txt',')','-azid(','-z1','-b1',')','-lame(','-b','128',')',#0#0);
type
BSfarproc = procedure (argc: Integer; arcv: pointer); cdecl;
var
BeSweet: BSfarproc;
hDLL: HMODULE;
begin
hDLL:=LoadLibrary('BeSweet.dll');
if hDLL<>0 then begin
ListBox.Items.Add('dll found!');
BeSweet:=GetProcAddress(hDLL,'BeSweet');
if Assigned(BeSweet) then begin
BeSweet(argc,@argv);
argv[1]:='deinit';
BeSweet(argc,@argv);
if not FreeLibrary(hDLL) then
ListBox.Items.Add('Not Free''d!');
end;
end
else
ListBox.Items.Add('dll not Found!');
end;

The problem seems to be that somewhere inside the first BeSweet-call something goes wrong, this might be 'cause I've misunderstood something, but trace'ing the code doesn't help me. The procedure BeSweet is executed but doesn't return, at asm-level, but makes an Floating point error-fault, which is captured but Delhpi.

It doesn't matter if I include the last #0#0 or not, there has to be something else that I don't see... :(

Well, if anyone has an idea, feel free to speak up.

DSPguru
8th April 2002, 18:56
1. shouldn't agrc be 14 in your case ?
2. please post logfile.

Swede
8th April 2002, 19:03
#1. 14? This is one of the things, how should I count?
--
'Project1','-core(','-input','Test.ac3','-output',
'Test.mp3','-logfile','besweet.txt',')','-azid(','-z1','-b1',')','-lame(','-b','128',')',#0#0
--
What counts?

--
#2. That's another prob. Since it crashes on me I don't get the log-file. It seems that it does'n get written until the 'deinit'-cmd..?
--

DSPguru
8th April 2002, 19:09
1)
1) 'Project1',
2) '-core(',
3) '-input',
4) 'Test.ac3',
5) '-output',
6) 'Test.mp3',
7) '-logfile',
8) 'besweet.txt',
9) ')',
10) '-azid(',
11) '-z1',
12) '-b1',
13) ')',
14) '-lame(',
15) '-b',
16) '128'
17) ,')'

2)
'deinit', found in 'example2', is only relevant when using "-input ac3input". (meaning - there is NO input file, input is delievered thru AC3_Bursts.
but that's not your case. what you're implementing is what appears in 'example'.

Swede
8th April 2002, 19:19
Ok, so 17 seems to be correct. Tried that.

And, yes I've been trying just to get this to work, just as fluent and simple as besweet.exe with the same cmd-line, but to no avail... It just crashes with a Floating point err.
I'm quite sure that I'm doing something wrong here in my Pascal-interpretation but I've *really* tried to step through in the debugger and can't find the reason...
What's the first parameter? Do you try to grab the win-handle to output anything? Or why is it there?
Should I 'init' it in any way?

And can I get something useful out of a SS since I don't get a return no matter how I try?

DSPguru
8th April 2002, 19:24
Originally posted by Swede
Should I 'init' it in any way?in mode one - no.

And can I get something useful out of a SS since I don't get a return no matter how I try? what's SS ?

maybe there's a problem with the calling convention..
can't help you with delphi.

Swede
8th April 2002, 19:37
Ok, no init. But still, what's the first param? deinit or anything else?

SS = Single Step, I've been stepping though the code to no avail.
I've written a few dll's and since you all say this works, and I doubt not!, it *has* to mean that I'm doing something wrong. I just have to find out what!

There are a few ways to call a C-function from a Pascal-proc but most of the errors comes from pop'ing/not pop'ing bytes from the stack. Either way the call *should* return and the err *should* emerge afterwards which is not the case here.
Maybe it's got something to do with MSVCRT.DLL, which if I understand correct is a C Runtime-lib, and I might not initiate correct?

LigH
9th April 2002, 09:06
There is at least one more mistake: The C construct "char **" is incorrectly translated into "array[..] of String" - instead, it must be an "array[..] of PChar", because C applications are expecting ASCIIZ strings (Char arrays closed with a trailing #0), not PASCAL strings (which have a length prefix). Exactly, "argv" is an array of Pointers to arrays of chars; because the argument count is submitted via "argc", the last 'argv member' does not need to be #0#0.

Besides that, the "cdecl" calling convention is essential, of course.

(No promise, but I might try this today and post my results. Depends on my time.)

Swede
9th April 2002, 10:10
Strictly Pascal you're correct, but Delphi's String is (since ver 3 I think) the same as a Pchar. (You can get the Pascal-string is you excplicitly declares a String[len] or ShortString). Hence the argv: Array [1..argc] of String; is exactly the same as char ** since I deference it in the call @argv.

(And the #0#0 was just a test to see if the reason it crashes *right* at the end had something to do with #of argc.)

I *do* get the mp3 but before the log-file gets flushed to disk the whole thing crashes, somewhere inside but before it returns.?.

LigH
9th April 2002, 12:37
Of course, you shall try to surround the BeSweet function calls by "try...except" or "try...finally" blocks and hope to catch the exception, so that the application at least does not crash anymore. But as you are writing that the function does not really return, I'm starting to doubt it being the one and only solution...

And maybe you can try to add "argc:=1" before calling BeSweet with the "deinit" parameter. - I think I'll definitely have to try for myself; so 'til later.

-

(P.S.: It's a really new information to me that PChar shall be the standard for strings in Delphi - I always thought that the default for 16-bit Delphi is ShortString, the same as Turbo Pascal strings with 1 byte length prefix, and for 32-bit Delphi it's WideString - or depending on the project options; but PChar... I read the documentation so many times, I thought I would know if it was so...)

Swede
9th April 2002, 12:46
If I SS I can see that the params are pushed to the stack as they should, the besweet.besweet is called and tracing that show that is just a 'wrapper' with then calls another func, and if I set a breakpt here it never returns, it just crashes, which I can try..except but it to late anyway :)

So the next call using deinit is never done and as DSPguru said it shouldn't be there anyway, so I deleted that part.

And about the strings your'e almost :D correct but:
In the default {$H+} state, the compiler interprets string (when it appears without a bracketed number after it) as AnsiString.
And AnsiString is a null-term array of chars. Voila!

LigH
9th April 2002, 16:06
I just tried the same (almost - for debugging purposes, it became a bit bigger than Swede's example; especially Params2ArgVect is very "schoolish"). To my surprise, it simply returned the usual error message, as if no or a wrong parameter was submitted. Finally, the DLL simply stopped the whole application instead of returning to the function call.

Although searching for many minutes, I couldn't find substancial differences to Swede's example. So if anyone would like to look at it, here is my source (I hope you don't mind the quite huge printout too much):


program BS_CLI;
{$APPTYPE CONSOLE}
uses
Windows, SysUtils;

const
BeSweetFuncName = 'BeSweet';
BeSweetLibName = 'BeSweet.dll';

type
TArgVect = array[Byte] of PChar;
TBeSweetProc = procedure(ArgCount: Integer; ArgVPtr: Pointer); cdecl;

var
BeSweetProc: TBeSweetProc;
GArgCount: Integer;
GArgVect: TArgVect;
hDLL: THandle;

procedure Params2ArgVect(var ArgCount: Integer; var ArgVect: TArgVect);
var
ParamIdx, ArgLen: Word;
ArgStr: String;
ArgPC: PChar;
begin
ArgCount := 0;
if ParamCount > 0 then begin
Write(ParamCount, ' arguments: "');
for ParamIdx := 0 to Pred(ParamCount) do begin
ArgStr := ParamStr(Succ(ParamIdx));
ArgLen := Length(ArgStr);
ArgPC := StrAlloc(Succ(ArgLen));
ArgVect[ParamIdx] := StrPCopy(ArgPC, ArgStr);
Write(ArgPC, ' ')
end;
WriteLn(^H'"');
ArgCount := ParamCount
end
end;

begin
WriteLn('BeSweet - Delphi CLI wrapper');
FillChar(GArgVect, SizeOf(GArgVect), 0);
Params2ArgVect(GArgCount, GArgVect);
hDLL := LoadLibrary(BeSweetLibName);
if hDLL = 0
then WriteLn('Could not load module "'+BeSweetLibName+'"')
else begin
BeSweetProc := TBeSweetProc(GetProcAddress(hDLL, BeSweetFuncName));
if Assigned(BeSweetProc)
then try
try
BeSweetProc(GArgCount, @GArgVect);
WriteLn('OK')
except
on E:Exception do begin
WriteLn(E.Message)
end
end
finally
if not FreeLibrary(hDLL)
then WriteLn('Library "'+BeSweetLibName+'" could not be released.')
end
else WriteLn('Could not locate function "'+BeSweetFuncName
+' in module "'+BeSweetLibName+'"')
end
end.


My calling command line was:

BS_CLI.exe -core( -input H:\Programme\BeSweet\AC3TEST.AC3 -output I:\AC3TEST.MP3 -logfile I:\AC3TEST.LOG ) -ota( -g max ) -azid( -f1 -n1 ) -lame( -b 160 )

LigH
9th April 2002, 16:15
I forgot: When the package of all the required DLLs is not present, calling the BeSweet DLL resulted in an Access Violation in MSVCRT.DLL - not my preferred solution, I must say...

Swede
9th April 2002, 18:46
Although searching for many minutes, I couldn't find substancial differences to Swede's example.
I think you've missed the same thing that I missed... The first 'magic' parameter... From what I found out the first one has to be, either deinit, or something else. I haven't got a reply yet to why or what but just pass anything (Besweet, swede, LigH or whatever)...

LigH
9th April 2002, 19:15
ParamStr(0) is the name of the application. It's logical - arrays are counted from 0, therefore simply passing the "argv" array includes this one, too.

My new results now:

BeSweet seems to work in general, it starts to calculate the optimal gain (which is reported on the console), it writes the MP3 file (which is *NOT SHOWN*!), then a few seconds later the program crashes (blue screen, Exception 0E); to avoid this, it is possible to reset the application (or, kill the running task from within the IDE) - the MP3 file is then partly written.

Anyway, the DLL call does not return to the calling application, it crashes at its end.

Issue confirmed. DSPguru, any comments?

Swede
9th April 2002, 19:39
ParamStr(0) is the name of the application. It's logical - arrays are counted from 0
Arghh.. You got me there :)

And, you did a console app (which I didn't) and you say that you get output there? If that's the case then perhaps it's somehting with the interaction between MSVCRT and BeSweet.dll... Does it try to hook up to a certain window to produce output? And do you get a correct MP3, like I do?

DSPguru
9th April 2002, 20:53
i'm affraid the calling convention isn't cdecl..

i'm using declspec(dllexport)..

LigH
10th April 2002, 06:30
"declspec(dllexport)"??? That's nothing I know about. But I guess that it could be related to what is called "stdcall" in Delphi - it's the caling convention which is used by most of the Windows API functions, as the Delphi help reports.

To get in detail - the following calling conventions are possible in Delphi:

"register" - parameters from left to right, submitted in registers, routine cleans (most efficient way, default)
"pascal" - parameters from left to right, submitted in stack, routine cleans (backwards compatible)
"cdecl" - parameters from right to left, submitted in stack, caller cleans (as used by most C compilers per default)
"stdcall" - parameters from right to left, submitted in stack, routine cleans (as used by most Windows API calls)
"safecall" - parameters from right to left, submitted in stack, routine cleans (as used in Windows APIs with dual interfaces, COM Exception handling)

("left to right" means that the first parameter in the function parameter list is pushed at first onto the stack {or loaded into EAX} - "right to left" on the opposite stores the last parameter at first)


But no matter if calling BeSweet DLL by either cdecl or stdcall (which are very closely related, except for the end) - both ways crash before returning with bluescreen and Exception 0E - the MP3 file is complete and sounds well, though. And the DLL output is written into that console window (a)from/(b)with which the CLI application was started (a)from the command line/(b)in the IDE.

LigH
10th April 2002, 06:39
Oops - did I say "complete"? Well, at least it's playing well, but I'm missing something valid in the first hundreds bytes: They are all 00, instead I'd expect some header here (ID3Tag V2, Xing VBR...)?

Swede
10th April 2002, 07:56
Ok, sober again :) and I did some serious debugging this morning.

It crashes *after* the message Finalizing but *before* it says Conversion completed.
The error is Floating point division by zero.
The offending instruction is a fmul qword ptr [address], that comes just before some call that ends up in MSVCRT._ftol
If I just ignore that error I *do* get the mp3 and the logfile.

This is about as much as I can do without the dll-source.

LigH
10th April 2002, 08:03
"The advantage of standards is that you may chose one of so many..."

@DSPguru: If it helps you debugging, I could send you my CLI wrapper with different calling-convention flavours. Then you can try to debug your DLL by using one of these applications as host for your DLL (at least this kind of DLL debugging works in Delphi, I hope you can do the same with your favourite C compiler).


*UPDATE* - Here they are:

http://www.ligh.de/software/BS_CLI.ace (ACE2) or http://www.ligh.de/software/BS_CLI.rar (RAR3), as you like.

PLEASE NOTE: "register" and "pascal" are NOT expected to work, they shall abort with an access violation - just to demonstrate that these conventions are very different. If either "cdecl" or "stdcall/(safecall)" are working well can only be seen when BeSweet.DLL returns to the calling application.

DSPguru
10th April 2002, 19:06
sorry guys,
i won't have time to check it out before sunday.

TheWEF
11th April 2002, 04:00
why not run BeSweet.exe instead? you can do it like this:


uses Windows,SysUtils;
...

ExecuteAndWait('C:\BeSweet.exe -myCommandline',False,True);

...
function ExecuteAndWait(const aCmdLine: String; Hidden, doWait: Boolean): Boolean;
var
StartupInfo : TStartupInfo;
ProcessInfo : TProcessInformation;
CreationFlag: DWORD;
begin
{setup the startup information for the application }
FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
with StartupInfo do
begin
cb:= SizeOf(TStartupInfo);
dwFlags:= STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
if Hidden
then
begin
wShowWindow:= SW_SHOWMINNOACTIVE;
CreationFlag:= IDLE_PRIORITY_CLASS;
end
else
begin
wShowWindow:= SW_SHOWNORMAL;
CreationFlag:=NORMAL_PRIORITY_CLASS;
end;
end;

Result := CreateProcess(nil,PChar(aCmdLine), nil, nil, False,
CreationFlag, nil, nil, StartupInfo, ProcessInfo);
if doWait then
if Result then
begin
WaitForInputIdle(ProcessInfo.hProcess,INFINITE);
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
end;
end;


put it into a thread object (TThread) if you want to wait for return in the background:

with TMyThread.Create(False) do OnTerminate :=Main.AudioEncodingDone;


procedure AudioEncodingDone(AOwner:TObject) will be executed when audioencoding is finished.

wef.

DSPguru
11th April 2002, 05:17
wef is right :
if your code doesn't look like example2.c, there's no reason to work with the dll.

anyway, i'll look for the bugs whenever free (not before sunday).

LigH
11th April 2002, 05:59
Originally posted by TheWEF
why not run BeSweet.exe instead?

Oh well, tastes are so different... Some people kept asking for DLL versions of tools, others recommend calling the EXE :D

Why calling DLLs? Just a few thoughts:

* Some people don't like consoles or CLI apps (they are so un-fancy).
* Some DLLs provide interfaces to internal data, which can be displayed e.g. graphically; this won't work when calling the EXE.

_


Just while you are here (sorry for kicking your ass again, but I'm just curious): Is GKnot still in development, regarding the new situation e.g. with XviD and Ogg? No news for a long time makes me nervous, somehow... :rolleyes:

Swede
11th April 2002, 06:49
why not run BeSweet.exe instead?
My only reason was to help Dark-Cracker, he said he wanted to use it in Delphi and since I know my way around I thought I could give him a hand.
But of course, if his reason is just to control BeSweet he could just use the exe.

DidzisK
11th April 2002, 11:25
Originally posted by LigH
(P.S.: It's a really new information to me that PChar shall be the standard for strings in Delphi - I always thought that the default for 16-bit Delphi is ShortString, the same as Turbo Pascal strings with 1 byte length prefix, and for 32-bit Delphi it's WideString - or depending on the project options; but PChar... I read the documentation so many times, I thought I would know if it was so...) [/B]

Default for 32-bit Delphi is AnsiString (in default {$H+} state). AnsiString and PChar are closely related - they both are dynamically allocated and can contain up to 2G characters. You can also cast string (AnsiString) to PChar in many cases but not all - in some cases you will need to explicitly allocate memory for PChar variable before calling a routine which uses PChar as parameter.

WideString uses 2 bytes for each caracter and is used for storing Unicode strings. It is not a default string type in Delphi.

LigH
11th April 2002, 13:49
Originally posted by DidzisK
...
AnsiString and PChar are closely related - they both are dynamically allocated and can contain up to 2G characters

Yeah... I read again in the documentation: Both are an array of Char with trailing #0 from their address forward; AnsiString has an additional length LongInt stored in the 4 bytes before the first character. So up from the first character, they are indeed equal.

DSPguru
11th April 2002, 15:42
what i meant to say is :
if you're planning to use BeSweet.dll, you should implement an example2-like application. if you're implementing the first example, it's as good as running the exe.

Dark-Cracker
11th April 2002, 16:31
Thank u very much for all the answer to my question.I try to use the besweet dll in a rippack i prefer using the dll because i want somethink graphical and DSpguru has made a besweetdll it for it.
I hope a working solution will be find because a lot of programmer use delphi and besweet is the best tool for Audio.

Best regard to Sweed, Light, TheWEF, Dspguru for there helpfull answer.

Ps: sorry for my poor english , i hope u have understand what i try to explain.

DSPguru
11th April 2002, 18:42
Originally posted by Dark-Cracker
Ps: sorry for my poor english , i hope u have understand what i try to explain. your english is fine !!

Dark-Cracker
13th April 2002, 15:57
Hi DSPguru hi hope i will don't boring you but have u try to debug the besweet DLL ? :)

A big greet to SWEDE ang LIGH for helping me for this task.
I hope with the *futur* debugging besweet dll the BS_CLI prog will work fine.

Bye. Thank u all for helping me.

PS: Sorry my english is *a little* crap :-)

DSPguru
13th April 2002, 19:32
i won't debug it until you try to implement the second example.

LigH
14th April 2002, 16:49
Originally posted by DSPguru
i won't debug it until you try to implement the second example.

I'm just about to do that; but unfortunately, my C reading experience is limited: There is a rather complex replacement code for the command line parameters - 'switch(argc) { case ...' - but it seems to be completely useless because there is a line


// init BeSweet
*ARGV=*argv; // <===
BeSweet(ARGC,ARGV);


following after ARGV is changed. :confused:

As far as I understand, the new argument vector "ARGV" (submitted by the application to the DLL) is exchanged by the whole original argument vector "argv" (submitted from the command line to the application's main function) after the argument processing. Or did I misunderstand that command?

DSPguru
14th April 2002, 16:52
argv is char** !
anyway, ignore this Switch case. it is only used to set parameters thru the cli.
read my comments.

LigH
14th April 2002, 21:04
Sometimes I wish you would describe problems and solutions more explicitly :mad:... Delphi programmers are not used to the C format of pointer (de-)referencing - therefore it took me a few minutes to understand what you wanted to tell me with this reply.

The expected result is to copy the first component of the argument vector from the "command line" to the DLL. The first, not all. That means that the first argument (with index 0) then contains the filename of the calling application. Or to be a bit more verbose:

C: "*ARGV = *argv;"
Delphi: "ARGV[0] := ParamStr(0);"

Now I can continue! :p

Swede
15th April 2002, 10:10
@DSPguru: I was a bit bored this morning so I implemented your example2, with the only difference beeing the program feeding the AC3-stream to the dll and got the exact same error, at the same line that I reported earlier. As you can see I didn't copy the exact same parameters but they shouldn't make any difference, right?
Reading your comments I'm a bit worried about // BeSweet.dll will close the file, and assert maximum gain The dll can't close the input-file since it doesn't have the correct handle...

If anyone need the source:
---

program Project1;
{$APPTYPE CONSOLE}
uses Windows, SysUtils, Classes;
const
argc = 17;
argv: Array [1..argc] of String = ('Project1','-core(','-input','ac3input','-output',
'Test.mp3','-logfile','besweet.txt',')','-azid(','-z1','-b1',')','-lame(','-b','128',')');
type
BS_Record = record
hours, minutes, seconds, millis: Short;
peak: Single;
err: Integer;
end;
BS_Ptr = ^BS_record;
BSfarproc = procedure (argc: Integer; arcv: pointer); cdecl;
AC3proc = function (size: Integer; var buf): BS_Ptr; cdecl;
var
BeSweet: BSfarproc;
AC3_Bursts: AC3proc;
hDLL: HMODULE;
s: String;
info: BS_Ptr;
buff: Packed Array [0..2047] of Byte;
ac3File: TFileStream;
count: Integer;
begin
hDLL:=LoadLibrary('BeSweet.dll');
if hDLL<>0 then begin
Writeln('DLL found');
BeSweet:=GetProcAddress(hDLL,'BeSweet');
AC3_Bursts:=GetProcAddress(hDLL,'AC3_Bursts');
if (Assigned(BeSweet) and Assigned(AC3_Bursts)) then begin
ac3File:=TFileStream.Create('Test.ac3',fmOpenRead);
BeSweet(argc,@argv);
count:=2048;
while count=2048 do begin
count:=ac3file.Read(buff,2048);
info:=AC3_Bursts(count, buff);
with info^ do
write(IntToStr(hours)+':'+IntToStr(minutes)+':'+IntToStr(info^.seconds)+':'+IntToStr(millis)+' err '+IntToStr(info^.err),#13);
end;
ac3File.Free;
argv[1]:='deinit';
BeSweet(1,@argv);
if not FreeLibrary(hDLL) then
Writeln('Not Free''d!');
end;
end;
end.

LigH
15th April 2002, 10:43
"He, alter Schwede!" :p Here you've been faster than me.

TFileStream is something I shall remember in the future - I was about to use the Win32 functions directly, but now that I know there is an object for it, it might become easier in the future to "transpile" C sources.

I also would like to ask DSPguru in general to provide more (by count), more actual and more verbose documentation of his tools. From my experience, I sometimes found weaknesses and bugs while thinking about how to describe interfaces in a documentation...

Swede
15th April 2002, 11:25
"He, alter Schwede!" Here you've been faster than me. Well, I hope you don't think I'm taking this as a race, 'cause that's absolutely not my intention. :)
It was just that I had to do something else for a while. Well, else as in not programming in the other Delphi-apps that I'm doing... Come to think of it, I don't do anything else than Delphi... Almost...

Swede
15th April 2002, 11:34
Well, duh! I was kinda wrong when I assumed the parameters had nothing to do with this... Changing from the azid to ota did the trick.. Try my last code but using this params:
argc = 21;
argv: Array [1..argc] of String = ('Project1','-core(','-input','ac3input','-output',
'Test.mp3','-logfile','besweet.txt',')','-ota(','-d','0','-G','max',')','-lame(','--alt-preset','128','--scale','1',')');

DSPguru
15th April 2002, 23:08
compile and attach in here.

Swede
16th April 2002, 06:54
compile and attach in here.
Here it is, but since everything is hardcoded it must be the most useless program I've ever done :D

(Instead of waiting for the attach, you can d/l it here (http://leffe.dnsalias.com/project2.zip) )

Nic
16th April 2002, 20:36
@DSPGuru:

Hiya :)

Forgot to mention, exception faults in the BeSweet.DLL can occur if very small buffer sizes (<1000) are sent to AC3Burst...This isn't a problem because ive made it so DVD2AVI will always buffer & send 8000 bytes. But I thought id mention it just in case you hear similar reports :)

Thanks again for all your help :) (I see movmasty guessed your avatar :) (btw i guessed wrong myself :( :) )

Cheers,
-Nic

DSPguru
16th April 2002, 21:29
Originally posted by Nic
@DSPGuru:

Hiya :)

Forgot to mention, exception faults in the BeSweet.DLL can occur if very small buffer sizes (<1000) are sent to AC3Burst...This isn't a problem because ive made it so DVD2AVI will always buffer & send 8000 bytes. But I thought id mention it just in case you hear similar reports :)i'll check it out in the future. very busy lately..

Thanks again for all your help :) (I see movmasty guessed your avatar :) (btw i guessed wrong myself :( :) )

Cheers,
-Nic time to pick an avatar for yourself.. ;)

Dg.

Dark-Cracker
20th April 2002, 15:27
All the problemes are they solved ? thank u all for your help :-)
does it exist a final relase of besweet.dll , and the delphi exemple :-) ?

CyberDemonII
27th October 2002, 15:09
I have a problem using besweet.dll while creating an ogg file.

When i use the example2.c as example it is possible to create 2 ogg files in the same function.

But when i use the code in a mfc application the 2nd ogg file is invalid!

I use the following code :

hDLL=LoadLibrary("BeSweet.dll");
BeSweet = (BESWEET) GetProcAddress(hDLL, "BeSweet");
AC3_Bursts = (BURSTS) GetProcAddress(hDLL, "AC3_Bursts");

char buffer[AC3_BUFFER] = {0}; // AC3 bursts
int count = 1;
BS_Record info; // BeSweet info


BeSweet(ARGC,ARGV);

// Start Transcoding
while(count)
{
count = fread(buffer,1,AC3_BUFFER,fp);
info = AC3_Bursts(count,buffer);
if (!info->err)
{
}
}

strcpy(ARGV[0],"deinit");
BeSweet(ARGC,ARGV);
FreeLibrary(hDLL);

And the besweet commandline is like :
-core( -input ac3input -output file.ogg ) -boost( /b=2 /l=0.98 ) -ota( -G max ) -azid( -s surround2 ) -ogg( -b 320 )

Can somebody please help me ?

DSPguru
27th October 2002, 19:46
can you give more details about how you use BeSweet.dll to create 2 ogg streams ?

CyberDemonII
27th October 2002, 20:17
Hi DSPguru,

I am implemteting a sort of batch mode in my application. So its possible to do more conversions in a batch.
So for example when i have 2 video's , the tool must use besweet to convert twice an ac3 to ogg file.

I use the code as you saw in the previous message.

But ....

I did some testing and it seems that i have located the problem :

When i use -ota( -G max) , it crashes (Or the muxing from avi+ogg goes wrong because the ogg file in invalid)

But when i use -ota( -g max), it works perfect !

Could you please tell and investige how this can be ?
( I have no problems with mp3 , only ogg is wrong)

And as you saw in the previous message, i am using "example2.c" as base. But DO i have to do this, or can I just do it the simple way ?)

thanx for helping !!!

grtz,
CyberDemonII

DSPguru
28th October 2002, 20:05
i'm sorry. i don't have the time to help you today.
i'll reply in a couple of days.

stay tuned.

mmgrover
1st November 2002, 17:52
Using the 1.41 dll with the following:
char* ARGV[23]={"deinit","-core(","-input","ac3input","-output","test.mp2","-logfile ","BeSweet.txt",")","-ota(","-d","0","-G","max",")","-mp2enc(", "-b", "192", ")","-ssrc(","--rate","44100",")"};

trying to encode ac3 to mp2 I get a error "Invalid Floating Point operation"

Any Ideas?
Are my Arguments right?


mike

DSPguru
1st November 2002, 18:24
imho. "deinit" doesn't belong in here.

DSPguru
1st November 2002, 18:40
@CyberDemonII
as far as i remember, -g max has no effect on BeSweet.dll. you need to run BeSweet.dll twice by yourself.
first pass is used to find the maximal gain using the returned struct from BeSweet and the second pass is used for gain assertion. (since gain value is known in this point).
anyway, PostGain is much more advised. same goes for Azid's boosting comparing to -boost().
i suggest that you take a look at my advised commandline that can be found in BeSweetGUI's profiles.

mmgrover
1st November 2002, 20:17
@DspGuru

I had changed the line in example2.c that came from the dll
from:

char* ARGV[25]={"deinit","-core(","-input","ac3input","-output","test.mp3","-logfile ","BeSweet.txt",")","-ota(","-d","0","-G","max",")","-lame(","--alt-preset","128","--scale","1",")","-ssrc(","--rate","44100",")"};

to

char* ARGV[23]={"deinit","-core(","-input","ac3input","-output","test.mp2","-logfile ","BeSweet.txt",")","-ota(","-d","0","-G","max",")","-mp2enc(","-b","192",")","-ssrc(","--rate","44100",")"};

and

int ARGC=21; // 25

to

int ARGC=19; // 23


was that wrong?


mike

DSPguru
1st November 2002, 20:27
"deinit" should only come at the end of the process.

TFM_TheMask
6th May 2003, 12:13
Hi you all,

I want to use BeSweet dll to convert avi compressed audio streams to mpa audio. Thanks to this thread I got the ac3burst working, but what if the avi audio is a mp3 stream or another stream. How do I get this to work in delphi? Must I use AC3Burst or MPABurst or another burst?

Now I use the console application with this commandline:


"BeSweet.exe" -core( -input "Extracted_Audio.wav" -output "Encoded_Audio.mp2" -logfile "Encoded_Audio.log" ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -e -b 224 -m s )

Can anyone help with this.

DSPguru
8th May 2003, 13:01
MPABurst

TFM_TheMask
8th May 2003, 13:37
That doesn't work. I use this commandline:

0: BeSweet.dll
1: -core(
2: -input
3: ac3input
4: -output
5: Test.mp2
6: -logfile
7: Test.txt
8: )
9: -ota(
10: -r
11: 960
12: 1001
13: -g
14: max
15: )
16: -shibatch(
17: --rate
18: 44100
19: )
20: -2lame(
21: -e
22: -b
23: 224
24: -m
25: s
26: )
besweet_argc: 27

I feed mpaburst a stream like BeStrip does with Ac3Burst.

By the way must I use AC3input in the commandline or does this trigger something else.

The logfile is:
BeSweet v1.5b6 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.2 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/08/03 , 14:24:03.

BeSweet.dll -core( -input ac3input -output Test.mp2 -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -e -b 224 -m s )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: Test.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------

and then I got an access violation when I call mpabursts.

What am I doing wrong?

DSPguru
8th May 2003, 14:23
-input mpainput :)

TFM_TheMask
8th May 2003, 17:32
Got a little bit further but now I got a "invalid floating point operation".

What I did is extracted a vbrmp3 from a avi-file. Because BeSweet has troubles with dealing with a vbrmp3 file I decoded the wav with madplay. Then I tried the conversion to mpa with BeSweet.exe with the same commands as described in my first post. It worked fine.

The logfile output is:

BeSweet v1.5b1 by DSPguru.
--------------------------
Using Shibatch.dll v0.2 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/08/03 , 16:29:03.

BeSweet.exe -core( -input test.wav -output test.mpa -logfile besweetexe.log ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -e -b 224 -m s )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : test.wav
[00:00:00:000] | Output: test.mpa
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Overall Track Gain: 1.499dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[01:45:58:293] Conversion Completed !
[01:45:58:293] Actual Avg. Bitrate : 214kbps
[00:17:31:000] <-- Transcoding Duration
Logging ends : 05/08/03 , 16:46:34.

Then I tried it using your dll and with mpainput and the log file output is:

BeSweet v1.5b6 by DSPguru.
--------------------------
Using hip.dll v1.13 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.2 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/08/03 , 18:13:00.

BeSweet.dll -core( -input mpainput -output Test.mp2 -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -e -b 224 -m s )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: Test.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:036] Stream error : Sync found after 428 bytes
[00:00:00:072] Stream error : Sync found after 632 bytes
[00:00:00:108] Stream error : Sync found after 119 bytes
[00:00:00:134] Stream error : Sync found after 451 bytes
[00:00:00:170] Stream error : Sync found after 1153 bytes
[00:00:00:222] Stream error : Sync found after 176 bytes
[00:00:00:258] Stream error : Sync found after 242 bytes
[00:00:00:282] Stream error : Sync found after 322 bytes
[00:00:00:308] Stream error : Sync found after 261 bytes
[00:00:00:344] Stream error : Sync found after 417 bytes
[00:00:00:370] Stream error : Sync found after 28 bytes
[00:00:00:394] Stream error : Sync found after 406 bytes
[00:00:00:420] Stream error : Sync found after 20 bytes
[00:00:00:444] Stream error : Sync found after 210 bytes
[00:00:00:468] Stream error : Sync found after 64 bytes
[00:00:00:494] Stream error : Sync found after 316 bytes
[00:00:00:518] Stream error : Sync found after 6 bytes
[00:00:00:544] Stream error : Sync found after 41 bytes
[00:00:00:580] Stream error : Sync found after 3 bytes
[00:00:00:607] Stream error : Sync found after 624 bytes
[00:00:00:633] Stream error : Sync found after 173 bytes
[00:00:00:669] Stream error : Sync found after 119 bytes
[00:00:00:705] Stream error : Sync found after 271 bytes
[00:00:00:729] Stream error : Sync found after 51 bytes
[00:00:00:755] Stream error : Sync found after 70 bytes
[00:00:00:781] Stream error : Sync found after 251 bytes
[00:00:00:807] Stream error : Sync found after 196 bytes
[00:00:00:833] Stream error : Sync found after 536 bytes
[00:00:00:869] Stream error : Sync found after 1122 bytes
[00:00:00:893] Stream error : Sync found after 523 bytes
[00:00:00:919] Stream error : Sync found after 544 bytes
[00:00:00:945] Stream error : Sync found after 544 bytes
[00:00:00:969] Stream error : Sync found after 10 bytes
[00:00:00:993] Stream error : Sync found after 219 bytes
[00:00:01:029] Stream error : Sync found after 22 bytes
[00:00:01:053] Stream error : Sync found after 564 bytes
[00:00:01:089] Stream error : Sync found after 379 bytes
[00:00:01:116] Stream error : Sync found after 147 bytes
[00:00:01:142] Stream error : Sync found after 888 bytes
[00:00:01:168] Stream error : Sync found after 557 bytes
[00:00:01:194] Stream error : Sync found after 10 bytes
[00:00:01:230] Stream error : Sync found after 692 bytes
[00:00:01:266] Stream error : Sync found after 94 bytes
[00:00:01:328] Stream error : Sync found after 23 bytes
[00:00:01:352] Stream error : Sync found after 1079 bytes
[00:00:01:378] Stream error : Sync found after 76 bytes
[00:00:01:402] Stream error : Sync found after 154 bytes
[00:00:01:428] Stream error : Sync found after 4 bytes
[00:00:01:452] Stream error : Sync found after 343 bytes
[00:00:01:478] Stream error : Sync found after 231 bytes
[00:00:01:505] Stream error : Sync found after 161 bytes
[00:00:01:541] Stream error : Sync found after 644 bytes
[00:00:01:565] Stream error : Sync found after 724 bytes
[00:00:01:589] Stream error : Sync found after 376 bytes
[00:00:01:613] Stream error : Sync found after 1419 bytes
[00:00:01:685] Stream error : Sync found after 687 bytes
[00:00:01:721] Stream error : Sync found after 1402 bytes
[00:00:01:747] Stream error : Sync found after 657 bytes
[00:00:01:783] Stream error : Sync found after 1255 bytes
[00:00:01:807] Stream error : Sync found after 48 bytes
[00:00:01:843] Stream error : Sync found after 599 bytes
[00:00:01:903] Stream error : Sync found after 317 bytes
[00:00:01:939] Stream error : Sync found after 1004 bytes
[00:00:01:975] Stream error : Sync found after 238 bytes
[00:00:02:011] Stream error : Sync found after 983 bytes
[00:00:02:035] Stream error : Sync found after 34 bytes
[00:00:02:071] Stream error : Sync found after 20 bytes
[00:00:02:095] Stream error : Sync found after 36 bytes
[00:00:02:131] Stream error : Sync found after 910 bytes
[00:00:02:167] Stream error : Sync found after 431 bytes
[00:00:02:203] Stream error : Sync found after 1029 bytes
[00:00:02:265] Stream error : Sync found after 580 bytes
[00:00 at this point I got a invalid floating point operation.

Maybe the size of the buffer is wrong. I give mpabursts a buffer of 2048 bytes. The Bs_info record the function mpabursts returns says [00:00:2048:000] peak: 0,00. It looks that the bs_info.seconds is giving back the size of the buffer.

DSPguru
8th May 2003, 19:24
a. which problem does BeSweet have with vbrmp3 ?
b. what were you inputting BeSweet.dll ? the original mpa stream (mpainput) or the decoded stream (pcminput) ?

TFM_TheMask
9th May 2003, 13:32
a)BeSweet.exe very rarely hangs when converting extracted wav(mp3) to mpa. This is also why DVD2SVCD uses MadPlay. I experienced this ones in my program The FilmMachine and that's why I use MadPlay before executing BeSweet. It's more stable.
b)You're right I feed the pcm output stream from madplay to youre dll. But when I feed the extracted wav (mp3) directly to the dll with mpainput it gives also an "invalid floating point operation".

The log output is:

BeSweet v1.5b6 by DSPguru.
--------------------------
Using hip.dll v1.13 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.2 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/09/03 , 14:27:03.

BeSweet.dll -core( -input mpainput -output Test.mpa -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -e -b 224 -m s )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: Test.mpa
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +--------------------- here I get an invalid floating point operation

DSPguru
9th May 2003, 13:57
let's try to clear things out..
- the pcminput works correctly ?
- now, lets only talk about the mpainput :
-- please post a logfile where you feed BeSweet.exe with your source mpafile. report problems if exists.
-- please post a logfile where you feed BeSweet.dll with mpa chunks using the minimalist commandline :
-core( -input mpainput -output Test.mpa -logfile Test.txt )

TFM_TheMask
9th May 2003, 15:42
1. What do you mean with pcminput. Must I use another function call for this, and use pcminput instead of mpainput?

2. Here's a logfile from your dll with minimum commands with the original extracted wav (mp3). It works, only found 1 stream error (sync found after 58 bytes). By the way your Bs_info record still doesn't give the time, it only gives 00:00:2048:000 every 2048 bytes (if I use an ac3-file and ac3bursts the bs_info record gives the correct time).

BeSweet v1.5b6 by DSPguru.
--------------------------
Using hip.dll v1.13 by Myers Carpenter <myers@users.sf.net>
Using lame_enc.dll v1.28 (18/4/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/09/03 , 15:06:03.

BeSweet.dll -core( -input mpainput -output Test.mpa -logfile Test.txt )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: Test.mpa
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP3 bitrate : 128
[00:00:00:000] | Channels Mode : Joint Stereo
[00:00:00:000] | Error Protection: No
[00:00:00:000] +---------------------
[00:00:00:024] Stream error : Sync found after 58 bytes
[01:45:51:936] Conversion Completed !
[01:45:51:936] Actual Avg. Bitrate : 127kbps
[00:22:13:000] <-- Transcoding Duration
Logging ends : 05/09/03 , 15:28:16.

3. Here is a logfile from your exe with the commands I always use with the original extracted wav (mp3). No errors, worked fine.

BeSweet v1.5b1 by DSPguru.
--------------------------
Using hip.dll v1.13 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.2 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/09/03 , 16:09:33.

BeSweet.exe -core( -input test.wav -output test.mpa -logfile besweetexe.log ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -e -b 224 -m s )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : test.wav
[00:00:00:000] | Output: test.mpa
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Overall Track Gain: 1.499dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[01:45:51:904] Conversion Completed !
[01:45:51:904] Actual Avg. Bitrate : 214kbps
[00:27:28:000] <-- Transcoding Duration
Logging ends : 05/09/03 , 16:37:01.

DSPguru
9th May 2003, 16:31
1. for wav (pcm inputs), you naturally need to set "-input pcminput", and use the PCM16S_Bursts function.

2. regarding the bugs you reported :
2.1. as you can see, there's no problem for BeSweet to process vbrmp3 file. dvd2svcd choosed to use madplay prior to the fixes i put into BeSweet.
2.2. the bs_info bug and the combination of sample-rate-conversion with frame-rate-conversion issue had already been fixed in the latter BeSweet versions.

conclusion : i just need to release a newer BeSweet.dll (v1.5b17)


now, i understand from you that you use BeSweet.dll, implementing a transcode process from AVI into mp2.
may i ask why don't you just use BeSweet.exe to do that directly ?

TFM_TheMask
9th May 2003, 17:20
1. What other functions can you call in the dll. In your example file you only speak of ac3bursts and mpabursts. Is the function declaration of PCM16S_Bursts the same as ac3bursts and mpabursts.

2.1. Ok I will skip MadPlay for the time being to test the new release of BeSweet.exe directly with vbrmp3's.

2.2. When will you release the new dll, and will it work with the commands I had troubles with. The commands also won't work on AC3 with ac3input. Only the commands used in the earlier posts in this thread are working (that is the one that is used in BeStrip, -ota( -d 0 -G max ) -lame( --alt-preset 128 --scale 1 )).

By the way I use the same commands on all extracted avi audiostreams with youre BeSweet.exe (so it doesn't matter if it is AC3, MP2, MP3, PCM).

At this time I use besweet.exe because it's the best at audio conversions. But since my Program is designed for windows I like to to show your bs_info record graphical. Consoles and CLI apps are so unfancy.

DSPguru
9th May 2003, 20:30
1. same decleration. open BeSweet.dll with "dependency walker" for more info on its functions.
2. i'll publish dll v1.5b17 in near future.
3. fancy gui is cool :cool: !

TFM_TheMask
9th May 2003, 20:41
Tip: I was bored and tested a little bit. I found out that -2lame is the problem. If I use the commands without -2lame it's working great.

By the way is toolame the replacement of 2lame in your latter versions?

Also tested the pcmbursts function, it worked fine without -2lame. The Bs_info record also gives false values back with this function.

Hope you will inform me when you publish youre new dll.

DSPguru
11th May 2003, 23:51
zmAn forced me to create a new BeSweet.dll build for his new tool (azidts), so you can get it from its package.

TFM_TheMask
12th May 2003, 19:41
Here are my test results of your new dll (v1.5b17).

1. AC3Bursts with ac3 file
a. BS_info record : peak is always 0, time is displayed correctly.
b. commands that work: shibatch, ota and toolame.
c. commands that won't work: mp2enc and 2lame. (floating point error).

2. MPABursts with vbrmp3 file
a. BS_info record : time is always 0, peak is displayed correctly.
b. commands that work: shibatch, ota and toolame.
c. commands that won't work: mp2enc and 2lame. (floating point error).

3. PCMBursts with decoded madplay file
a. BS_info record : is displayed correctly.
b. commands that work: shibatch, ota and toolame.
c. commands that won't work: mp2enc and 2lame. (floating point error).

Hope this is of some use. Conclusion: your dll is not working with mp2enc.dll (I only tested the commands I send in my first post).

By the way the logfile that is created is always appended. Also with the command -logfile.


4 Question
With BeSweet.exe there is always a two pass process. First it will find the maximum gain and after that the real transcoding begins.
With the dll the transcoding begins immediately. Is it also possible to do a two-pass like in the exe?

DSPguru
12th May 2003, 19:55
1. i'll check the peak issue
2. i'll check the time indicator for mp2 inputs
3. i'll check the 2lame/mp2enc problem

4. logfile is indeed appended, that's because i assume that the main tool will always write to the logfile before BeSweet.dll
5. BeSweet cannot run twice on the inputfile, because it has no control on the input file - the input is being burst, remeber ;) ?

so either you use a PostGain/HybridGain methods (if you don't know what that is, search in the audio encoding forum :) ), or either you implement two-passes in the main program :
first pass would come after calling "no_output", in the second pass you'll be asserting gain according to the PEAK value that was recieved in BS_Record. the two commandlines (1st & 2nd pass) should only differ in the "-g" switch. all others (but to "-logfile", i guess) should stay the same.

TFM_TheMask
12th May 2003, 20:29
new finding

1. AC3burst: if I use -G max the peak is displayed but there is no output. if I use -g max than the peak is not displayed, but there is output.

2. Mpaburst: if I use -G max I get a floating point error. if I use -g max there is output.

3. Pcmburst: if I use -G max there is no output. if I use -g max than there is output.

Is this normal?

DSPguru
12th May 2003, 21:57
:D :logfile: :D

TFM_TheMask
12th May 2003, 22:23
Here it is.

BeSweet v1.5b17 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/12/03 , 23:06:45.

BeSweet.dll -core( -input ac3input -output Test.mp3 -logfile Test.txt ) -ota( -r 960 1001 -G max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: Test.mp3
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] | PostGain normalize to : 6662.00
[00:01:48:448] Conversion Completed !
[00:00:10:000] <-- Transcoding Duration

Logging ends : 05/12/03 , 23:06:55.


BeSweet v1.5b17 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/12/03 , 23:07:02.

BeSweet.dll -core( -input ac3input -output Test.mp3 -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: Test.mp3
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:01:48:448] Conversion Completed !
[00:01:48:448] Actual Avg. Bitrate : 214kbps
[00:00:21:000] <-- Transcoding Duration

Logging ends : 05/12/03 , 23:07:23.


BeSweet v1.5b17 by DSPguru.
--------------------------
Using hip.dll v1.19 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/12/03 , 23:13:21.

BeSweet.dll -core( -input mpainput -output Test.mpa -logfile Test.txt ) -ota( -r 960 1001 -G max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: Test.mpa
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] | PostGain normalize to : 6662.00
[00:00:00:106] Conversion Completed !
[00:00:28:000] <-- Transcoding Duration

Logging ends : 05/12/03 , 23:13:49.


BeSweet v1.5b17 by DSPguru.
--------------------------
Using hip.dll v1.19 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/12/03 , 23:14:26.

BeSweet.dll -core( -input mpainput -output Test.mpa -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: Test.mpa
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:000] Stream error : Sync found after 126 bytes
[00:00:00:106] Conversion Completed !
[00:00:00:106] Actual Avg. Bitrate : 608879kbps
[00:00:41:000] <-- Transcoding Duration

Logging ends : 05/12/03 , 23:15:07.


BeSweet v1.5b17 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/12/03 , 23:18:12.

BeSweet.dll -core( -input pcminput -output Test.mpa -logfile Test.txt ) -ota( -r 960 1001 -G max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : pcminput
[00:00:00:000] | Output: Test.mpa
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] | PostGain normalize to : 6662.00
[01:45:50:575] Conversion Completed !
[00:01:34:000] <-- Transcoding Duration

Logging ends : 05/12/03 , 23:19:46.

DSPguru
13th May 2003, 20:42
1. oopsi, i forgot you use BeSweet to encode mp2.
PostGain is only applicable for MP3 or Ogg Vorbis.
i guess you'll have to implement the two passes.

2. please post the logfiles of mp2enc.dll

3. what happens if you only encode with mp2enc and don't do FRC,SSRC ?

TFM_TheMask
13th May 2003, 21:19
I am trying to do the 2-pass. What I do is: first I use this command on the function NoOutput: BeSweet.dll -core( -input pcminput -output Test.mpa -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

By the way I assume that the function NoOutput also gives back the BS_Info record and has the same parameters as the other functions. (I also saw that you added some functions to the dll, should I use some for my purpose?)

The BS_Info record looks like this:
hours: 1479
minutes: 29600
seconds: 253
milliseconds: -15328
peak: 0

So there is no peak information to use in the 2 pass.

If there were a peak value I would use it in the next commandline:
BeSweet.dll -core( -input pcminput -output Test.mpa -logfile Test.txt ) -ota( -r 960 1001 -g peakvalue ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )


Am I write?

You asked for the logfiles for mp2enc.dll. Here it is:

BeSweet v1.5b17 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/13/03 , 22:12:32.

BeSweet.dll -core( -input ac3input -output Test.mp3 -logfile Test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: Test.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +--------------------- Here invalid floating point operation.

The Bs_info.milliseconds is 160.

This is also the case with pcmbursts and mpabursts

DSPguru
13th May 2003, 21:29
1. here's the best way to do it :
first pass
1. call BeSweet with arguments :
BeSweet.dll -core( -input pcminput -output Test.mpa -logfile Test.txt )
2. call NoOutput (has no input or output arguments)
3. call XXXburst as long as you wish
4. call BeSweet with deinit

second pass is trivial, i believe...


2. please post a logfile when encoding with mp2enc, omitting FRC&SSRC

3. the new functions are for pcm inputs (8bit / mono / 6 channels / etc'..)

TFM_TheMask
13th May 2003, 21:39
Here is the logfile of mp2enc, same result only bs_info.millisec is 064.

BeSweet v1.5b17 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/13/03 , 22:33:54.

BeSweet.dll -core( -input ac3input -output Test.mp3 -logfile Test.txt ) -2lame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: Test.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +--------------------- Here invalid floating point operation.

Will try the 2-pass.

DSPguru
13th May 2003, 21:45
invalid operation @ BeSweet.dll or @ mp2enc.dll ?

TFM_TheMask
13th May 2003, 21:55
How can I check this?

DSPguru
13th May 2003, 21:57
it should appear at the same window that tells you about the wrong opeartion.


ps.. this isn't ready yet.. but it you feel like experimenting will the latest build :
http://BeSweet.notrace.dk/latest.zip

TFM_TheMask
13th May 2003, 22:01
The debugger window gives me no name of where it's going wrong?

Will check it out tomorrow. Thanks for the latest build.

TFM_TheMask
14th May 2003, 14:36
1. Tested your latest dll (b18).

The peak was fixed with ac3. So the bs_info record for ac3burst is complete.

With the mpaburst I still don't get the h, m, s and ms. It shows only the peak.

Also still a floating point in all functions with mp2enc.dll.

2.I also tried to find the floating point error, but no luck. I think it is in the mp2enc.dll because all other commands are working.

Does mp2enc.dll in combination with the besweet.dll work with you?

3. Can you tell me what the difference is between -toolame, -2lame and -mp2enc. The all have the same arguments.

4. 2pass

You said:
1. call BeSweet with arguments :
BeSweet.dll -core( -input pcminput -output Test.mpa -logfile Test.txt )

Should I also put -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e ) in this call?

DSPguru
14th May 2003, 15:31
1. no timestamps for mpa ? weird...
2. azidts correctly encodes mp2 (BeSweet.dll+mp2enc.dll).
3. toolame is toolame.dll, mp2enc/2lame is mp2enc.dll . toolame has much more arguments (4 psy models, vbr, etc'.. )
4. for the first pass, you should only care about the input plugins, and that's only two sections : -core & -azid.

TFM_TheMask
14th May 2003, 16:31
1. Do you perhaps know how azidts has implemented your dll with mp2enc? I think he is not using your burst functions. Isn't he using your dll like example1(complete file input) and not like example2 with bursts.

2. Am I correct when I use the peak value of the first pass (for example 0.87) in this statement, -ota( -r 960 1001 -g 0.87 ). if that is so the 2 pass works.

3. Which command can I use best for my purpose: -toolame, -2lame or -mp2enc.

DSPguru
14th May 2003, 18:35
1. he is using 166Bursts (for six channels), and 16SBursts (for stereo downmixed)
2. almost correct. the gain value should be 1/peak rather than the peak itself.
3. hmm.. don't know. anyway, this belongs (and probably had been discussed) in the audio encoding forum and svcd forums :)


so.. currently we only know of two flaws left. right :) ?
mp2enc & mpaburst timestamps.

Cheers !
Dg.

TFM_TheMask
14th May 2003, 19:25
Youre right, two flaws.

I will check azidts out, and try the 2-pass.

Do you know if there is any sourcecode of a program that uses your dll and mp2enc? Because I could check that out then.

cheers!

DSPguru
14th May 2003, 20:18
int main(int argc,char **argv)
{

#define BURST_SIZE 1000


char buffer[BURST_SIZE]; // bursts of mpa
int count =BURST_SIZE; // burst size

char* mpainput="mpainput";
char* deinit[1]={"deinit"};

HINSTANCE hDLL = LoadLibrary("BeSweet.dll");
BESWEET BeSweet = (BESWEET) GetProcAddress(hDLL, "BeSweet");
BURSTS Bursts = (BURSTS) GetProcAddress(hDLL, "MPA_Bursts");
VERSION BS_VERSION = (VERSION) GetProcAddress(hDLL, "BS_VERSION");

FILE* inputfile = fopen(argv[3],"rb");

BS_Record info;


// here we init BeSweet.dll with the commandline arguments for mpa
argv[3]=mpainput;
BeSweet(argc,argv);

// transcode
while(1)
{
count=fread(buffer,1,BURST_SIZE,inputfile);
if(!count) break;
info=Bursts(count,buffer);
fprintf(stdout,"[%02d:%02d:%02d:%03d] transcoding! Max gain : %2.1fdB \r",info->hours,info->minutes,info->seconds,info->millis,-20*log10(info->peak));
if (info->err) break;
}

// deinit BeSweet.dll
BeSweet(1,deinit);
FreeLibrary(hDLL);

fclose(inputfile);
}btw, it seems you've got the wrong mp2enc.dll release, as for me, it prints.. :Using MP2enc.dll v1.129 (7/6/2002), Engine 1.129 <http://www.cdex.n3.net>

TFM_TheMask
14th May 2003, 20:58
You were right. I think I got the wrong version. I found an older version v1.11 (big size 147.456 bytes) and it worked, but when I tried the conversed file in mplayer it didn't play.

I could not find the version you are using. Can you tell me where to get it. I've been to cdex site but I got a newer version v1.13 but also gave me an floating point error.

By the way only the date is different, not the version.

If It's the solution, only one flaw to go (mpa timestamps).

Thanks

DSPguru
14th May 2003, 21:06
i fixed the timestamp issue but didn't upload it yet.
mp2enc.dll can be found on the regular BeSweet package, and it's probably also in the azidts package.

TFM_TheMask
15th May 2003, 07:47
1. Tried the mp2enc.dll from azidts and your stable release and the both give me a floatingpoint error.

The version of mp2enc in azidts and your stable release is:

Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Please could you send me the one dated 7/6/2002 that you have.

2. 2-pass
I tried as you said, first pass only -core commands and second pass the full commandline. I got a floating point error. I think this is because in the first pass different dll's are loaded by besweet as in the second pass. Seems that in the first pass your dll has to know which encoder it must use for the second pass. See the log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/15/03 , 14:47:03.

BeSweet.dll -core( -input pcminput -output testpcm.mp2 -logfile testpcm.txt )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : pcminput
[00:00:00:000] | Output: testpcm.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP3 bitrate : 128 pass 1
[00:00:00:000] | Channels Mode : Joint Stereo
[00:00:00:000] | Error Protection: No
[00:00:00:000] +---------------------
[00:05:00:504] Conversion Completed !
[00:05:00:504] Actual Avg. Bitrate : 0kbps
[00:00:02:000] <-- Transcoding Duration

Logging ends : 05/15/03 , 14:47:05.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.11 (0/0/1999), Engine 1.11 <http://www.cdex.n3.net>.

Logging start : 05/15/03 , 14:47:10.

BeSweet.dll -core( -input pcminput -output testpcm.mp2 -logfile testpcm.txt ) -ota( -r 960 1001 -g 1.15 ) -shibatch( --rate 44100 ) -2lame( -m s -b 224 -e )

[00:00:02:000] +------- BeSweet -----
[00:00:02:000] | Input : pcminput
[00:00:02:000] | Output: testpcm.mp2
[00:00:02:000] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.214dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz pass 2
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------

Then I used the full command in the first and second pass and used the peak from the first pass. It worked perfect.

At this time I only used pcmburst with -toolame, -ota and -shibatch.

Tomorrow I will test ac3burst and mpaburst.

3. Still don't know what is wrong with mp2enc!!

4. 2-pass with ac3burst and mpaburst.

mpaburst: got an access violation in the second pass because your dll uses hip.dll in the first-pass and not in the second pass. See log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using hip.dll v1.19 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:44:35.

BeSweet.dll -core( -input mpainput -output testmp3.mp2 -logfile testmp3.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: testmp3.mp2
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:000] Stream error : Sync found after 126 bytes
[00:00:00:106] Conversion Completed !
[00:00:04:000] <-- Transcoding Duration

Logging ends : 05/18/03 , 13:44:39.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:44:51.

BeSweet.dll -core( -input mpainput -output testmp3.mp2 -logfile testmp3.txt ) -ota( -r 960 1001 -g 1.15 ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:04:000] +------- BeSweet -----
[00:00:04:000] | Input : mpainput
[00:00:04:000] | Output: testmp3.mp2
[00:00:04:000] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.214dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------

ac3burst: got an access violation in the second pass because your dll uses azid.dll in the first-pass and not in the second pass. See log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:49:02.

BeSweet.dll -core( -input ac3input -output tfm.mp2 -logfile tfm.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: tfm.mp2
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:032] Stream error : Sync found after 334 bytes
[00:01:19:456] Conversion Completed !
[00:00:03:000] <-- Transcoding Duration

Logging ends : 05/18/03 , 13:49:05.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:49:22.

BeSweet.dll -core( -input ac3input -output tfm.mp2 -logfile tfm.txt ) -ota( -r 960 1001 -g 5.88 ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:03:000] +------- BeSweet -----
[00:00:03:000] | Input : ac3input
[00:00:03:000] | Output: tfm.mp2
[00:00:03:000] | Floating-Point Process: No

Hope this is of some kind of use to you.

TFM_TheMask
18th May 2003, 19:12
Hi DSPguru

I don't know if you read my last post but I found a little bit more on the mp2enc error.

I did a 2-pass with the pcm function with a full commandline with -2lame in it. The first pass went correctly, the logfile even said that it uses mp2enc. Only the second pass gave me a floating point error. See log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/18/03 , 20:00:07.

BeSweet.dll -core( -input pcminput -output testpcm.mp2 -logfile testpcm.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -2lame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : pcminput
[00:00:00:000] | Output: testpcm.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[01:45:50:575] Conversion Completed !
[00:02:33:000] <-- Transcoding Duration

Logging ends : 05/18/03 , 20:02:41.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/18/03 , 20:03:32.

BeSweet.dll -core( -input pcminput -output testpcm.mp2 -logfile testpcm.txt ) -ota( -r 960 1001 -g 1.18 ) -shibatch( --rate 44100 ) -2lame( -m s -b 224 -e )

[00:02:33:000] +------- BeSweet -----
[00:02:33:000] | Input : pcminput
[00:02:33:000] | Output: testpcm.mp2
[00:02:33:000] | Floating-Point Process: Yes
[00:00:00:000] | Overall Track Gain: 1.438dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------

DSPguru
18th May 2003, 19:22
10q, TFM. sorry, i'm currently short in time, but didn't forget this thread.

* maybe there's a problem with mp2enc.dll dependencies with the dlls on your computer.

ps,
get the latest dll binary from my webpage.

TFM_TheMask
18th May 2003, 19:29
I used your latest dll I think in the latest test (v1.5b18).

Can you tell me what your dll is doing different in the first pass, because then everything with mp2enc works fine.

I also tried mp2enc on a different computer at work. Same floating point error.

By the way the timestamp of mpaburst works fine now.

Thanks

Rainy
20th May 2003, 00:37
Hi DSPGuru,
how do I init BeSweet if I have static commandline parameters? I've tried something like this, but the application simply crashes
HMODULE m_hDLL = LoadLibrary("BeSweet.dll");
BeSweet = (BESWEET)GetProcAddress(m_hDLL,"BeSweet");

char* szParam[] = {"-core( -input testcase.wav -output test.mp2 -logfile test.txt )"};
BeSweet(/*dunno what to put here*/,szParam);

DaveEL
20th May 2003, 17:43
Originally posted by Rainy
Hi DSPGuru,
how do I init BeSweet if I have static commandline parameters? I've tried something like this, but the application simply crashes
HMODULE m_hDLL = LoadLibrary("BeSweet.dll");
BeSweet = (BESWEET)GetProcAddress(m_hDLL,"BeSweet");

char* szParam[] = {"-core( -input testcase.wav -output test.mp2 -logfile test.txt )"};
BeSweet(/*dunno what to put here*/,szParam);

I guess(ive never used besweet.dll) this is what you want.
szParam[] = {"-core(", "-input", "testcase.wav", "-output", "test.mp2", "-logfile", "test.txt", ")"};
BeSweet(8,szParam);

DaveEL

Rainy
21st May 2003, 20:45
Thanks for reply DaveEL, but that wasnt the problem. After reading the thread over and over, I realised I need to put BeSweet.dll in front of the -core parameter. DSPGuru didn't mention anything about it in his example.

But now I've got an another problem: Besweet is unable to open my input file, the log says:
BeSweet v1.5b18 by DSPguru.
--------------------------
Error 57: Error opening "testcase.wav".
Quiting...
[00:00:00:000] Conversion Completed !

Logging ends : 05/21/03 , 21:39:22.

and here's my code:#include <stdio.h>
#include <windows.h>
#include "besweet.h"

int main(void) {
char szBuffer[2000];

HMODULE hDLL = LoadLibrary("BeSweet.dll");

if (!hDLL)
return 0;

BESWEET InitBesweet = (BESWEET)GetProcAddress(hDLL,"BeSweet");
BURSTS InitAc3 = (BURSTS)GetProcAddress(hDLL,"AC3_Bursts");
BURSTS InitMpa = (BURSTS)GetProcAddress(hDLL,"MPA_Bursts");
BS_Record InitInfo;

FILE* pInput = fopen("testcase.wav","rb");

char* szParam[] = {"BeSweet.dll","-core(","-input","testcase.wav","-output",
"test.mp3","-logfile ","BeSweet.txt",")",
"-ota(","-d","0","-G","max",")","-lame(",
"--alt-preset","128","--scale","1",")",
"-ssrc(","--rate","44100",")"};

int nArgc = sizeof(szParam)/4;

InitBesweet(nArgc,szParam);
int nCount = 1;

while(nCount) {
nCount = fread(szBuffer,1,2000,pInput);
InitInfo = InitAc3(nCount,szBuffer);

if (!InitInfo->err)
printf("Transcoding...");
}
}

TFM_TheMask
21st May 2003, 22:13
Hi,

If you are using Ac3Burst you must put ac3input as input parameter and not "testcase.wav", so it must be like this:

char* szParam[] = {"BeSweet.dll","-core(","-input","ac3input","-output", "test.mp3","-logfile ","BeSweet.txt",")",
"-ota(","-d","0","-G","max",")","-lame(","--alt-preset","128","--scale","1",")", "-ssrc(","--rate","44100",")"};

This way the dll knows that after you pass the arguments there is a function call to ac3burst.

The rest seems ok.

Rainy
21st May 2003, 22:18
Wow, thank you very much! It works now! :)
Btw, I see there are some other export functions (that aren't documented?) like InputPCM16S_Bursts, what parameter should I replace instead of ac3input?

/Edit:
Ok, I got it - pcminput :)

TFM_TheMask
22nd May 2003, 07:50
Question for Rainy.

Could you try it with -2lame instead of -lame, because I have some trouble with mp2enc.dll. Want to check if it is my fault or a general one. You can try one of my commands that I spoke about in an earlier post. Please post your logfile here afterwards.

Thanks.

Rainy
22nd May 2003, 15:25
Hi,
this is what I've got:
BeSweet v1.5b18 by DSPguru.
--------------------------
Using MP2enc.dll v1.129 (23/5/2002), Engine 1.129 <http://www.cdex.n3.net>.

Logging start : 05/22/03 , 16:26:11.

BeSweet.dll -core( -input pcminput -output test.mpa -logfile BeSweet.txt ) -2lame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : pcminput
[00:00:00:000] | Output: test.mpa
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
Dunno though why the completion time isn't shown

TFM_TheMask
22nd May 2003, 16:36
Do you got an error or does it finish correctly?

If it finishes correctly you have to deinit the besweet.dll.
I don't know much about c++ but I think you have to do it like this:

strcpy(szParam[0], "deinit");
InitBesweet(nArgc,szParam);

and then free the library.

Rainy
22nd May 2003, 18:20
I dont get any errors and the file plays fine. :cool:

TFM_TheMask
22nd May 2003, 18:57
Thanks, now I know that there is a problem with my program.:mad:

Rainy
24th May 2003, 19:07
I have a problem with besweet.dll Whenever I want to convert a wave file to mp3, the sample rate is detected incorrectly and the playtime becomes shorter (the pitch is higher) Here's the log:
BeSweet v1.5b18 by DSPguru.
--------------------------
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/24/03 , 20:04:26.

BeSweet.dll -core( -input pcminput -output D:\test.mp3 -logfile D:\test.txt )
-lame( -m s -c -p -o -q 2 -b 192 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : pcminput
[00:00:00:000] | Output: D:\test.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP3 bitrate : 192
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:03:40:806] Conversion Completed !
[00:03:40:806] Actual Avg. Bitrate : 192kbps
[00:00:17:000] <-- Transcoding Duration

Logging ends : 05/24/03 , 20:04:43.
Sample rate of the source file is 44.1 KHz and not 48 KHz and the playtime of the original file is exactly 4:00 and after conversion it's only 3:40. I used PCM16S_Bursts. Can someone check it?

DSPguru
24th May 2003, 21:57
BeSweet.dll cannot detect the sample-rate as it have no access to the wavefile. use -ota( -fs 44100 )

TFM_TheMask
24th May 2003, 22:08
Hi DSPGuru,

Question about 2-pass

1. 2-pass with pcmburst
I tried as you said, first pass only -core commands and second pass the full commandline. I got a floating point error. I think this is because in the first pass different dll's are loaded by besweet as in the second pass. Seems that in the first pass your dll has to know which encoder it must use for the second pass. See the log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/15/03 , 14:47:03.

BeSweet.dll -core( -input pcminput -output testpcm.mp2 -logfile testpcm.txt )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : pcminput
[00:00:00:000] | Output: testpcm.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP3 bitrate : 128 pass 1
[00:00:00:000] | Channels Mode : Joint Stereo
[00:00:00:000] | Error Protection: No
[00:00:00:000] +---------------------
[00:05:00:504] Conversion Completed !
[00:05:00:504] Actual Avg. Bitrate : 0kbps
[00:00:02:000] <-- Transcoding Duration

Logging ends : 05/15/03 , 14:47:05.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using MP2enc.dll v1.11 (0/0/1999), Engine 1.11 <http://www.cdex.n3.net>.

Logging start : 05/15/03 , 14:47:10.

BeSweet.dll -core( -input pcminput -output testpcm.mp2 -logfile testpcm.txt ) -ota( -r 960 1001 -g 1.15 ) -shibatch( --rate 44100 ) -2lame( -m s -b 224 -e )

[00:00:02:000] +------- BeSweet -----
[00:00:02:000] | Input : pcminput
[00:00:02:000] | Output: testpcm.mp2
[00:00:02:000] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.214dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz pass 2
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------- MP2ENC ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------

Then I used the full command in the first and second pass and used the peak from the first pass. It worked perfect.

At this time I only used pcmburst with -toolame, -ota and -shibatch.


2. 2-pass with ac3burst and mpaburst.

mpaburst: got an access violation in the second pass because your dll uses hip.dll in the first-pass and not in the second pass. See log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using hip.dll v1.19 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:44:35.

BeSweet.dll -core( -input mpainput -output testmp3.mp2 -logfile testmp3.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: testmp3.mp2
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC -------- pass 1
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:000] Stream error : Sync found after 126 bytes
[00:00:00:106] Conversion Completed !
[00:00:04:000] <-- Transcoding Duration

Logging ends : 05/18/03 , 13:44:39.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:44:51.

BeSweet.dll -core( -input mpainput -output testmp3.mp2 -logfile testmp3.txt ) -ota( -r 960 1001 -g 1.15 ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:04:000] +------- BeSweet -----
[00:00:04:000] | Input : mpainput
[00:00:04:000] | Output: testmp3.mp2
[00:00:04:000] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.214dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC -------- pass 2
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------

ac3burst: got an access violation in the second pass because your dll uses azid.dll in the first-pass and not in the second pass. See log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:49:02.

BeSweet.dll -core( -input ac3input -output tfm.mp2 -logfile tfm.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: tfm.mp2
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC -------- pass 1
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:032] Stream error : Sync found after 334 bytes
[00:01:19:456] Conversion Completed !
[00:00:03:000] <-- Transcoding Duration

Logging ends : 05/18/03 , 13:49:05.


BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/18/03 , 13:49:22.

BeSweet.dll -core( -input ac3input -output tfm.mp2 -logfile tfm.txt ) -ota( -r 960 1001 -g 5.88 ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:03:000] +------- BeSweet -----
[00:00:03:000] | Input : ac3input pass 2
[00:00:03:000] | Output: tfm.mp2
[00:00:03:000] | Floating-Point Process: No

How can I solve this.

DSPguru
24th May 2003, 22:15
do you deinit between passes ?

TFM_TheMask
24th May 2003, 22:23
Yes, I quess that's wrong?

TFM_TheMask
24th May 2003, 22:49
Ok, now it's working.

1. Question: you use to get the maximum gain the formula -20 * log10(info.peak) in the first pass. What formula do you use in the second pass to set the maximum gain.

2. I used the same file with the same commands with besweet.exe and besweet.dll. With besweet.exe no problems, but with besweet.dll I got a stream error, sync found after 126 bytes. I use a vbrmp3 with mpaburst. What am I doing wrong. Here the logs.


BeSweet v1.5b17 by DSPguru.
--------------------------
Using hip.dll v1.19 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/24/03 , 23:33:14.

BeSweet.exe -core( -input test.wav -output test.mp2 -logfile test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : test.wav
[00:00:00:000] | Output: test.mp2
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.171dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:05:00:706] Conversion Completed !
[00:05:00:706] Actual Avg. Bitrate : 214kbps
[00:00:44:000] <-- Transcoding Duration
Logging ends : 05/24/03 , 23:33:58.

BeSweet v1.5b18 by DSPguru.
--------------------------
Using hip.dll v1.19 by Myers Carpenter <myers@users.sf.net>
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/24/03 , 23:38:22.

BeSweet.dll -core( -input mpainput -output test.mp2 -logfile test.txt ) -ota( -r 960 1001 -g max ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : mpainput
[00:00:00:000] | Output: test.mp2
[00:00:00:000] | Floating-Point Process: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 05/24/03 , 23:38:39.

BeSweet.dll -core( -input mpainput -output test.mp2 -logfile test.txt ) -ota( -r 960 1001 -g 1.17 ) -shibatch( --rate 44100 ) -toolame( -m s -b 224 -e )

[00:05:00:528] +------- BeSweet -----
[00:05:00:528] | Input : mpainput
[00:05:00:528] | Output: test.mp2
[00:05:00:528] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: 1.364dB
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- FRC --------
[00:00:00:000] | Source Frame-Rate: 960
[00:00:00:000] | Dest. Frame-Rate: 1001
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:024] Stream error : Sync found after 126 bytes
[00:05:00:618] Conversion Completed !
[00:05:00:618] Actual Avg. Bitrate : 214kbps
[00:00:40:000] <-- Transcoding Duration

Logging ends : 05/24/03 , 23:39:19.

Rainy
25th May 2003, 04:27
another problem
after transcoding ac3 to mp3, the playback is jerky and the pitch is very low, what's wrong?
BeSweet v1.5b18 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/25/03 , 05:20:53.

BeSweet.dll -core( -input ac3input -output D:\test.mp3 -logfile BeSweet.txt )
-azid( -n1 -L -3db -s stereo -c normal ) -ota( -G max ) -lame( --alt-preset 128 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: D:\test.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | PostGain normalize to : 0.97
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Stereo
[00:00:00:000] | Total Gain: 10.000dB, Compression: Normal
[00:00:00:000] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: Yes
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | 'abr 128' preset is used
[00:00:00:000] +---------------------
[00:19:22:700] Gain of 4.5dB had been asserted to file.
[00:19:22:700] Conversion Completed !
[00:19:22:700] Actual Avg. Bitrate : 216kbps
[00:05:57:000] <-- Transcoding Duration

Logging ends : 05/25/03 , 05:26:50.

Rainy
27th May 2003, 16:06
Ok, I've found the problem - the postgain switch was causing jerky and low pitched playback. Here's the log from the bad sample:
BeSweet v1.5b18 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/27/03 , 17:01:57.

BeSweet.dll -core( -input ac3input -output D:\test.mp3 -logfile D:\test.txt ) -azid( -n1 -L -3db -s surround -c normal ) -ota( -G max ) -lame( --alt-preset 128 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: D:\test.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | PostGain normalize to : 0.97
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 10.000dB, Compression: Normal
[00:00:00:000] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: Yes
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | 'abr 128' preset is used
[00:00:00:000] +---------------------
[00:02:25:443] Gain of 12.0dB had been asserted to file.
[00:02:25:443] Conversion Completed !
[00:02:25:443] Actual Avg. Bitrate : 212kbps
[00:00:37:000] <-- Transcoding Duration

Logging ends : 05/27/03 , 17:02:34.

The lenght after transcoding was 4:49
and here's the good one:
BeSweet v1.5b18 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 05/27/03 , 16:56:26.

BeSweet.dll -core( -input ac3input -output D:\test3.mp3 -logfile D:\test3.txt ) -azid( -n1 -L -3db -s surround -c normal ) -ota( -g 12db ) -lame( --alt-preset 128 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: D:\test3.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Overall Track Gain: 12.000dB
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: Normal
[00:00:00:000] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: Yes
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | 'abr 128' preset is used
[00:00:00:000] +---------------------
[00:02:25:152] Conversion Completed !
[00:02:25:152] Actual Avg. Bitrate : 124kbps
[00:00:25:000] <-- Transcoding Duration

Logging ends : 05/27/03 , 16:56:51.

Lenght 2:24

sezz
31st May 2003, 11:07
What XYZbursts and XYZinputs are available?

I've read all postings on this thread and this is what I've found out:

-input Burst Inputfiletype
------------------------------------------
ac3input AC3_Burst ac3
mpainput MPABurst wav, vbrmp3
pcminput PCM16S_Bursts wav


1. Is this correct? What about all the other file types?

2. If the input file is a wave file I have to find out the sample rate and and call BeSweet() with -ota ( -fs THESAMPLERATE )?

Rainy
31st May 2003, 16:21
AC3_Bursts, MPA_Bursts, NO_Bursts, NoOutput, PCM166_Bursts, PCM16M_Bursts, PCM16S_Bursts, PCM8S_Bursts, PCM8M_Bursts

That's all I can see in the DLL. Just use a hex-editor, open the dll and scroll to the end and you'll see all export functions

sezz
31st May 2003, 16:25
Thanks, but what X_Bursts for what filetype?

Rainy
31st May 2003, 16:39
Ac3 bursts - ac3input
Mpa bursts - mpainput
Pcmxx bursts - pcminput
e.g. PCM8M_Bursts is used for a 8 bit mono wave file (pcminput switch) Didn't test it tho... ;) But it should be right, I think

EDIT:
Mpa bursts is used for mp3 input files also, don't hit me if I'm wrong :o

DSPguru
31st May 2003, 19:21
Originally posted by TFM_TheMask
Ok, now it's working.share your experience. what did you change ?

1. Question: you use to get the maximum gain the formula -20 * log10(info.peak) in the first pass. What formula do you use in the second pass to set the maximum gain.use the linear value 1/peak (-g 1.1442),
or either the logarithmic (-20*log10(info.peak)) value (-g 1.171db).


2. I used the same file with the same commands with besweet.exe and besweet.dll. With besweet.exe no problems, but with besweet.dll I got a stream error, sync found after 126 bytes. I use a vbrmp3 with mpaburst. What am I doing wrong. Here the logs.nothing is wrong! it's ok.

Originally posted by Rainy
When I transcode a Wav file to Mp3 and then play it, at the start I hear a loud click. This doesnt occur when I transcode a Ac3 or Mp2 file to Mp3, what could be the problem?you probably didn't ignore the wave header (its size is usually 44bytes) and fed it as pcm burst to BeSweet.dll.

@Rainy
please print the BeSweet.dll version in your tool, and add an active link to my webpage. that's part of the BeSweet.dll's humble license :).

GZZ
1st June 2003, 09:48
DSPguru is it possible just to use Besweet as a player for Vob/Ac3 files, so you don't transcode, but just decode and listen to the sound. I working on something where I need a player to play the vob/ac3 sound, at the moment I use some directX in delphi, but directshow is not always the best I think. So if besweet could play vob/ac3 sound it will be cool. I saw the Play ac3 button in the GUI for besweet, but I never got it working.


Please advise

GZZ

DSPguru
1st June 2003, 10:07
you can use BeSweet to decode audio to wav/pcm and then send the decoded samples to your soundcard (using libsnd or something..).


edit : you can even write a winamp plugin based on BeSweet.dll ..

TFM_TheMask
1st June 2003, 10:59
1)
quote:
--------------------------------------------------------------------------------
Originally posted by DSPGuru
share your experience. what did you change ?
--------------------------------------------------------------------------------

What I did wrong was that I used "deinit" between the two passes.

what I am doing now is:

1. Run first pass with full commands and -g max
2. Change -g max with max gain found
3. Run second pass with full commands and -g with calculated value from first pass.
4. DeInit
5. Free library

2) Because I use audio from AVI's I now use besplit to correct the headers before the real transcoding. Is this the best way to do this? Now I don't get the stream sync error.

Is it also possible to feed the whole AVI file (with use of vobinput.dll) to your dll?

3) mp2enc.dll problem.
I tried with my little knowledge of C++ to use your dll with a program written in C++. If I use mp2enc know it is working and when I use it in Delphi 7 it is giving me an error.

I find this a little bit strange. In delphi 7 all commands work only the mp2enc commands not. Could It be the delphi 7 compiler in combination with mp2enc?

Is there someone who uses delphi and has no problems with mp2enc?
Please let me know.

Thx

DSPguru
1st June 2003, 18:35
2) it's either BeSplit reports the stream error or either BeSweet. i would avoid the usage of BeSplit.

2b) no, there's no aviburst function.

TFM_TheMask
1st June 2003, 22:09
New problem

I'm using these commands with the BeSweet.dll:

-azid( -L -3db -c normal -s surround2 -g max ) -toolame( -e -b 224 -m s )

Now the dll gives an error 11, see log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Error 11: Cannot register settings for azid
Quiting...
[00:00:00:000] Conversion Completed !

Logging ends : 06/01/03 , 23:01:18.

What am I doing wrong, it works with besweet.exe?

Rainy
2nd June 2003, 01:22
I have the same problem when using the surround2 switch. The log reports the same error number, like in the TFM_TheMask's

@DSPGuru
Sorry, I totally forgot about printing the besweet version in my tool, but ill add it asap :)

DSPguru
2nd June 2003, 03:35
yea, i removed the surround2 support, as it is being integrated inside azid v1.9 .

TFM_TheMask
11th June 2003, 17:55
Question for DSPGuru

I am implementing the two pass method in my program but there is a problem. I can't free the library. If my program is still active the transcoded audio file seems to be locked or something. What I do is this:

1. Run first pass with full commands and -g max
2. Change -g max with max gain found
3. Run second pass with full commands and -g with calculated value from first pass.
4. DeInit
5. Free library

If I use the one pass method and deinit your dll it unlocks the transcoded audiofile. So this workes fine.

I tried to deinit your dll twice (because the 2 runs) but then I get a error from shibatch.dll.

When I close my program than the transcoded audiofile is unlocked.

Is this a known issue?

DSPguru
13th June 2003, 11:29
you shouldn't use the full command in the first pass. we discussed it already...

TFM_TheMask
13th June 2003, 13:10
I know we discussed it but this also doesn't work!

When I use only -core arguments in the first pass then your dll uses azid.dll and lame_enc.dll (see log) while in the second pass I use toolame.dll.

So know I think the maximum gain found is not correct because when your dll saves the transcoded file in the second pass I hear nothing.

And still I can't free your library and the file is locked after deinit and free library.

Here is the log:

BeSweet v1.5b18 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 06/13/03 , 13:56:59.

BeSweet.dll -core( -input ac3input -output E:\THEFIL~1\PROGRA~1\Output\TFM_Encoded_Audio.mp2 -logfile E:\THEFIL~1\PROGRA~1\Output\TFM_Encoded_Audio.log )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: E:\THEFIL~1\PROGRA~1\Output\TFM_Encoded_Audio.mp2
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP3 bitrate : 128
[00:00:00:000] | Channels Mode : Joint Stereo
[00:00:00:000] | Error Protection: No
[00:00:00:000] +---------------------
BeSweet v1.5b18 by DSPguru.
--------------------------
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using tooLame.dll v0.2l (Apr 24 2003) by Mike Cheng <http://tooLame.sf.net>

Logging start : 06/13/03 , 13:57:03.

BeSweet.dll -core( -input ac3input -output E:\THEFIL~1\PROGRA~1\Output\TFM_Encoded_Audio.mp2 -logfile E:\THEFIL~1\PROGRA~1\Output\TFM_Encoded_Audio.log ) -ota( -fs 48000 -g -74,823db ) -shibatch( --rate 44100 ) -toolame( -e -b 224 -m s )

[00:01:19:456] +------- BeSweet -----
[00:01:19:456] | Input : ac3input
[00:01:19:456] | Output: E:\THEFIL~1\PROGRA~1\Output\TFM_Encoded_Audio.mp2
[00:01:19:456] | Floating-Point Process: No
[00:00:00:000] | Overall Track Gain: -74.823dB
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +------ tooLame ------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP2 bitrate : 224
[00:00:00:000] | Channels Mode : Stereo
[00:00:00:000] | Error Protection: Yes
[00:00:00:000] +---------------------
[00:00:00:032] Stream error : Sync found after 334 bytes
[00:01:19:456] Conversion Completed !
[00:01:19:456] Actual Avg. Bitrate : 224kbps
[00:00:15:000] <-- Transcoding Duration

Logging ends : 06/13/03 , 13:57:18.

Can you help me out?

TFM_TheMask
19th June 2003, 16:58
Ok, I have got the 2 pass running but I think it is not the best way to do it, but I don't know any other way (Somebody)?

What I do now is:

1. Run first pass with full commands and -g max and NoOutput
2. DeInit
3. Free Library
4. Change -g max with max gain found
5. Run second pass with full commands and -g with calculated value from first pass.
6. DeInit
7. Free library

Now the file is not locked and can be processed further in my program.

By the way when is the release of the new azid version 1.9?

wangchong7
18th November 2003, 06:48
Such as NO_Bursts and NoOutput?

BTW//:Can I send the sream ripped from the dvd to the dll *directly*?
Can I get the data that has been transcoded *directly*, that means must I save the transcoded data into a file?

DSPguru
18th November 2003, 18:16
1. NO_Bursts is useless.
2. NoOutput is useful to neutralize the encoder on the first-pass when implementing two-pass. this saves the encoder time.
3. yes. you can send the demuxed ac3 stream from the dvd directly to BeSweet.dll.
4. yes. you can set a callback function using SetWriteRoutine. the callback functiow will recieve the transcoded data, and BeSweet.dll will not write to file. the callback function's prototype is :
int CallBack(const void* buffer,size_t size);


Cheers,
Dg.

UMP
1st December 2003, 16:43
Hello DSPguru,

since several projects using besweet.dll are under development, I was wondering the following :

despite what the readme.txt states, would it be possible to use besweet.dll in a public software (say FairUse) even through it is still in a beta state, or should it be used for private experimentation only until the stable release it out ?

Thank you for your time and work,

ump

DSPguru
1st December 2003, 18:43
Originally posted by UMP
despite what the readme.txt states, would it be possible to use besweet.dll in a public software (say FairUse) even through it is still in a beta state, or should it be used for private experimentation only until the stable release it out ?the readme states that developers should contact me to get my permission, while the list of requirments is a list of stuff that when fullfilled - has better chance to get my permission.

if you find the v1.4 stable dll not mature enough for fairuse, please send me a private message.. :)

UMP
2nd December 2003, 03:55
There is no urgence in integrating besweet.dll into FU. I have some other stuff to deal with before it's worth to use besweet.dll, that should keep me busy for a while...

BTW, I think I got the point about the list of requirements.

Thanks again,

ump

UMP
19th December 2003, 04:09
I'm doing some internal testing on besweet.dll (1.5b23) and I'm experiencing several problems :

1. The code below prints a changing error code at each iteration, but the final mp3 file plays fine ?

info = _AC3_Bursts(aiu.length, (char *)data);
if (info->err)
_Diagnostic("Error %d\n", info->err);

The output looks like this :

(...)
Error 1138104942
[00:00:05:536] transcoding! Max gain : 0.3dB
Error 1135788864
[00:00:05:568] transcoding! Max gain : 0.3dB
Error 1134617819
[00:00:05:600] transcoding! Max gain : 0.3dB
Error 1133325462
[00:00:05:632] transcoding! Max gain : 0.3dB
Error 1135248727
(...)

Here is the log file :

BeSweet v1.5b23 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using lame_enc.dll v1.28 (4/6/2002), Engine 3.92 <http://www.mp3dev.org/>.

Logging start : 12/19/03 , 03:52:16.

besweet.dll -core( -input ac3input -output f:\test.mp3 -logfile f:\BeSweet.txt ) -ota( -d 0 -g 12db ) -lame( --alt-preset 128 --scale 1 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: f:\test.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | Overall Track Gain: 12.000dB
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 0.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -INF, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: No
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | 'abr 128' preset is used
[00:00:00:000] +---------------------
[00:00:20:000] Conversion Completed !
[00:00:20:000] Actual Avg. Bitrate : 130kbps
[00:01:03:000] <-- Transcoding Duration

Logging ends : 12/19/03 , 03:53:19.

2. Using the -G max switch leads to a 'double-time' mp3 file that plays two times slower than it should.

3. I'm blind : I was unable to find besweet.dll v1.4 anywhere on your site ?

Thank you,

ump

DSPguru
19th December 2003, 08:55
1+2 : where do i find your source-code so i can debug ?

3 : http://DSPguru.doom9.org/BeSweetv1.4DLL.zip
but unlike the stable BeSweet.exe v1.4, which v1.5bX is "better" mainly in sense of new features, BeSweet.dll v1.4 has some bugs.

UMP
19th December 2003, 10:41
I uploaded the latest snapshot at http://fairuse.free.fr/fu034src.zip

The concerned code is in DecodeAudioAc3Writer::Process() at the end of DecodeAudio.cpp

I gave the 1.4 DLL a try, but it hangs with an access violation during the encoding steps.

Output from besweet.dll 1.4

(...)
[00:00:01:056] transcoding! Max gain : 3.4dB
Error 1133767874
[00:00:01:088] transcoding! Max gain : 3.4dB
Error 1131649014
[00:00:01:120] transcoding! Max gain : 3.4dB
Error 1129261098
[00:00:01:152] transcoding! Max gain : 3.4dB
Error 1130835722
[00:00:01:184] transcoding! Max gain : 3.4dB
Error 1129369632
[00:00:01:216] transcoding! Max gain : 3.4dB
Error 1130837912
[00:00:01:248] transcoding! Max gain : 3.4dB
Error 1127760152
(...)

ump

EDIT : after some further testing, it appears that the problem is not to use -G, but to NOT use -g !

besweet.dll seems to want a -g ndb option, n <> 0.

EDIT2 : DX SDK must be installed, and the source should be compiled using VS.Net.

UMP
31st December 2003, 04:01
Well,

I finally found that the "-G max" switch will work as intended if "-ssrc( --rate 44100 )" switch is used. The other bugs are still there through.
I compiled the example2.c code and experienced exactly the same symptoms, which means there is no need to download/compile the FU source for testing. Maybe the problem is the AC3 source file... Here is a sample AC3 file that I use for testing : http://fairuse.free.fr/ac3audio.ac3

Another problem is that deinit hangs when transcoding to vorbis. Here is the log file :

BeSweet v1.5b23 by DSPguru.
--------------------------
Using azid.dll v1.8 (b825) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.2 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using Ogg Vorbis v1.0 dlls (http://www.vorbis.com).

Logging start : 12/31/03 , 03:49:42.

besweet.dll -core( -input ac3input -output F:\DVD\test.session-00.audio-00.ogg -logfile f:\BeSweet.txt ) -ota( -d 0 -G max ) -ogg( -b 128 ) -azid( -L -3db -c normal -n 1 ) -ssrc( --rate 44100 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: F:\DVD\test.session-00.audio-00.ogg
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | PostGain normalize to : 0.97
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 10.000dB, Compression: Normal
[00:00:00:000] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: Yes
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- OGG --------
[00:00:00:000] | Avarege Bitrate : 128
[00:00:00:000] +---------------------
[00:00:14.581] W7: Downmix overflow (0: +0.6dB)
[00:00:15.285] W7: Downmix overflow (0: +0.1dB)

UMP
14th January 2004, 02:08
Hello DSPGuru,

I don't mean to bug you with this, but I was just wondering if you had some time to investigate this issue, or at least were you able to reproduce this behaviour ?
I did some simple testing with your exemple2.c to transcode AC3 to OggVorbis resulting in the same hang on deinit using the following AC3 file : http://fairuse.free.fr/ac3audio.ac3

Thank you very much for your tools and time :)

Cheers,

ump

DSPguru
16th January 2004, 20:54
i'm sorry for not having the time to code or even debug, but that was expected (http://forum.doom9.org/showthread.php?s=&threadid=49693).

my update is that i failed to reproduce the error :
Using azid.dll v1.9 (b921) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.24 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using Ogg Vorbis v1.0 dlls (http://www.vorbis.com).

Logging start : 01/16/04 , 23:51:28.

test.exe -core( -input ac3input -output e:\ac3tomp3\test.ogg -logfile e:\ac3tomp3\BeSweet.txt ) -ota( -d 0 -G max ) -ogg( -b 128 ) -azid( -L -3db -c normal -n 1 ) -ssrc( --rate 44100 )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : ac3input
[00:00:00:000] | Output: e:\ac3tomp3\test.ogg
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | PostGain normalize to : 0.97
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Output Stereo mode: Dolby surround compatible
[00:00:00:000] | Total Gain: 10.000dB, Compression: Normal
[00:00:00:000] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: Yes
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] +------ Shibatch -----
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] | Dest. Sample-Rate: 44.1KHz
[00:00:00:000] | Attenuation : 0.0db
[00:00:00:000] +-------- OGG --------
[00:00:00:000] | Avarege Bitrate : 128
[00:00:00:000] +---------------------
[00:00:20:000] Gain of 1.3dB had been asserted to file.
[00:00:20:000] Conversion Completed !
[00:00:20:000] Actual Avg. Bitrate : 127kbps
[00:00:15:000] <-- Transcoding Duration

Logging ends : 01/16/04 , 23:51:43.

UMP
17th January 2004, 16:13
i'm sorry for not having the time to code or even debug, but that was expected.
Well, I am sorry for bothering you with this.

Anyway, I really appreciated your reply, since I noticed from your log that I was not using the same DLL versions for azid.dll and Shibatch.dll.
So I updated my DLLs, and finally got the thing to work after a few testing. It finally appears that :

1. there is no need to allocate a buffer before/after the actual data
2. when encoding to OggVorbis, deinit hangs when the app is ran from the IDE (VS.Net) BUT everything works fine if the exe is launched alone ! It seems the problem lies somewhere in vorbis.dll through.

So my problem to vorbis encoding is finally "solved". Thanks a lot for your support and patience :)

Best regards,

ump

DSPguru
17th January 2004, 22:06
glad to hear !

keep it up,
Dg.

wangchong7
3rd March 2004, 10:20
4. yes. you can set a callback function using SetWriteRoutine. the callback functiow will recieve the transcoded data, and BeSweet.dll will not write to file. the callback function's prototype is :

Can you give me a detail explanation? Where to use the SetWriteRoutine, and should I change some other parameters? How to define the "output" in the ARGV[]? If you can give me an example , I'll thank you very much!

DSPguru
5th March 2004, 13:44
this might help you :
http://forum.doom9.org/showthread.php?s=&threadid=36942&perpage=40&pagenumber=6

TFM_TheMask
13th September 2005, 20:39
Hi DSPGuru,

I hope that you will still visite this forum sometimes.

Wouldn't it be an idea that when you release a new version of the exe that you also release that version as dll. This because most of the times new additions or bug fixes are also needed in the dll. Also this enables dll users to implement new functions in the apps that use the besweet.dll.

I have seen that you released version 1.5b31 of the exe and I hope you will find the time to release that version as dll also.

Thanks for your great tool and help you gave me untill now.

winnydows
14th April 2006, 22:42
Anybody can help me please ?
How use BeSweet.dll from Visual Basic 8. May be short example can help me.