View Full Version : Wanted: avs2wav
kassandro
15th February 2004, 12:12
Avisynth's audio capabilities have improved quite a lot during the last year. Nevertheless, they become more and more useless, because from within VirtualDubMod Avisynth audio can only be processed with an acm codec and the time for acm codec - as far as video processing is concerned - is almost over. If one wants to use vbr or vorbis sound, it is simply better to use a standalone audio encoder and then mux the processed audio with VirtualDubMod or a standalone muxer with the video. That's one reason why VirtualDubMod has switched from an audio menu tailored for acm to much more flexible stream menu. To maintain the usefulness of its audio part should do such a switch as well. A console application is needed, which takes the audio from an avisynth script and generates an ordinary wave file (or pumps it to stdout), which then can be processed further by nearly all audio encoders. Such an application should be easy to do for those folks which are responsible for Avisynth audio and should be packaged with Avisynth. It is very desirable to have such an app, because then one could harness all of Avisynth editing copabilities without worrying about a/v sync.
Richard Berg
15th February 2004, 12:43
Is the source of avs2avi available? That's the most logical starting place. (Unfortunately all the links in the searched threads are dead, and it's not on Doom9's download page.)
sh0dan
15th February 2004, 13:56
Vdub(Mod) allows you to save the sound as WAV-files - or are you thinking of something else?
Kurtnoise
15th February 2004, 14:09
Originally posted by Richard Berg
Is the source of avs2avi available? That's the most logical starting place. (Unfortunately all the links in the searched threads are dead, and it's not on Doom9's download page.)
I found a link for AVS2avi with the sources : http://daveel.leffe.dnsalias.com/avs2avi-131a.zip . It works fine for me. ;)
kassandro
15th February 2004, 14:19
Originally posted by sh0dan
Vdub(Mod) allows you to save the sound as WAV-files - or are you thinking of something else?
I knew about this possibility and that's the way I have done it a few times, when it was absolutely necessary. But that is not comfortable at all. I would like to have batch processing. For instance, avs2wav should pipe the audio of the avs-script directly into lame, oggenc or whatever encoder, which can read from stdin, avoiding unnecessary hard disk io.
mkanel
16th February 2004, 04:10
Goldwave is an audio editor which will open AVS scripts and save to a variety of formats. http://www.goldwave.com/ You can download a trial version.
LB
28th February 2004, 09:29
Originally posted by kassandro
I knew about this possibility and that's the way I have done it a few times, when it was absolutely necessary. But that is not comfortable at all. I would like to have batch processing.
Batch is easy, with the #1 macro utility in existance - AUTOIT
CODE for your AVS->WAV
SetEnv, DEL, C:\\FILES\\Delete.exe
SetEnv, VIRT, C:\\FILES\\VirtualDub_Audio\\VirtualDub.exe
SetEnv, BESWEET, C:\\FILES\\BESWEET\\BeSweet.exe
SetEnv, GAIN, C:\\FILES\\Mp3Gain.exe
SetEnv, ALIVE, C:\\FILES\\AliveMedia\\Mp3WavConverter.exe
; --------------------------- USER CONFIG HERE ---------------------------------
SetEnv, DIVXLOCATION, C:\\ShowNameGoesHere\\Divx\\
SetEnv, EPI, C:\\FILES\\Episode.txt
SetEnv, EpStart, Ep01
SetEnv, EpEnd, 20
; ------------------------------ BEGIN LOOP ---------------------------------
RIP:
; ------------------------------ WAV RIP ------------------------------
Run, %VIRT%
WinWaitActive, Virt
Sleep, 1000
Send, {ENTER}
Send, {ALT}{DOWN}{ENTER}
WinWaitActive, Open
Send, %DIVXLOCATION%%EpStart%.avs
Send, {ENTER}
Sleep, 1000
Send, {ENTER}
Send, {ALT}{DOWN}s
WinWaitActive, Save
Send, %DIVXLOCATION%%EpStart%.mp3
Send, {ENTER}
SetTitleMatchMode, 2
WinWaitActive, Status
Send, {TAB}{SPACE}{TAB}{SPACE}
WinWaitClose, Status
SetTitleMatchMode, 1
WinClose, VirtualDub
; ------------------------------ MP3 Gain ------------------------------
RunWait, %GAIN% /r /k %DIVXLOCATION%%EpStart%.mp3
; ------------------------------ AliveMP3toWAV ----------------------------
RunWait, %ALIVE% %DIVXLOCATION%%EpStart%.mp3 /wav
; ------------------------------ LAME ----------------------------
RunWait, %BESWEET% -core( -input "%DIVXLOCATION%%EpStart%.WAV" -output "%DIVXLOCATION%%EpStart%.AC3" ) -ac3enc( -b 384 )
; -------------------------------- DELETING --------------------------------
RunWait, %DEL% %DIVXLOCATION%%EpStart%.mp3
RunWait, %DEL% %DIVXLOCATION%%EpStart%.WAV
; -------------------------------- LOOP -------------------------------------
StringRight, NUMBER, EpStart, 2
IfEqual, TOTAL, %NUMBER%, Goto, Bye
EnvAdd, NUMBER, 1
FileReadLine, EPY, %EPI%, %NUMBER%
StringRight, EPNUM, EPY, 2
SetEnv, EpStart, Ep%EPNUM%
Goto, RIP
; -------------------------------- END --------------------------------------
Bye:
Exit
I whipped this up pretty quick. It should work. Just make sure to have a seperate file called Episode.txt in the proper directory, with:
01
02
03
04
etc
I don't know what exactly you wanted to do so I used just about every step. This current script should rip a MP3 out of a divx file, MP3 gain it so that any other MP3's ripped from that divx file are of equal loudness; then the script does a mp3->wav conversion. I NEVER use lame for this because I always get a crackle when going from 44khz to 48khz in lame, so I figure that's a bug, so use Alive2MP3. It's shareware, but it works A+. Then I tossed in a AC3 conversion, and finally it deletes the files you don't need. Like I said, dunno why you'd need this entire script because the best thing would be to just rip the audio from your DVD directly to AC3, but I wanted to goto the extreme in this script so you have a lot to work with, and can simply delete what you don't want. But yeah, this is your batch processing script.
And, don't let the "episode" connatation fool you. I simply put it like that so you can batch it easy. I guess I could have written another external txt file to hold the different directory names with individual audio components, but that's a hassle. Just use episode connetation and you should be fine.
bb
29th February 2004, 10:41
I'd prefer an "audio frameserver", i.e. a tool which makes an AviSynth script pretend to be WAV file, like an AVS file is read as a "fake" AVI file.
So let's say we have an audio exporting AviSynth script, you create a copy of the script with a, let's say "AWS" extension (for "Audio Wave Synth"), and if an application opens the file, the audio frameserver kicks in, reads the audio part of the script and delivers it to the calling application in WAV format.
I've asked that before, but no response unfortunately...
bb
stickboy
29th February 2004, 12:08
bb:
I too asked something similar awhile back (http://forum.doom9.org/showthread.php?s=&threadid=56147).
mkanel
29th February 2004, 13:32
@bb
I hope we eventually see an audio frameserver. In the meantime have you tried opening an avs script with any of your audio tools? I skip an intermediate file by opening my AVS scripts with Goldwave and then filter and normalize before saving. I expect some other audio tools can do this too.
Mike.
bb
29th February 2004, 13:50
mkanel,
no, usually I save the audio via VirtualDub's "Save WAV" command, then I process the audio with BeSweet. Saving the audio alone takes about 15 to 30 minutes, depending on the size of my capture. If it's longer than about two hours, I need to split the audio, because some tools seem to have trouble with large WAV files.
With a WAV frameserver I could immediately hand over the audio from the captured source to BeSweet, which would save me a lot of time (and hdd space, too).
bb
Kurosu
29th February 2004, 20:46
I've modified a bit makeAVIS to make it output either uncompressed or AVIS-format (ie with ffVfW as a kind of frameserver) Wave file. Considering it relies a lot on the installed version of the ffvfw codec, I don't plan making it available as a compiled resource. Instead, I've submitted to Milan the new source file. Once it is commited (if ever) and a new build of ffVfW is available, I guess the requests in this thread will be filled.
timecop
1st March 2004, 05:42
LB:
(referring to your huge macro post)
That is a horrible solution. That is so wrong on so many levels I don't know where to start complaining about it.
Is this how all these one-click tools that distribute old copies of virtualdub etc work, by just sending them click/key commands to move around menus?
shudder.
I agree, wav frameserver would be kind of nice. actually even better would be something like avs but for audio, so that you can load this "script" into a professional audio encoding application (because not everyone uses besweet and its crappy selection of poor quality encoders).
Oh well, just trying to stay on topic.
Richard Berg
1st March 2004, 06:45
Please be careful whom you criticize, especially if you're not offering something better.
Originally posted by timecop
[...](because not everyone uses besweet and its crappy selection of poor quality encoders)[...]
With a statement like that you disqualify yourself. Don't be surprised if our forum members start skipping your posts, and you don't get answers anymore.
bb
kassandro
1st March 2004, 10:07
If a video player or encoder loads a video, it needs the assistance of windows and therefore it cannot treat a video file as a simple binary file. This fact makes video frame servers possible. On the audio side, the situation is very different. The encoders I use, Lame and Oggenc, treat any input is a simple binary byte stream. They do not use any external codec. That makes these encoders very portable across different plattforms, but also these encoders will never use any audio frame server. For my part I would be quite satisfied with a simple console application which takes an avs script as input and pumps the the wave output to stdout. Then I would associate avs scripts with a very simple batch file like the following:
avs2wav %1 | oggenc -o output.ogg -
and I could convert any avs audio with a single right click app selection into an ogg vorbis file. This I would call comfortable and there is no intermediate disk io. The above script of LB tries to automate the vdub method, which we have to use right now.
However, I do not understand, how this script can rip an mp3 audio from an avs script. Obviously this script was made for ripping mp3 audio from a divx avi. Nevertheless I think that such a script solution is possible and of course one can incorporate any command line encoder into such a script. Hence it too can be used for a comfortable "right click" solution, but it is also quite inefficient and generates a lot of intermediate disk io and a system with heavy disk io is not really usable for anything else.
timecop
1st March 2004, 10:48
Originally posted by bb
With a statement like that you disqualify yourself. Don't be surprised if our forum members start skipping your posts, and you don't get answers anymore.
bb
to quote besweet faq,
"ac3enc.dll creates (almost) useless ac3 streams. don't use it to encode things you care for. it's there only for test purposes."
timecop
1st March 2004, 10:50
Originally posted by kassandro
On the audio side, the situation is very different. The encoders I use, Lame and Oggenc, treat any input is a simple binary byte stream. They do not use any external codec.
Oh, right I totally did not consider this.
I was still thinking inside video/avs domain where audio inside avi would be handled by acm/directshow.
But you are right, all the commandline/etc encoders/audio processing software will simply read the file as binary, parsing wave header etc.
Sorry, bad idea on my part.
Originally posted by timecop
to quote besweet faq,
"ac3enc.dll creates (almost) useless ac3 streams. don't use it to encode things you care for. it's there only for test purposes."
You put your statement in a very general form. The single exception of ac3enc doesn't mean that BeSweet targets "poor quality encoders" only, and this single exception doesn't give you the right of telling that BeSweet has a "crappy selection of poor-quality encoders".
There are excellent encoders to be used by BeSweet as well, e.g. Lame, Ogg Vorbis, tooLame.
bb
jcsston
9th March 2004, 02:12
I posted once to the Audio forum about adding avs input to BeSweet, but it was moved to this thread (http://forum.doom9.org/showthread.php?s=&threadid=40699) :confused:
So I have made a simple little util avs2wav, didn't think anyone would find it useful. But since finding this thread I uploaded a bin here (http://www.mycgiserver.com/~jcsston/avs2wav-v1.0.zip). :D
kassandro
9th March 2004, 10:20
Your avs2wav is almost what I wanted. I only miss the ability to pump output to stdout in order to pipe it into an encoder without an intermediate wav file. avs2wav should have the following syntax
avs2wav [-n] input.avs [output.wav | -]
Thus, with
avs2wav input.avs - | oggenc -o output.ogg -
avs-audio is directly converted into an ogg vorbis file without an intermediate wav file.
Originally posted by timecop
LB:
(referring to your huge macro post)
That is a horrible solution. That is so wrong on so many levels I don't know where to start complaining about it.
Is this how all these one-click tools that distribute old copies of virtualdub etc work, by just sending them click/key commands to move around menus?
shudder.
I agree, wav frameserver would be kind of nice. actually even better would be something like avs but for audio, so that you can load this "script" into a professional audio encoding application (because not everyone uses besweet and its crappy selection of poor quality encoders).
Oh well, just trying to stay on topic.
It's funny how you call it a horrible solution yet you provide no reason why. It is a great solution. Learn to macro what you want, then you aren't stuck when you need to batch something. Maybe it's horrible because it's beyond your comprehension :eek:
NeOff
10th June 2004, 03:30
could someone host this program, I'd like a copy of it if possible. and the link given doesnt seem to work anymore.
Thank you in advance.
E-Male
14th June 2004, 19:39
i second that
jcsston
14th June 2004, 20:44
Originally posted by NeOff
could someone host this program, I'd like a copy of it if possible. and the link given doesnt seem to work anymore.
Thank you in advance.
http://webjory.tripod.com/avisynth/avs2wav.htm
@kassandro: I tried adding stdout support but couldn't get it to work correctly, oggenc would freeze or refuse the input.
E-Male
15th June 2004, 02:10
thx
any chance you'll release the source?
kassandro
16th June 2004, 10:54
Originally posted by jcsston
http://webjory.tripod.com/avisynth/avs2wav.htm
@kassandro: I tried adding stdout support but couldn't get it to work correctly, oggenc would freeze or refuse the input.
That must be problem on your side, because to convert an mp2 file to vorbis I use
C:\programme\audio\lame --mp2input --decode input.mpa - | C:\programme\audio\oggenc -q 2 -o output.ogg -
Thus oggenc accepts wave input from lame.
jcsston
16th June 2004, 17:03
Yes the problem is in my code, oggenc works fine with other programs.
I was saying that it (and lame does too) doesn't work with avs2wav for reasons I'm not sure of.
kassandro
20th June 2004, 13:39
when you copy your wave data to stdout, it may be treated as text output and consequently is messed up by unix/dos conversion. For a discussion of this problem look here (http://www.cs.toronto.edu/~cosmin/TA/prog/sysconf/). I agree with E-male: it would be nice if could also release the source code.
jcsston
25th July 2004, 08:00
I finally got around to upping the source code somewhere. :D
It's a bit of a mess, which is why I didn't initially release the source code it was a quick 1-2 hour hack I put together. As I don't think I'll get around to cleaning it... ;)
SourceForge CVS (http://cvs.sourceforge.net/viewcvs.py/jorydownloader/avs2ogg/)
E-Male
25th July 2004, 09:50
thx
but the link doesn't work :(
kassandro
25th July 2004, 11:13
The link worked for me. But instead of avs2wav I am getting files avs2ogg, but probably that is only a different name.
E-Male
25th July 2004, 11:53
working now
maybe sourceforge was overloaded or something
Wilbert
25th July 2004, 18:06
Has anyone compiled it?
kassandro
25th July 2004, 18:37
Originally posted by Wilbert
Has anyone compiled it?
Yes I did! I couldn't use the project files and the rather obvious definition of the macro SAFE_DELETE_ARRAY was missing. The files generated.cpp and generated.h are superfluous.
If instead of an output wave file "-" is specified on the avs2wav command line, then stdout is taken for output. Unfortunately, encoders did not accept this kind of output, because stdout was not in binary mode (see the discussion above). Now I changed the source to do just this and now oggenc, lame etc. accept the output of avs2wav. Thus monstrous wave files can be avoided. Modified source code and binary can be downloaded from here (http://home.pages.at/kassandro/avs2wav.rar).
BITS
27th July 2004, 02:53
you compiled under .net? if so, do you know off the top of your head if vc6 will compile it(would try but dont have vc6 myself).
jcsston
27th July 2004, 03:17
Originally posted by BITS
you compiled under .net? if so, do you know off the top of your head if vc6 will compile it(would try but dont have vc6 myself).
Yes it should compile with VC6. I used that for the .exe I released. :)
jcsston
27th July 2004, 03:18
Originally posted by BITS
you compiled under .net? if so, do you know off the top of your head if vc6 will compile it(would try but dont have vc6 myself).
Yes it should compile with VC6. I used that for the .exe I released. :)
kassandro: Thanks! I'll commit the changes to CVS :cool:
BITS
27th July 2004, 03:20
nice work friend. my last and only ? about this, do you know of a way at all to do a db boost? usually i do a 2db in oagmachine or whatever. i cannot find that option in oggenc. i found normalize though.
anyways, your avs2avi works great. much appreciation 2 you both.
btw im hyped :-), i too was hoping to get stdout for this.
jcsston
27th July 2004, 05:20
I've added a Gain option, not really a dB adjust as I'm not sure how that works.
avs2wav v1.1 bin (http://prdownloads.sourceforge.net/jorydownloader/avs2wav-v1.1.zip?download)
avs2wav v1.1 src (http://prdownloads.sourceforge.net/jorydownloader/avs2wav-v1.1-src.zip?download)
E-Male
27th July 2004, 11:38
2 questions/suggestions:
1. can support for the besweet.dll be added to this
so it could work like azidts, but taking avs files as input
2. is it possible to use this with 6 channel audio
so when i recut a movie in avisynth i can use the script to recut the 6 channel audio aswell for aac encoding
BITS
27th July 2004, 21:44
the sourceforge mirror(s) dont seem to have the file avail.
nevermind...i finally got it after trying a few times.
thanks for that switch (-g), that should meet all my needs :-).
thanks ALOT!!
BITS
27th July 2004, 22:04
hmm...looks like this new build with the -g, stdout has been lost. the same line im using for this one and your last one...your last one works, this dont.
avs2wav.exe avsfile.avs -g 1.50 - | ....
not working in this build (b3)
avs2wav.exe avsfile.avs - | ...
works in your b2 though.
btw, in besweet i dont even see a option for stdin...does it exist?
E-Male
28th July 2004, 06:25
AFAIK besweet only reads from files
to fead it diretcly you have to use the dll
niiyan
12th August 2004, 17:21
I tried avs2wav-v1.1, but it didn't work.
I used like this:
avs2wav hoge.avs
But I could not play WAV files output by avs2wav. And those WAV files are very small (only a few KB).
The message displayed on the Command Prompt window was like this:
avs2wav v1.1 by Jory Stone <jcsston@toughguy.net>, stdout patch by kassandro
Input: hoge.avs
Output: hoge.avs.wav
Scanning for Audio Stream...
Found Audio Stream
Writing WAV Headers...
Gaining with a factor of 1.0000 ...
Took 0.00 seconds for the writing pass
Avs2wav v1.0 and kassandro's version work well.
matrix
26th September 2004, 17:24
I hope you guys don't mind me reviving this thread.
I try to encode from avs to mp2, but I can't seem to be able to do it without first creating the wav file.
Can it be done anyway?
What I tryed so far is this:
C:\Trial>avs2wav.exe menu.avs - | tooLame -s 48 -d n -c -o -e -b 224 - clip.mp2
--------------------------------------------
Input File : 'stdin' 48.0 kHz
Output File: 'clip.mp2'
224 kbps MPEG-1 Layer II j-stereo Psy model 1
[De-emph:Off Copyright:Yes Original:Yes CRC:On]
[Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off]
--------------------------------------------
avs2wav v1.0 by Jory Stone <jcsston@toughguy.net>
Input: menu.avs
Output: -
Scanning for Audio Stream...
Insufficient PCM input for one frame - fillout with zeros
Hit end of audio data
Avg slots/frame = 672.000; b/smp = 4.67; bitrate = 224.000 kbps
Done
I get an empty mp2 file.
But it seems to me that toolame is kiking in before avs2wav.
If I put toolame on a different line, avs2wav is crashing. I get all kinds of strange characters in the command prompt,
and an annoyng sound. The only way to stop it is to restart the computer.
So how do I make avs2wav to output to stdout?
I tryed all versions I could find, but no luck.
I probbably do something stupid, but what?
I'd really appreciate any help on this.
Regards.
E-Male
26th September 2004, 18:39
these characters andteh beeping are the wave-data
add "> name.wav" to the line to send it to a file
matrix
26th September 2004, 21:25
Thanks for answering E-Male, but can you be a little more specific?
Add that where?
And won't that create a wav file on the computer?
If it does, then I allready can do it just by specifing the names in both avi2wav and toolame.
What I try to do is avoiding the wav creation.
Thank you again, and I hope for some good news.
Regards
matrix
kassandro
27th September 2004, 18:06
I frequently use avs2wav in a similar way as you but with oggenc instead of toolame. Probably you use a too old version of avs2wav. Use version 1.1 or the version for which you can find a link in a previous posting of mine.
matrix
28th September 2004, 00:11
Thank you guys for taking the time to look into this.
I used both versions, and I get the same results.
But anyway, is the command all right?
avs2wav.exe menu.avs - | tooLame -s 48 -d n -c -o -e -b 224 - clip.mp2
The error I'm getting with both versions is the same as in my first post
avs2wav v1.1 by Jory Stone <jcsston@toughguy.net>, stdout patch by kassandro
Input: menu.avs
Output: -
Scanning for Audio Stream...
Insufficient PCM input for one frame - fillout with zeros
Hit end of audio data
If I use like this:
avs2wav.exe menu.avs -g1.5 -
tooLame -s 48 -d n -c -o -e -b 224 - clip.mp2
I get that high pitch beeping sound, and I have to restart the computer.
At first I thought it was a good sign, but it won't stop whatever I do.
Edit.
It must be toolame. I just tryed lame, encoding to mp3, and it worked.
Are there any other mp2 encoders that can take the file from stdout?
Can besweet do it?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.