Log in

View Full Version : AC3->MP3 without intermediate files?


Pages : [1] 2 3 4 5

Boost
14th October 2001, 13:16
Hi!

I'm used to the Linux way of doing things. But is there a way of converting AC3 directly to MP3? Is piping really supported under Windows 2000? I mean I would like to do something like:
azid movie.ac3 - | lame - out.mp3

Is this possible or is it on it's way?

LigH
27th October 2001, 15:22
I would be impressed if that would work - as far as I know, all Windows versions simulate such pipelining by writing the output to a temporary file; windows programs started with a command line pipe don't run at the same time, they run after each other.

ohliuv
27th October 2001, 23:25
you may consider using graphedit

Shabubu
29th October 2001, 21:23
Graphedit is the way to go, worked fine for me doing that anyway (though you wouldn't be using azid)

LigH
30th October 2001, 09:35
If someone could write an application which streams the output from the Azid decoder DLL to the LAME MP3 encoder DLL, then this conversion shall be easy. DarkAvenger has some experience with the Azid DLL (he used it in HeadAC3he), and the LAME DLL is well documented.

DSPguru
30th October 2001, 13:33
please remind me of where i can find the lame.dll and its' documentation.
i really don't have spare time, but if i'd find it easy, i'll do it.

LigH
30th October 2001, 14:19
You'll find Win32 LAME binaries at http://mitiok.cjb.net or http://mitiok.ma.cx; the ZIP archive of version 3.89beta contains a folder named "html", there you'll find a document called "LameDLLInterface.htm".

Unfortunately, for the Azid.dll I couldn't find such a documentation - DarkAvenger shall know a bit about it, I hope. I'll try to ask him.

Wish you much luck...

DarkAvenger
30th October 2001, 14:52
In fact I wanted to add mp3 support in HeadAc3he, but right now I am a bit short in time, so development is temporarily frozen...

mpucoder
30th October 2001, 15:11
Maybe there an issue here with the quality of the conversion, but why not use ac3dec or vob2audio?

DSPguru
2nd November 2001, 10:38
10q, i'll check it out... :)

DSPguru
2nd November 2001, 15:11
well, i did check it out and.. made it.
i wrote a tool named 'AC3toMP3' that does the above.

now, i don't have any webspace to publish it, boost/doom9, let me know if you want me to send it to your email.

LigH
2nd November 2001, 16:09
I would like to see that - in this board, you shall be able to attach it as a zip file to a reply (below the message and option fields you will find an "Attach file:" row, select the file from your local PC's harddisk before submitting).

Or simply send it to doom9 (you will find his mail address at the end of his "Contact" page); you'll notice soon if he wants to publish it.

DSPguru
2nd November 2001, 17:11
ok, check this out.

- this is the first version of AC3toMP3, so it doesn't support any switches regarding AC3 decoding nor MP3 encoding.
- i guess it has bugs. if you find any, let me know about it.
- if many people would find this program useful, i will continue developing it and will add more features.
- DanniDin, you are invited to add support to my prog in your GUI ;)

Attachment:
AC3toMP3.exe [inputfile.ac3] [outputfile.mp3]

enjoy ! :)



Download latest version: AC3toMP3 v0.7a (http://rilanparty.com/vbb/attachment.php?s=&attachmentid=114)

Huge
2nd November 2001, 17:33
This is cool... first observation is that it seems to be going at about 2x original speed on a PIII-1GHz. So a 2hr movie would be done in one hour. Memory usage is also tiny, less than 1MB

What parameters are you using right now for decode and encode?

Naturally, I have some requests for future builds :-)

1) Multi-threaded so SMP machines can make use of extra CPU's. Can you get one thread to decode the AC3 and pass to another thread doing the encoding to MP3?
2) Some kind of configuration for AC3 decoding and MP3 encoding. Even if it's a simple text file that has a line for the Azid parameters and another line for the Lame ones.

DanniDin
2nd November 2001, 22:01
- DanniDin, you are invited to add support to my prog in your GUI ;)
Not Bad DSPguru, Maybe I'll Add Support when You'll Add Switches ;)

Danni.

DSPguru
3rd November 2001, 06:55
@DanniDin
if i'll get many respones, i'll add switches.

than, your GUI could "decide" which program to execute : if the user sets only parameters to azid&lame, your GUI could run my program. if the users sets parameters to CLI, than it would execture azid+cli+lame.

anyway, if many ppl would find this proggy useful, i would integerate it with bbdmux & ssrc.
that way, it would do VOB->MP3 :
VOB ->
48khz ac3 ->
48Khz wav ->
44.1khz wav ->
44.1khz MP3.

all in one shot, without intermediate files!

i'll wait and see if doom9 would publish it in his news page.

NS
3rd November 2001, 08:36
thats an awesome idea...

things i'd like to see are...

- AZid commands like gain options and channel control (i.e lower the sub channel by 3db...)

- 48khz (isn't that what dvd is anywho) @ 96, 128, 160 kbits MP3 encoding

Top stuff..

DSPguru
3rd November 2001, 08:53
@NS

did you check the speed of current version ?

DanniDin
3rd November 2001, 21:07
@DSPguru

if i'll get many respones, i'll add switches.
Great :)

than, your GUI could "decide" which program to execute : if the user sets only parameters to azid&lame, your GUI could run my program. if the users sets parameters to CLI, than it would execture azid+cli+lame.
Exactly :)

Danni.

Taric25
5th November 2001, 02:05
@DSPGuru, Dannidin
Originally Posted by DSPGuru
if i'll get many respones, i'll add switches.
So, this is a positive response.:D Great program! I say this because it's fast. I was thinking, is it possible for you and Dannidin to work together to make multichannel AC3-> multichannel MP3 without intermediate files?;)

damjang
5th November 2001, 10:12
Good work! When you add the switches it will be great and if you add a demux will be the best...

damjang

Huge
5th November 2001, 15:17
While it would be awesome to be able to encode directly from VOB to MP3 I would still like the ability to encode from AC3 to MP3 too.

Huge

DSPguru
5th November 2001, 19:14
ok, with this good responses, it seems that i weren't wasting my time on a useless prog.

i will now start to add switches regarding azid.

what do you think about this idea :
all switches would be in the format :
azid -g0 switch would be AC3toMP3 -a+g0
lame -m j switch would be AC3toMP3 -l+mj
bbdmux would be -b+...
ssrc would be -s+...

@Huge
AC3toMP3 is only one program from a set of programs i were thinking about. (all in the 'Shuttle Shivers Project').
the vob-supported program would probably be called VOBtoAC3 ;)

@Taric25
1. I would love that DanniDin would make GUI for my programs. sure!
2. what do you mean by "multichannel AC3-> multichannel MP3 " ? are you talking about MP2 ?
3. would you/any1 be interesed in AC3to6WAVs program ?

next version would probably be released this weekend, when i have more of a free time.

DanniDin
5th November 2001, 19:31
@Taric25
We'll See How it Goes...

@DSPguru
How About:
azid -g0 switch would be MP3toAC3 -a(-g0)
lame -m j switch would be MP3toAC3 -l(-m j)
bbdmux would be -b(... )
ssrc would be -s(... )


Danni.

DSPguru
5th November 2001, 19:36
@Danni
I don't like this idea too much, 'cause dealing with the spaces (brackets-starts , brackets-ends) could give me a headache.
i prefer that all switches would be one word, and switches of different programs could be freely "interleaved".

anyway, we'll see the suggestions here and decide together.

DanniDin
5th November 2001, 19:44
@DSPguru
I Guess One Way or the Other One of Us will Get an Headache :)
That is the Easiest Way for Me to Add Support in My GUI without Rewriting Everything.

Danni.

pacohaas
5th November 2001, 22:10
Don't know if this is possible, but how about having switches based on their position in the command-line:

ac3tomp3 [azid commands] input.ac3 [lame commands] output.mp3

Then if you're thinking about adding bbdmux and ssrc, it could be something like this:

vobtomp3 [bbdmux commands] input.vob [azid commands] [ssrc commands] [lame commands] output.mp3

You shouldn't need the brackets as long as your program can decipher when azid commands stop and ssrc commands start, etc. Maybe something like this:

vobtomp3 [bbdmux commands] input.vob azid [azid commands] ssrc [ssrc commands] lame [lame commands] output.mp3

Also, the option to input a list of vob files might be useful. Personally, I prefer just to use ac3tomp3.

lastly, if you need someone to host the file, I'll be happy to host it if someone would email me the program because for some reason I've been unable to download it through this forum.

keep up the good work.

Boost
5th November 2001, 22:58
Woah!

What have I started! :D

Anyhow. I believe that there are standard libraries for dealing with command line switches. Getopt maybe is ported to windows. One way you could do it is to

1. Get the source for LAME and use it's command line parsing function

and

2. Release the source code of your program (AC3toMP3) and maybe license it in GPL (www.gnu.org)

Ok. So I am an open source fan... :cool:

Is all LAME options available though the DLL interface?

/ Fredrik

pacohaas
6th November 2001, 17:46
@Boost: yes all the lame options are available

oh, also, this question has been brought up many times before, it seems that this is just the first time anyone has thought to do anything about it other than say, "Get a bigger hard drive, they're real cheap right now".

here's the direct download link: AC3toMP3 (http://fairuse.releaseme.org/AC3toMP3.zip)

@DSPguru: just keep sending me new versions if you'd like me to keep that link up to date. Also, I tried your program using the LAME 3.90 dll (UPXed and non-UPXed) and it doesn't seem to like either one. Maybe you could look into that. thanks.

Edit: I just tried UPXing AC3toMP3.exe and it saves 36.64% and still worked on the ac3 file I tried. I know it's small already, but you might want to look into that for future versions.

DSPguru
9th November 2001, 11:25
download the new zip, and read switches.txt :

this file lists all switches for AC3toMP3 0.2a.
for now, all switches deals only with AC3 decoding (azid).
beware : azid switches are case-sensitive.

usage : AC3toMP3 [inputfile.ac3] [outputfile.mp3] [switches...]

Attachment deleted after 22 downloads (http://rilanparty.com/vbb/attachment.php?s=&attachmentid=63)

DanniDin
9th November 2001, 12:26
@DSPguru
Are You Going to Add Support for Spaces in the Switches?

That Way it will Work with:

1.) -c heavy -L 1db -l 2db -C 3db -S 4db -g 5db

and

2.) -cheavy -L1db -l2db -C3db -S4db -g5db

Danni.

DSPguru
9th November 2001, 12:52
@DanniDin
i don't see a reason to support spaces.
after all, i believe that 90% of the users would use a GUI to run my program, and the other 10% that won't use GUI are the skilled users who can easily follow the switches ruleZ.

so, Danni, will you support my prog in yOur GUI ?

i guess you mentioned that all switches are in the exact format of those outputed by your GUI. i did it on purpose, to make you life easier in case you decide to add support to my prog.

the switches syntax would be :
AC3toMP3 [inputfile.ac3] [outputfile.mp3] -azid( switches ) -lame( switches )

just like you suggested.

Huge
9th November 2001, 13:12
I'm just thinking ahead here. Is it going to be possible to include support to 'find the maximum gain' in this program, or the gui before converting the file?

Huge.

DSPguru
9th November 2001, 13:34
i can add this feature if i do something like this :
{
m=0;i=0;
while !(eof)
m=max(m,abs(decode_ac3_frame(i++)));
}

and then :
{
i=0;
while !(eof)
lame(azid(frame[i++])/m)
}

this mode would be slower, but would work.

any1 interested ?

DanniDin
9th November 2001, 13:35
@DSPguru

The GUI Always Uses Spaces Except for Boolean Switches Like -z1 -b1...

The Command-Line Parsing Code I Added to the GUI Uses the Spaces to Split the Line.

ie:

"-c heavy -L 1db -l 2db -C 3db -S 4db" is Splitted to

01. "-c"
02. "heavy"
03. "-L"
04. "1db"
05. "-l"
06. "2db"
07. "-C"
08. "3db"
09. "-S"
10. "4db"

After Checking for a Valid Switch I Get a 'Switch' and 'AfterSwitch'

Switch(1) = "-c", AfterSwitch(1) = "heavy"
Switch(2) = "-L", AfterSwitch(2) = "1db"
Switch(3) = "-l", AfterSwitch(3) = "2db"
Switch(4) = "-C", AfterSwitch(4) = "3db"
Switch(5) = "-S", AfterSwitch(5) = "4db"

I Want to Add Support to Your Prog in My GUI and Really Appreciate Your Efforts to Make My Life Easier But the Spaces are Really What I Need for Easy Profiles Parsing.

I Guess I Can Adjust it to Work with AC3toMP3 But it Already Works Very Well with Azid, Lame, SSRC, WaveBooster and tooLame and this is the Easiest Way to Parse the Command Line and Make it Compatible with All the 5 Programs.

Why Not Make AC3toMP3 Even More Compatible with Azid and Lame? (If it's Not too Difficult).

Danni.

DSPguru
9th November 2001, 13:48
@DanniDin
ok, i would inverse the switches rules.
not a problem :cool:

DanniDin
9th November 2001, 13:51
Thanks DSPguru ;)

Danni.

Huge
9th November 2001, 14:25
Originally posted by DSPguru

this mode would be slower, but would work.

any1 interested ?

*Raises Hand* I'm interested :)

Agreed it would be slower but would be a nice touch.

The Link
9th November 2001, 16:18
me too!!

DSPguru
9th November 2001, 17:44
ok, now switches are in the format DanniDin likes.
there's a new switch :
-g max

enjoy !

Attachment Deleted after 50 downloads.. (http://rilanparty.com/vbb/attachment.php?s=&attachmentid=64)

DanniDin
9th November 2001, 18:51
Great :)

I Added Another 'AC3 to MP3' Button to the GUI and it Seems to Work.
Now I Just Have to Adjust the Buttons Size So it will Look OK.

Danni.

The Link
9th November 2001, 19:40
Great stuff! :)
Thanks a lot!!!

Huge
9th November 2001, 20:19
Just checking something. I tried using the new -g max switch (which worked fine btw) and it gave me a max gain of 3.3 at the end of a three hour ac3 file. When the main prog started it doesn't show me that it is using this value. Here's what I get...

AC3toMP3 v0.3a by DSPguru.
--------------------------
taken from the 'Shuttle Shivers Project' v0.8d by DSPguru.
Using azid.dll v1.7.1 (b698) by Midas <midas@egon.gyaloglo.hu>.
Using lame_enc.dll v1.22 (2/11/2001), Engine 3.89 <http://www.mp3dev.org/>.

[00:00:00.000] +------ SETTINGS -----
[00:00:00.000] | Output configuration: 2/0
[00:00:00.000] | Ch0 [Left ]: None compression, 10.2dB gain
[00:00:00.000] | Ch1 [Right ]: None compression, 10.2dB gain
[00:00:00.000] | Output Dual mono mode: Stereo
[00:00:00.000] | Output Stereo mode: Dolby surround compatible
[00:00:00.000] | LFE levels: To LR 0.0dB, To LFE -INF
[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] +---------------------

Can I assume that the 10.2dB shown is actually the 3.3 value it found? Or is this wrong.

Also, I mentioned this earlier but is there any chance this can be multithreaded in the future?

DSPguru
9th November 2001, 20:44
@Huge
- 10.2dB=20*log10(3.2359) ;)
- i'm very happy to hear it worked find :)
- multithreaded ? well, this program doesn't have much of parallelity, in fact the program is basicly a SeriaL execuation of encoding/decoding functions.

Huge
9th November 2001, 20:47
Originally posted by DSPguru
@Huge
- 10.2dB=20*log10(3.2359) ;)
- i'm very happy to hear it worked find :)
- multithreaded ? well, this program doesn't have much of parallelity, in fact the program is basicly a SeriaL execuation of encoding/decoding functions.

Awesome - maybe make them the same so stoopid folk like me don't ask you questions everyday :)

Here's how I figured it could work using threads. One thread reads a block of data from AC3 and decodes using Azid - the decoded block is passed to another thread that encodes it using Lame then writes out to file. Two threads, plus main app thread of course :)

Also, it seems to have slowed up some since the original version. I've only got the max gain parameter on and it's working just a little faster than realtime. Before it was cranking out at nearly 2x speed.

DanniDin
9th November 2001, 21:36
http://worldzone.net/computers/dannidin/AzidLameGUIv0.3b14.zip

- Addded Support for DSPguru's AC3toMP3
In Azid's Locations Choose the:
1. Location of 'AC3toMP3.exe' Instead of 'azid.exe'
2. Location of 'Target mp3' Instead of 'Target wav'
3. Press the Green 'AC3 to MP3' Button

Danni.

DSPguru
10th November 2001, 11:45
- added some support for lame switches
- fixed the speed problem.

usage : AC3toMP3 [inputfile.ac3] [outputfile.mp3] -azid( [switches] ) -lame( [switches] )

i've tested it with :
ac3tomp3 02.ac3 02.mp3 -azid( -g max -L 1db -l 3 ) -lame( -v --vbr-mtrh -V 5 -b 32 -B 320 -m s )

and it worked fine.

i strongly believe that this version has bugs related to the lame_enc.dll .
it seem to have a problem with ABR.

for now, lame_enc.dll is statitcly linked, on my next version it might be dynamicly linked. this could solve the problem pacohaas talked about, and would enable use of newer versions of lame dlls.

@DanniDin
I checked your new GUI and it's great.
please pay attention to the new switches syntax (brackets stuff).

@Huge
showing maximum gain in dB while searching = slowering the process.
as for the threads idea - i'll think about it.

Enjoy! (http://rilanparty.com/vbb/attachment.php?s=&attachmentid=66)

DanniDin
10th November 2001, 12:50
@DSPguru
Glad You Like it :)
(It will Do for Now)

Here is the Lastest:

Azid/Lame GUI v0.3b15 (http://worldzone.net/computers/dannidin/AzidLameGUIv0.3b15.zip)

- Addded Support for DSPguru's AC3toMP3 0.4a
1. In Azid's Locations Choose the:
... a. Location of 'AC3toMP3.exe' Instead of 'azid.exe'
... b. Location of 'Target mp3' Instead of 'Target wav'

2. Check Azid Switches
3. Check Lame Switches
4. Press the Green 'AC3 to MP3' Button

Danni.

DSPguru
10th November 2001, 12:57
@DanniDin
1. i checked the "Auto Find Maximum Gain" in your prog, but it didn't create the "-g max" switch, and therefore AC3toMP3 didn't run its' "find max gain" procedure.
2. is AC3toMP3 supported by the batch mode ?

DanniDin
10th November 2001, 13:36
@DSPguru
1. I'll Add the "-g max"

ps:
AC3toMP3 Doesn't Work with "-g 1db"
It Only Works with "-g1db"

2. Not Yet.

Danni.