View Full Version : SoundOut 1.1.1 - Sound Output Plugin [10/15/07]
sh0dan
30th December 2006, 21:20
SoundOut is a GUI driven sound output module for AviSynth. It has been made because to make sound export easier. It is not meant to replace tools like BeHappy or other advanced audio encoding GUI's, but it is meant to be easy and fast to use.
The filter will probably be included in AviSynth 2.6, but it works nicely with AviSynth 2.5.
Currently the supported file formats are:
* AC3
* MP3
* MP2
* OGG
* WavPack
* FLAC
* Monkey Audio Codec (APE)
* Microsoft WAV format
* Apple/SGI AIFF format
* Sun/NeXT AU format
* RAW PCM data
* Sonic Foundry's 64 bit RIFF/WAV (WAVE64)
* Core Audio File format
* Broadcast Wave Format (BWF)
* Command Line encoding.
Add SoundOut() to your script, where you would like to export audio. A GUI should pop up, when you open your script.
The main GUI window looks like this:
http://klauspost.googlepages.com/soundout1.gif
An encoding property window:
http://klauspost.googlepages.com/soundout4.gif
It is possible to use SoundOut as an ordinary filter, running inside the script and giving parameters for each output mode. The parameters consists of two things: General Parameters, which can be used for all filters, and filter specific parameters, which gives parameters to the active output module.
Feel free to report problems, requests and comments here.
Changelist:
v1.1.1
- Downgraded FLAC to v1.2.0, to avoid backwards incompatible 24 bit files.
- Conversion tune-up.
- OverWriteFile set to "No" was not respected.
- Client sample requests shown in GUI.
v1.1.0
- Added WavPack output module.
- Added Sample type selection to WAV Output.
- Updated FLAC to v 1.2.1 - 24 bit/sample seems broken, so only 8 & 16 bit are enabled.
- Fixed bug in FLAC to enable files larger than 2GB.
- FLAC now uses the same GUI as other filters.
- Aften updated.
- Re-enabled Aften multithreading.
- Faster 3DNOW! float to 24 bit conversion.
v1.0.3
- Vorbis, AC3 and MP3 now checks if file can be created.
- Fixed hang in aften on multiprocessor machines.
- Added wait parameter, how many seconds should SoundOut wait on autoclose.
- Avoid lockup if encoder cannot be initialized and set for direct output.
- Fixed OverwriteFile was not always being respected.
v1.0.2
- Updated libaften to rev534.
- Fixed overwriteFile not being recognized in script.
- Fixed crash if mp2 file could not be opened for writing.
- Exit blocked, even if filter is (almost) instantly destroyed, if script is set for output.
- AC3 is now reporting the actual samples encoded (including padding).
v1.0.1
- Updated libaften to rev. 512.
- Added overwriteFile="yes"/"no"/"ask". Default is Ask.
v1.0.0
- The application will not exit, as long as an encode window is open.
- Fixed "nofilename" not being recognized in script.
- LFE no longer overridden by registry, when using GUI.
v0.9.9
- Added ReplayGain calculation to Analyze.
- Parent filters are now blocked, or silent samples are returned, if the filter is currently exporting sound.
- Video is automatically added, if none is present. (black 32x32 RGB32)
- Buttons for export are disabled when output window is open.
- Main window is now minimized when export module is selected.
- Fixed Analyze bug on 16 bit samples.
- Fixed WAVEFORMATEXTENSIBLE channel mapping in Commandline Output.
- AC3 output: LFE option disabled when not relevant.
- AC3 output: LFE option named properly.
v0.9.8
- Added Analyze option to calculate average, maximum and RMS levels. Only available through GUI.
- WAVEFORMATEXTENSIBLE in commandline out attempts to set channel maps based on channel number.
- Fixed thread race issue on very fast encoders.
- Minor GUI tweaks.
v0.9.7
- Added channelmapping to AC3 output.
- Added LFE channel indicator switch to AC3 output.
- GUI now spawned in a new thread, fixing GUI lockup in foobar2000 and similar.
- Fixed general thread race issue, where a fast encoder might lead to incomplete output.
- Fixed WAVE_FORMAT_EXTENSIBLE header without info in CmdLine Output.
- Fixed "Format" not working on Commandline output.
- Fixed Filename dialog not appearing.
- Forced final samplereading to be correct.
- Removed "private" option from MP2 GUI and script, as there is no way to set it via twolame.
- Removed DAB Extensions from MP2 GUI, as TwoLame reports it as not functioning.
v0.9.6
- Added complete script customization.
- Added possibility to set output file from script.
- Added window autoclose option to script.
- Added option to script to disable progress window.
- GUI creates message handle thread.
- Settings are now saved to registry if output filter initializes successfully.
- Updated documentation.
v0.9.5
- Added Broadcast WAVE out.
- Fixed OGG Vorbis support.
- Fixed Text fields not being correctly read.
- Fixed AC3 settings not being restored properly.
- Added: MP2 settings are now saved.
v0.9.4
- Added OGG Vorbis support.
- Added: Parameters stored (on save) and read to registry.
- Added: "No filename needed" option in commandline output, to disable output filename prompt.
- Fixed collision between libaften and libvorbis.
- Updated libaften to rev 257.
- Enabled SSE optimizations in libaften.
- Hopefully fixed issue with commandline executable filename becoming garbled.
v 0.9.3
- Added Commandline piping output.
- Added MP3 / LAME output.
- Fixed AC3 VBR Error sometimes wrongly being displayed.
- Fixed AC3 DRC Setting not being respected.
- Various GUI bugfixes.
v 0.9.2
- Updated AC3 GUI.
- Fixed crash in WAV output.
- More stats during conversion.
v 0.9.1
- Added AC3 Output.
- Extension automatically appended, if none is given.
- Added new parameter handling.
- Fixed last block not being encoded.
- Added WAV peak chunk, as an option.
Download from here: http://klauspost.googlepages.com/SoundOut-1.1.1.zip
Kurtnoise
31st December 2006, 09:39
Sounds good...:)
Some requests :
Add a boolean argument in SoundOut() to enable/disable gui.
Add a new argument in SoundOut() to pass command line and codec name.
Add an argument to close the gui when process is finished.
Something like:
SoundOut(clip, bool "gui"=false, string "codec"= MP2, string "cmd"=-j )
Don't know if it's doable but it sounds interesting...btw, I'm waiting mp3 and vorbis support.
buzzqw
31st December 2006, 11:16
it is very Very VERY interesting... a way to elimitate bepipe and not only !(not a bad program at all... just for .net..)
a truly excellent work Sh0dan ! :thanks:
i fully agree with Kurtnoise13 about request.. in particular
Add a new argument in SoundOut() to pass command line and codec name.
just an information... the resampleaudio/normalize/ssrc fuction how will must used ?
before invoking SoundOut() right ?
thanks again
BHH
sh0dan
31st December 2006, 15:35
@Kurtnoise13: Good ideas. I have an almost similar plan right now, but implementing codecs with their GUI is first priority. I have to re-do options, since I completely bypass the command-line interface.
Vorbis is next on the list. :)
@buzzqw: Yes - you have to prepare the sound before invoking the plug-in. I have chosen not to implement features that duplicate AviSynth behaviors (like resampling, channel numbers, etc).
The current to-do list:
* More codecs.
* Store settings in registry, so they are remembered.
* Presets.
* Modify settings from script.
* Make it even easier to use. :)
tebasuna51
31st December 2006, 21:10
Sorry by my AviSynth ignorance but after make an avs file like, for instance:
WavSource("d:\test.wav")
ssrc(44100)
SoundOut()
What is the app to open this avs?
sh0dan
1st January 2007, 13:36
@tebasuna51: Exactly. You can open it in any application that supports AviSynth - Virtual dub, Media player, etc.
tebasuna51
1st January 2007, 17:03
Whit:
-VirtualDub 1.6.17:
Error: No video stream found
The dialog window pop up isn't open.
-Media Player Classic (XP):
Pop up window ok, with correct Sound Info.
Click in Save WAV/AIF/CAF
Wav type: Microsoft WAV
Save As... dialog (we must write the extension, isn't added automatically)
Finished...
Result: a wav header without data (correct datalength=0)
the wav header have a subchunk 'fact' correct but unnecessary.
the wav header have a subchunk 'PEAK' not standard, unnecessary and potentially dangerous.
Wav type: MS WAVE with WAVEFORMATEX
Same problems: without data (only header) and unnecessary subchunks 'fact' and 'PEAK'.
Wav type: RAW PCM
Of course the result is a empty file.
Save MP2:
Empty file
Save FLAC:
86 bytes header.
Save APE:
128 bytes file.
foxyshadis
1st January 2007, 17:14
Maybe there's some requirement in MPC (or SoundOut?) to have a blankclip as long as the audio, like virtualdub.
tebasuna51
1st January 2007, 18:43
Same results in mpc with:
WavSource("D:\test.wav")
AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=1000), last)
SoundOut()
Now work with VirtualDub, the outputs is only headers but without the undesired subchunks 'fact' and 'PEAK'.
Resume the problems:
- The Save As... dialog don't fill the extension
- The wav headers can vary with the app
- Data empty
- With Media Player Classic: undesired subchunks in header
- With VirtualDub need a video clip
sh0dan
1st January 2007, 23:00
@tebasuna51: I cannot reproduce the empty output files. Seems very weird. It must be a crash in the encoder thread. Would it be possible for you to make something I can use to reproduce?
I'll look at the WAV headers. It seems like it is possible to disable the peak header. The auto-extension is also one of the things I'll look at.
This should be enough to add video. Since the video length isn't considered:
AudioDub(BlankClip(), last)
tebasuna51
2nd January 2007, 03:58
@tebasuna51: I cannot reproduce the empty output files. Seems very weird. It must be a crash in the encoder thread. Would it be possible for you to make something I can use to reproduce?
I don't know how make something to reproduce. My test file is very simple, a verified wav file:
******************************** 02/01/2007
LeeWavBi 1.0 analizando
el fichero de 11520044 bytes:
D:\Internet\AudioTest\SoundOut\6c_16ip.wav
-------------------------------------------
ChunkID .....: RIFF
ChunkSize ...: 11520036
Format ......: WAVE
Subchunk1ID .: fmt
Subchunk1Size: 16
AudioFormat .: 1 (Integer data)
NumChannels .: 6
SampleRate ..: 48000
ByteRate ....: 576000
BlockAlign ..: 12
BitsPerSample: 16
OffsetData ..: 45
DataLength ..: 11520000
Duration ...: 20 sec., (0h. 0m. 20 s.)
-----------------------------------------
You know the avs, tested with/without ssrc() and with only AudioDubEx(BlankClip(), last).
I use AviSynth 2.5.7 RC-3 [Dec 31st] now.
As you can see in this image:
http://img260.imageshack.us/img260/3958/soundout01wu1.png (http://imageshack.us)
The Sound Info is correct and the Conversion status don't show any error and seems finished ok. The output header is also correct but without data.
Edit: the same problem with stereo wav.
hanfrunz
3rd January 2007, 13:33
i am curios and have no avisynth-computer here... what would happen if you shuttle through the video when played back? Is this also saved to the output file? Or does the filter request all frames/samples once and writes them? And where can i find the sourcecode?
tebasuna51
3rd January 2007, 14:42
what would happen if you shuttle through the video when played back? Is this also saved to the output file? Or does the filter request all frames/samples once and writes them? And where can i find the sourcecode?
I'm not sure if you ask me, but:
If I load in VirtualDub this avs:
WavSource("D:\Internet\AudioTest\SoundOut\2c_16ip.wav")
AudioDubEx(BlankClip(length=Int(25*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=25), last)
ssrc(44100)
SoundOut()
forgetting the SoundOut window, and using VirtualDub controls,
the audio is played correctly and with Save As... is saved correctly.
The audio can be extracted (Save wav) from the output video and is exact to input audio but 44100 Hz.
sh0dan
3rd January 2007, 17:51
@tebasuna51: I have added some more security and debugging information, but I'm in the middle of adding AC3 and new parameter handling, so I can't release a new version just yet - but I'm definitely looking into the issue.
@hanfrunz: Video should pass through the filter, and encoding is done in two separate threads, so you can export sound while you are encoding, if that's what you'd like.
Source is in the 2.6 branch:
http://avisynth2.cvs.sourceforge.net/avisynth2/avisynth/src/plugins/SoundOut/?sortby=date&pathrev=avisynth_2_6
GUI Resources have been created using a free tool called "resED", so the project can be used with VC 2005 Express.
http://www.radasm.com/projects/projects.html
sh0dan
4th January 2007, 23:37
@tebasuna51: I found the bug, while implementing AC3. The last block of samples will never be encoded, so on small samples, that will create 0-byte files, adn others will miss the end.
I still have to do some testing, but I expect a new version some time this weekend.
tebasuna51
5th January 2007, 03:57
@tebasuna51: I found the bug, while implementing AC3. The last block of samples will never be encoded, so on small samples, that will create 0-byte files, adn others will miss the end.
You are right I need samples > 22 sec to obtain output. Thanks for your job, I wait your new version to make more test. :rolleyes:
sh0dan
7th January 2007, 03:55
New version uploaded, see first post for changes.
I have not spent much time testing, as I expect a new version soon, but there is AC3 output now (more options coming) and there is a rather large bug-fix to ensure the entire sound is exported.
Edit: There is a crash-bug in WAV-out. I'll release a new version later today, as I'm still implementing new stuff.
tebasuna51
7th January 2007, 14:24
My first test with small samples works ok. Also the ac3 encode.
About the ac3 parameters I want send you my opinion:
I know Aften have a lot of parameters and is not convenient show all to end user because can be confused.
The expert user always can use Aften in CLI mode to obtain all of features.
The most know ac3 encoder is Sonic Foundry SoftEncode and I want propose a subset of their parameters to be offered to end user of SoundOut:
- BitRate with Auto option, at least in CLI mode this works (always CBR, we need ac3, instead aac, to provide compatibility with DVD and AVI and VBR don't work, let VBR to expert users)
- Dialog Normalization, the default -31 dB is ok but is a important parameter.
- Dolby Surround Mode, only the user can know if the original sound 2.0 is Dolby ProLogic encoded. Parameter requested in Doom9 forum.
- Dynamic Range Compression, or DRC Profile (in test phase in Aften).
Now some preprocessing options:
- DC high-pass filter
- Bandwidth low-pass filter
- LFE low-pass filter
- 90 degree phase shift for surround channels, not yet implemented in Aften (future option)
There are parameters like 'Use block switching' or 'Accurate Bit-Allocation', and others, not directed to end users but for test or developing purpose.
sh0dan
7th January 2007, 14:42
@tebasuna51: Great to know. I completely agree with what you say! I haven't spent much time with aften, so I don't know what is important. I basicly took a look at aftenGUI, and copied, what seemed important. So you propose to:
* Remove VBR Option?
* Remove Block switch/accurate bitalloc, and leave it at defaults.
* Add Dialog Normalization.
* Add "Dolby Surround Mode" - is this only relevant for 2 channel audio? What about the "EX" DS Modes - are they important?
* Add BW low-pass filter.
* Are mix-levels important? And why are only -3 to -6 available in aftenGUI?
tebasuna51
7th January 2007, 16:36
* Remove VBR Option?
Yes, or warn isn't compatible with standalone DivX/DVD players (and other PC players)
* Remove Block switch/accurate bitalloc, and leave it at defaults.
Yes, Aften isn't finished yet and these parameters are for test.
* Add Dialog Normalization.
The most important parameter with bitrate and DRC.
* Add "Dolby Surround Mode" - is this only relevant for 2 channel audio? What about the "EX" DS Modes - are they important?
Yes is only for 2.0 but is ignored for other number of channels. If the two channels are obtained by a downmix dpl (there are Avisynth functions to do, see BeHappy) we can activate this flag and decoders (soft or hardware) can read this flag an set automatically to dpl mode (recover FL,FR,C,SL,SR).
Activate the DS "EX" Mode flag mean the Surround Center channel is encoded in SL,SR channels. I don't know any free tool to do so, only know commercial encoders with their proper ac3 encoder, then I think is unnecesary now. Maybe, in the future, we can supply 7 channels to Aften and use this flag.
* Add BW low-pass filter.
Really this 3 filters (DC high-pass, Bandwidth low-pass and LFE low-pass) have similar importance and can be implemented before the encoder but if exist can be used all.
* Are mix-levels important? And why are only -3 to -6 available in aftenGUI?
Mix-levels are only the recommended values if the decoder need make a downmix and want accept the info from the encoder. I can't imagine when we need put other than defaults.
The values are discrete because are encoded in BSI stream with only 2 bits for CenterMixLevel or SurroundMixLevel.
sh0dan
7th January 2007, 17:45
@tebasuna51: Thanks for the input. I have modified the GUI. There are some more cosmetic changes and a bugfix.
DeathWolf
17th January 2007, 19:35
any hope of being able to use it with avisynth settings instead of gui? so that it automatically processes without needing user input?
tebasuna51
18th January 2007, 02:53
any hope of being able to use it with avisynth settings instead of gui? so that it automatically processes without needing user input?
Everybody want this.
See previous post from Kurtnoise13, buzzqw, and the sh0dan answer: "I have an almost similar plan right now, but implementing codecs with their GUI is first priority."
We are waiting.
sh0dan
18th January 2007, 15:21
Progress update:
I have done some more work this weekend. I spent a lot of time implementing Command-Line Output - in the process wasting several hours before finding out that LAME stdin encoding is broken on Windows.
Got GUI ready for MP3 and OGG, and beginning implementation soon. I've also done some preparations for non-GUI operation, and preset handling.
There seems to be moderate interest, so I've decided to wait with a release until more features are implemented.
buzzqw
18th January 2007, 15:50
wasting several hours before finding out that LAME stdin
strange... with bepipe or ffmpeg is fully fuctionall (used by bepipe with megui and automkv)
with ffmpeg i successfully encoded with this cmd
ffmpeg.exe -vn -acodec copy -i mkvmaudio.avs -f wav - | lame - aaa.mp3
(in mkvaudio.avs there is nicac3source("audio.ac3",2))
MODERATE INTEREST ?
I have a big interest since i want to drop bepipe !
:thanks: Sh0dan !
BHH
P.S. ffmpeg is working with lame/oggenc2/enc_aacplus BUT not with neroaacenc since it is outputting (i suppose) "raw wav"
(this would just be a tip for your not interesting work :D )
hatte
20th January 2007, 03:59
Had a problem with avs2avi: a DV audio stream wasn't cropped but streched instead. Does SoundOut hanle such streams correctly?
sh0dan
20th January 2007, 14:57
New version up with Command Line and MP3 encoding and a lot of bugfixes.
buzzqw
20th January 2007, 15:41
Thanks Sh0dan !
just a little request... would possible to pass command line options directly to soundout withour using the gui ?
almost all command line encoder accept output file name in command line, would be possibile to have a "Encode" button side by side to "Save As" , using this encode the output file will be written by encoder
BHH
EDIT: command line like SoundOut("aaa.avs",wave="Microsoft Wav",format="Float",encoder="c:\apps\neroaacenc.exe",cmdline="-q 0.5 -if - -of test.mp4")
Thanks again!
buzzqw
20th January 2007, 17:04
got a problem/doubt
... but how to use soundout in a enviroment of true command line encoder ?
let's say this is my avs
let's say this is my avs
LoadPlugin("NicAudio.dll")
NicMPG123Source("audio.ac3")
EnsureVBRMP3Sync()
ConvertAudioToFloat()
#Applyed STEREO downmixing routines
function stereo(clip a)
{
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
c = GetChannel(a, 3)
lfe = GetChannel(a, 4)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l_sl = MixAudio(fl, sl, 0.2929, 0.2929)
c_lfe = MixAudio(lfe, c, 0.2071, 0.2071)
r_sr = MixAudio(fr, sr, 0.2929, 0.2929)
l = MixAudio(l_sl, c_lfe, 1.0, 1.0)
r = MixAudio(r_sr, c_lfe, 1.0, 1.0)
Return MergeChannels(l, r).Normalize()
}
#
function original(clip a)
{
Normalize(a)
Return last
}
6==Audiochannels() ? stereo() : original()
basically it will output stereo audio. Using this on BePipe is a no problem
but if i add simply SoundOut() the avs isn't playble (even before but this isn't a problem since i want only audio) in virtualdub or with x264.exe or xvid_encraw.exe since it lack of video...
i could trasform to this
LoadPlugin(SoundOut.dll")
LoadPlugin("NicAudio.dll")
audio = NicAC3Source("audio.ac3")
video = blankclip(10000) #a must since i don't have video !
audio = EnsureVBRMP3Sync(audio)
audio = ConvertAudioToFloat(audio)
#Applyed STEREO downmixing routines
function stereo(audio)
{
fl = GetChannel(audio, 1)
fr = GetChannel(audio, 2)
c = GetChannel(audio, 3)
lfe = GetChannel(audio, 4)
sl = GetChannel(audio, 5)
sr = GetChannel(audio, 6)
l_sl = MixAudio(fl, sl, 0.2929, 0.2929)
c_lfe = MixAudio(lfe, c, 0.2071, 0.2071)
r_sr = MixAudio(fr, sr, 0.2929, 0.2929)
l = MixAudio(l_sl, c_lfe, 1.0, 1.0)
r = MixAudio(r_sr, c_lfe, 1.0, 1.0)
audio = MergeChannels(l, r)
}
#
function original(audio)
{
audio=Normalize(audio)
}
6==Audiochannels(audio) ? stereo(audio) : original(audio)
audiodub(video,audio)
soundout()
this is perfectly playable in virtualdub BUT i cannot use with x264.exe or xvid_encraw or mplayer/mencoder...
what could be the solution (beside using virtualdub) ? :scared:
BHH
Kurtnoise
20th January 2007, 18:15
Thanks Shodan for the new build...:)
All seems to work fine here except CommandLine output. Whatever my .exe is specified, I've got always the same error message "Couldn't find executable...in C:\Program Files\Avisynth 2.5\plugins\SoundOut" and transcode can't to be done. Whats wrong ?
this is perfectly playable in virtualdub BUT i cannot use with x264.exe or xvid_encraw or mplayer/mencoder...
what could be the solution (beside using virtualdub) ? :scared:
Use 2 avs scripts : one for video encoding and the second one for audio transcoding.
sh0dan
20th January 2007, 18:39
@buzzqw: Yes - all options will be available by script.
Regarding the playability issue, I'm not sure I get your point. Soundout will pop up, if it is inserted into the script, and the script is opened - it's as simple as that.
It could be made so that it automatically inserts blank frames if there is no video, but it doesn't really make it different from using audiodub with a blank clip. Could you elaborate on "i cannot use with x264.exe or xvid_encraw or mplayer/mencoder...", as I don't know what the issue is?
@Kurtnoise13: Have you tried selecting a file with full path. For executables without path place them in a subdirectory called "Soundout" in your plugin directory.
Edit: Implemented "No output file" mode in Cmdline out, and fixed a hang when an error occurred while initializing the output command. Will be in next version, which will most likely also have OGG out.
Kurtnoise
20th January 2007, 19:23
@Kurtnoise13: Have you tried selecting a file with full path. For executables without path place them in a subdirectory called "Soundout" in your plugin directory.
Yes, I tried (full path & in /plugins/SoundOut dir) and it seems doesn't work for me...
http://img413.imageshack.us/img413/9682/soundout14jv.th.png (http://img413.imageshack.us/my.php?image=soundout14jv.png) http://img413.imageshack.us/img413/1416/soundout20bl.th.png (http://img413.imageshack.us/my.php?image=soundout20bl.png)
buzzqw
20th January 2007, 20:37
@Kurtnoise13
i am already use 2 script, one for video and one for audio
the tipical script for audio is like the first one i posted (these without blankclip).
i invoke bepipe , pass this script and piping the output to lame/neroenc/oggenc2...
@Sh0dan
the question seems be stupid but... how to open the script?
take this script as example (audioscript.avs)
LoadPlugin("NicAudio.dll")
LoadPlugin("SoundOut.dll")
nicac3source("test.ac3")
AudioDubEx(BlankClip(length=Int(25*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=25), last)
converttoyv12()
soundout()
in my application (as megui) bepipe will OPEN the audio avs script (as the first one) and output the wav to command line encoder...
With your plugin is SoundOut that output the wav but the avs must be opened in some way, could be virtualdub or media player classic... ok but in my environment i haven't these tools
so how to open the script ?
if i wrote xvid_encraw.exe -bitrate 1000 -type 2 -i audioscript.avs -o aaa.mp4
the encode start but soundout gui is locked, not accessible
if i wrote x264.exe -o NUL audioscript.avs , i got the same result, the soundout window is locked
with mplayer i got a mplayer crash after some seconds of encoding..
WITH VIRTUALDUB IS OK! i can open it and select what i want
i hope to be understud ! :scared:
BHH
sh0dan
21st January 2007, 01:08
@Kurtnoise13: Yes - that definitely looks messed up. It happened once here, but it went away as quickly as it came.
I'll work on it. I have OGG finished, but I would like to have parameter storage in place before the next version.
@buzzqw: Yes - now I see. :)
I have tested on Vdub, VdubMod, MPC, WMP10 and Zoomplayer, and it opens nicely in either of these. WMP 6.4 does have a problem, and it kills the window almost instantly.
Why can't you use any of these? A simple application that opens the script and adds SoundOut sounds like a good idea, but I don't want to reinvent the wheel.
buzzqw
21st January 2007, 10:01
sorry Sh0dan, i don't want to bother but in my applycation (AutoMKV, as you see in sign) i don't use any of those applications (vdub,vdubmod or players...)
thanks anyway, i will continue with bepipe... and so the .net framework is still needed :mad:
great application Sh0dan, just not "perfectly" fit for my needs :)
best regards
BHH
sh0dan
21st January 2007, 11:06
@buzzqw: I'll see if I can come up with a good solution for you. :)
buzzqw
21st January 2007, 11:09
:thanks: :thanks: :thanks: :goodpost:
my Kudos Sh0dan !
BHH
sh0dan
22nd January 2007, 00:54
New version with OGG support, and settings are now being saved to registry when you start encoding (except mp2 for now).
DSP8000
22nd January 2007, 08:41
Thank you for the update sh0dan.
Your efforts are very much appreciated.
Encoding with foobar2000 is broken in 0.9.4 :(
cmd line does not work as well, same error as kurtnoise
Previous versions are working just fine.
Just a suggestion for the GUI, after successful conversion auto close the process window, all encoding formats-option for custom parameters.
tebasuna51
22nd January 2007, 21:34
Thanks for this new version.
For me the ogg output is crispy, unusable.
The command line works (there are some erratic problems) with this encoders (XP_sp1, .NET 2.0):
aften.exe -v 0 -b 192 - <out>
flac.exe -o <out> -
mppenc.exe --standard - <out>
neroAacEnc.exe -q 0.3 -if - -of <out>
oggenc2.exe -Q --quality 1 -o <out> -
twolame.exe -b 192 -m j - <out>
wavpack.exe -h -i -l -m -r -q -y - <out>
enc_aacPlus.exe - <out> --rawpcm 48000 2 16 --cbr 80000 --mpeg2aac
sh0dan
22nd January 2007, 22:47
@DSP8k: How do you encode with f2k?
@tebasuna51: Do you have a short sample? I had some strange results with simple sine sounds, but it seemed more like a strangeness with Vorbis itself.
tebasuna51
23rd January 2007, 01:35
In OggSample.zip (http://www.mytempdir.com/1181148) there are a sample with first 8 seconds bad encoded, also the original wav (first 8 seconds).
With command line (oggenc2) work Ok and much more fast.
There are a input plugin, foo_input_avs.dll (http://workspaces.gotdotnet.com/behappy) by Dimzon, to open avs files in Foobar2000. If the avs have SoundOut() the GUI appears (but not accesible: sandglass, even if pause the play) while the audio is played.
DSP8000
23rd January 2007, 02:20
Thru avs input plugin & play in fb2k.
Just to be on the safe side, today I did some more tests & now fb2k crashes instantly after opening the script.
the GUI appears (but not accesible: hourglass, even if pause the play) while the audio is played.
That's exactly what's happening.
sh0dan
28th January 2007, 18:34
@tebasuna51: Thanks a bundle for the test-case, I found the bug and fixed it. You will also be happy to hear that the Command-line garbling is now also fixed.
@DSP8000: I'm not sure I can fix that, if Foobar 2k doesn't send Windows Dialog Events on to the GUI. I'll see what I can do.
Anyway - there is a new version with bugfixes and BWF support for hanfunz to test. :)
sh0dan
30th January 2007, 22:29
Version 0.9.6 uploaded with complete script customization possibilities and updated documentation. I also made an attempt at solving the hanging GUI problem.
An example of the script syntax could be:
SoundOut(output = "mp3", filename="c:\outputFile.mp3", autoclose = true, showprogress=true, mode = 2, cbrrate = 192)
tebasuna51
31st January 2007, 04:37
Thanks for your hard work. Problems detected:
1) Channelmapping: a GetChannel(1,3,2,5,6,4) is needed to output correct ac3 and ogg multichannel. I think this must be transparent to the end user, Aften have internally mapping routines and work ok in cmdline mode.
2) When save like WAVEFORMATEX work ok, but in CmdLine output wav type WAVEFORMATEX don't fill the haeder correctly:
WAVE_FORMAT_EXTENSIBLE header with correct info in Save WAV/AIF/CAF
Offset | 0 1 2 3 4 5 6 7 8 9 A B C D E F |
---------|--------------------------------------------------|-----------------
00000000 | 52 49 46 46 3C C8 AF 00 57 41 56 45 66 6D 74 20 | RIFF<ȯ.WAVEfmt
00000010 | 28 00 00 00 FE FF 06 00 80 BB 00 00 00 CA 08 00 | (...þÿ.._»...Ê..
00000020 | 0C 00 10 00 16 00 10 00 3F 00 00 00 01 00 00 00 | ........?.......
00000030 | 00 00 10 00 80 00 00 AA 00 38 9B 71 64 61 74 61 | ...._..ª.8>qdata
00000040 | 00 C8 AF 00 | .ȯ.
WAVE_FORMAT_EXTENSIBLE header without info in CmdLine Output
Offset | 0 1 2 3 4 5 6 7 8 9 A B C D E F |
---------|--------------------------------------------------|-----------------
00000000 | 52 49 46 46 3C C8 AF 00 57 41 56 45 66 6D 74 20 | RIFF<ȯ.WAVEfmt
00000010 | 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | (...............
00000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00000030 | 00 00 00 00 00 00 00 00 00 00 00 00 64 61 74 61 | ............data
00000040 | 00 C8 AF 00 | .ȯ.
3) In CmdLine output the output file dialog is missing.
4) Exporting from script:
- In help the parameter 'cbrrate' for ac3 is missing
- With output="cmd" I obtain:
Script error: SoundOut does not have a named argument "format"
5) With output="cmd" and Aften I obtain:
Command Line:"d:\Programa\Audio\0\aften.exe" -b 448 - "d:\xc3.ac3"
Aften: A/52 audio encoder
(c) 2006 Justin Ruggles
Signed 16-bit 48000 Hz 6-channel
progress: 80% | q: 968.4 | bw: 34.0 | bitrate: 448.0 kbps
>PIPE: Input pipe thread killed (EOF)
and
An error occurred during conversion: Encoding aborted before all samples were
delivered (mismatch).
The output file is probably incomplete.
And of course is incomplete, same problem with NeroAacEnc.
DSP8000
31st January 2007, 04:56
Tnx. for the update.
Cmd. line arguments are not passed properly and the conversion fails. I think the cmd. line options should be very similar to the ones in foobar2000, ie. auto generation of input file and output extension based on the encoder chosen.
Yeah, the GUI hanging bug is still there:( , at least mpc is working good.
sh0dan
31st January 2007, 17:15
Thanks for the invaluable testing and very precise feedback, it helps a lot.
1) It would probably make sense to add the channel mapping options to the aften output.
2) Confirmed - I'll look at it. I had to rewrite the WAV writer for piped output, and it doesn't look quite right.
3+4) Confirmed.
5) Strange - do they all die at 80%? And how long are the samples?
tebasuna51
31st January 2007, 19:38
5) Strange - do they all die at 80%? And how long are the samples?
There are only 20 sec. multichannel sample and always at same point with aften, neroaacenc and flac. But this was yesterday.
Today work fine with 20 sec. and 130 min. samples, with Aften, NeroAacEnc, OggEnc2 and flac v1.1.2. Maybe some resident soft in my system, I don`t know.
Thanks.
sh0dan
31st January 2007, 22:54
@tebasuna51: Found the final bug!
@DSP8000: I was a bit more aggressive on fixing the GUI problem, and it now works in foobar2000.
Version 0.9.7 is uploaded. It should fix all the mentioned bugs (and feature requests) :)
DSP8000
1st February 2007, 02:00
Good job, well done :)
The GUI Bug now is gone, works good.
Can you please make autoclose option after successful encode in the GUI as well. The window just hangs in there even after successful conversion is finished.
Also, cmd. line output works good, but the options are somewhat confusing, ie. the input file is already specified in the script but when you choose cmd. line output, the GUI is asking where you want to save the file, but in fact you'll have to select the actual input file otherwise the conversion fails.
This is why I requested autofile input generation.
If the input file is in the script, I see no reason why would we have to do the same thing twice:(
Also, auto output to the same directory of the input file(if no output directory specified) would be nice.
foobar2k plugin in the future?
No rush, whenever you feel that it can be done.
Thanks again.
Audionut
1st February 2007, 06:53
Hi, first thanks heaps.
Second, is there anyway to determine the average RMS of the audio before outputting to AC3.
TIA.
sh0dan
1st February 2007, 09:47
@DSP8000:
- "autoclose": Just specify it in your script - it also works in ordniary mode.
- "filename/cmdline": You seem to use the commandline encoder the wrong way. If the file is used as input, you are not specifying that it should use stdin as input.
If you specify a filename in your commandline, tick off "No Filename needed", and you will not be asked for an output file.
Since I cannot know what extension your command should have, I cannot add it automatically.
Commandline is considered "advanced" usage. Post what command you are using, and the results you are getting.
@Audionut: Do you know where I could find code for that?
Audionut
1st February 2007, 12:54
Here is the source code for a plugin for foobar 2000.
http://rapidshare.com/files/14381903/foo_vis_vu_meter-0.2-src.zip.html
It displays the RMS value of a file playing in foobar.
Or could it not be possible to use Replaygain at all.
tebasuna51
1st February 2007, 13:40
With Aften there are a little app: wavrms.exe (wavrms.c)
But is intended to calculate Dialog Normalization.
AFAIK the ac3 volume control system based in Dialog Normalization and Dynamic Range Compression don't match with ReplayGain concepts.
sh0dan
1st February 2007, 16:04
The calculation seems pretty easy. It could be implemented as a Toolbox that could give you these stats.
Audionut
2nd February 2007, 04:08
With Aften there are a little app: wavrms.exe (wavrms.c)
But is intended to calculate Dialog Normalization.
For Dialog Normalization is why I was asking.
Thanks.
tebasuna51
2nd February 2007, 04:19
Still a minor problem with :
WAVE_FORMAT_EXTENSIBLE header with correct info in Save WAV/AIF/CAF
Offset | 0 1 2 3 4 5 6 7 8 9 A B C D E F |
---------|--------------------------------------------------|-----------------
00000000 | 52 49 46 46 3C C8 AF 00 57 41 56 45 66 6D 74 20 | RIFF<ȯ.WAVEfmt
00000010 | 28 00 00 00 FE FF 06 00 80 BB 00 00 00 CA 08 00 | (...þÿ.._»...Ê..
00000020 | 0C 00 10 00 16 00 10 00 3F 00 00 00 01 00 00 00 | ........?.......
WAVE_FORMAT_EXTENSIBLE header with ChannelMask incorrect in CmdLine Output
Offset | 0 1 2 3 4 5 6 7 8 9 A B C D E F |
---------|--------------------------------------------------|-----------------
00000000 | 52 49 46 46 3C C8 AF 00 57 41 56 45 66 6D 74 20 | RIFF<ȯ.WAVEfmt
00000010 | 28 00 00 00 FE FF 06 00 80 BB 00 00 00 CA 08 00 | (...þÿ.._»...Ê..
00000020 | 0C 00 10 00 16 00 10 00 00 00 00 80 01 00 00 00 | ..........._....
Tested also with stereo wav, ChannelMask incorrect also = 0x80000000 instead the correct value = 0x00000003
sh0dan
4th February 2007, 18:54
I have added an Analyze option to the GUI, that calculates levels values per channel.
I have also changed the WAV output to add channel indication to commandline output - but do note that this is only guesses based on the channel number.
Please test, if it works all-right.
sh0dan
5th February 2007, 12:19
Thread split. All video output/caching moved here:
http://forum.doom9.org/showthread.php?t=121869
tebasuna51
10th February 2007, 01:01
I have added an Analyze option to the GUI, that calculates levels values per channel.
Strange output with a 6 channel wav input:
Analyzed 100%.
[Channel 0] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
[Channel 1] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
[Channel 2] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
[Channel 3] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
[Channel 4] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
[Channel 5] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
[All channels] Maximum:1.#JdB. Average:1.#RdB. RMS:1.#RdB
With the encoded ac3:
Analyzed 100%.
[Channel 0] Maximum:0.00dB. Average:-37.50dB. RMS:-23.20dB
[Channel 1] Maximum:-0.00dB. Average:-38.41dB. RMS:-23.86dB
[Channel 2] Maximum:-0.00dB. Average:-45.63dB. RMS:-28.68dB
[Channel 3] Maximum:-0.61dB. Average:-45.40dB. RMS:-28.16dB
[Channel 4] Maximum:-0.01dB. Average:-38.05dB. RMS:-23.60dB
[Channel 5] Maximum:-0.00dB. Average:-38.90dB. RMS:-24.25dB
[All channels] Maximum:0.00dB. Average:-40.03dB. RMS:-24.79dB
- Encoding ac3 and unchecking 'Last channel is LFE' I obtain:
Could not initialize encoder. Probably invalid input.
and abort.
If the option is related with:
[-lfe #] Specify use of LFE channel (overrides wav header)
0 = LFE channel is not present
1 = LFE channel is present
the literal must be 'LFE channel is present' not 'Last...' because LFE is not the last but the fourth.
This option can be accessible only for 4 or 5 channels, with 1, 2 or 3 is not allowed a LFE channel, and with 6 LFE is obligatory.
I have also changed the WAV output to add channel indication to commandline output - but do note that this is only guesses based on the channel number.
I think the defaults must be selected from this list:
Chan. acmod/ac3 channels Mask MS channels Description
----- ------------------------- ---- ----------------- ----------------
1 1 (1/0 C) 4 FC Mono
2 2 (2/0 L R) 3 FL FR Stereo
3 3 (3/0 L C R) 7 FL FR FC
3 4 (2/1 L R S) 259 FL FR BC First Surround
4 5 (3/1 L C R S) 263 FL FR FC BC like Dpl I
4 6 (2/2 L R SL SR) 51 FL FR BL BR Quadro
5 7 (3/2 L C R SL SR) 55 FL FR FC BL BR like Dpl II
6 7 (3/2.1 L C R SL SR LFE) 63 FL FR FC LF BL BR Standard Surround
The problem is for 3 and 4 channels.
Actually SoundOut put:
SoundOut(output="wav", filename="d:\z.wav", type=1)
Chan. Mask MS channels
----- ----------- -----------------
1 4 FC
2 3 FL FR
3 0 Invalid ?
4 51 FL FR BL BR
5 0 Invalid ?
6 63 FL FR FC LF BL BR
SoundOut(output="cmd", filename="d:\x.wav", type=1, executable="d:\x.exe", ...)
Chan. Mask MS channels
------ ----------- ------------------
1 4 FC
2 3 FL FR
3 0x80000000 Speaker reserved ?
4 51 FL FR BL BR
5 0x80000000 Speaker reserved ?
6 51 FL FR BL BR ?
For 4 channels seems the Quadro option is the choice. OK.
For 3 channels I propose FL FR FC (7) for simplicity (first 3 channels ...)
For 5 and 6 channels defaults must be always 55 (0x37) and 63 (0x3F).
- BTW, I only can work SoundOut with VirtualDub, with MPC sometimes work sometimes not.
With avs2avi I tried:
NicMPG123Source("G:\z T01 DELAY -205ms.mpa")
DelayAudio(-0.205)
SoundOut(output="mp3", filename="G:\z.mp3", autoclose=true, showprogress=true, mode=2, cbrrate=128)
Mpeg2Source("G:\z.d2v")
Crop(2,4,-2,-4)
BicubicResize(576,432,0,0.75)
...
and crash.
Thanks.
sh0dan
11th February 2007, 21:39
Strange output with a 6 channel wav input:
Worksround: Use ConvertAudioToFloat() - fixed in next version.
Encoding ac3 and unchecking 'Last channel is LFE' I obtain:
I'll investigate the issue, and change the label of the checkbox.
I think the defaults must be selected from this list:
The mapping is taken from libsndfile, which is:
1 : center channel mono
2 : front left and right
4 : Quad
6 : 5.1
8 : 7.1
I'll add 3 & 5 channel definition for piping output, and send this on to the libsndfile maintainer, so it can be included in libsndfile for the WAV output.
with MPC sometimes work sometimes not.
The main problem is, if the input requests audio, while the encoder is running. There are two options - either block audio requests, while an encoder is running, or return silent samples.
buzzqw
27th February 2007, 13:10
Hi Sh0dan !
any news about my problem?
i would like to use xvid_encraw or x264 from command line with your great plugin!
thanks
BHH
P.S. take all your time ... no urge!!!! :)
Deckard2019
3rd March 2007, 12:06
@Sh0dan : http://forum.doom9.org/showthread.php?p=965193#post965193
Graph is DTS/AC3/DD+ Source => Sonic Cinemaster Audio Decoder 4.2 with DD+ source.
Everything seems ok in SoundOut before start saving AC3 file :
http://img339.imageshack.us/img339/7783/20070303204128nh6.th.png (http://img339.imageshack.us/my.php?image=20070303204128nh6.png) http://img254.imageshack.us/img254/3668/20070303205545gv2.th.png (http://img254.imageshack.us/my.php?image=20070303205545gv2.png)
Still investigating ...
Thank you
EDIT: It works with a WAV dumped from the graph.
SoundOut can handle .grf in DirectShowSource() ?
sh0dan
4th March 2007, 15:55
New version released. Most bugs should be fixed, and this could be considered Release Candidate.
You do not have to add video yourself, if none is present. This version should also avoid the problem of multiple filters requesting audio at the same time (which often result in a crash).
v0.9.9
- Added ReplayGain calculation to Analyze.
- Parent filters are now blocked, or silent samples are returned, if the filter is currently exporting sound.
- Video is automatically added, if none is present. (black 32x32 RGB32)
- Buttons for export are disabled when an output module window is open.
- Main window is now minimized when export module is selected.
- Fixed Analyze bug on 16 bit samples.
- Fixed WAVEFORMATEXTENSIBLE channel mapping in Commandline Output.
- AC3 output: LFE option disabled when not relevant.
- AC3 output: LFE option named properly.
@Deckard: Sounds quite strange. Does it crash only, when exporting as AC3?
@buzzqw: Could you describe the issues you are experiencing with the latest version?
buzzqw
4th March 2007, 17:32
for me command line is broken...
the avs
LoadPlugin("C:\temp\test\NicAudio.dll")
LoadPlugin("C:\temp\test\soundout.dll")
NicAC3Source("C:\temp\test\audio.ac3")
soundout(type=0,format=0,executable="C:\temp\test\oggenc2.exe",prefilename=" -q 3 - -o audi0.ogg",postfilename="",showoutput=true,nofilename=true)
the bat
"C:\temp\test\xvid_encraw.exe" -bitrate 200 -o "c:\temp\test\junk.mp4" -i "C:\temp\test\soundout.avs"
also feel free to donwnload www.64k.it/andres/data/s/soundout99test.zip contain the avs, bat, audio.ac3, filter and xvid_encraw (2.24mb)
from dos box i got this error http://img404.imageshack.us/img404/764/soundoutwq8.png (http://imageshack.us)
if i remove the nofilename got this
http://img404.imageshack.us/img404/4900/soundout2ce5.png (http://imageshack.us)
and soundout will not procude anything
BHH
sh0dan
4th March 2007, 18:53
@buzzqw: Thanks - confirmed. The nofilename parameter is removed, for a reason I cannot remember - I'll invstigate!
Deckard2019
4th March 2007, 19:50
@Deckard: Sounds quite strange. Does it crash only, when exporting as AC3?
No. It starts with FLAC and MP3. FLAC hits 2GB filesize limit. MP3 goes to the end.
buzzqw
4th March 2007, 19:56
Thanks Sh0dan ! i will wait !
BHH
p.s. if not too much (and i think is too much) will be possible to add a parameter to specify the colorspace of the black 32*32 ? like adding converttoyv12() . this will only needed by those encoder, like x264.exe, that wil accept only yv12 colorspace.... but i must admit is a very questionable request :o
tebasuna51
6th March 2007, 14:40
New version released. Most bugs should be fixed, and this could be considered Release Candidate.
You do not have to add video yourself, if none is present. This version should also avoid the problem of multiple filters requesting audio at the same time (which often result in a crash).
Thanks for the new release accepting most of my suggestions.
Only a problem with:
- AC3 output: LFE option disabled when not relevant.
When LFE option is checked (default) we can encode 6 channel to 5.1 (LFE disabled but checked).
Then if we need encode a stereo to 2.0 the LFE option is checked and disabled and can´t encode to 2.0, only to 1.1.
The solution is:
- 6 channel: Disabled and checkeck
- 1, 2 y 3 channel: Disabled and unchecked.
Forgetting the previous settings.
Actually we need encode a 4 of 5 channel to set the default for the next encode.
sh0dan
6th March 2007, 20:36
for me command line is broken...
Thanks for the invaluable test-pack. It helped debug a great deal.
You need to add output="cmd", but other than that it helped spot a few problems.
I have fixed "nofilename", and added a closedown lock, while encoding, to avoid termination while the encode is still running. Next version should work for you.
Regarding colorspace, the temporal solutionis to add converttoyv12() yourself, or even better, for bug the application writers to invoke the conversion filter, if they are not happy with the colorspace. After all, it's only three lines of code.
The solution is:
- 6 channel: Disabled and checkeck
- 1, 2 y 3 channel: Disabled and unchecked.
Ahhh.. Registry settings are overriding defaults... Fixed.
Here we go - v.1.0.0 :)
v1.0.0
- The application will not exit, as long as an encode window is open.
- Fixed "nofilename" not being recognized in script.
- LFE no longer overridden by registry, when using GUI.
Pookie
6th March 2007, 21:56
Well done, sh0dan, and thanks to all of the beta testers
buzzqw
6th March 2007, 22:08
:thanks: :thanks: :thanks:
awesome !!!! i love it !!!!!!!!!!!!!!!!
tomorrow i will do more timing/configuration test !
:thanks: again !
BHH
tebasuna51
7th March 2007, 04:19
it is very Very VERY interesting... a way to elimitate bepipe and not only !(not a bad program at all... just for .net..)
Now we can use instead Bepipe:
avs2avi audio.avs -c null -e
With audio.avs for instance:
NicMPG123Source("G:\test.mpa")
SoundOut(output="mp3", filename="G:\test.mp3", autoclose=true, mode=2, cbrrate=128)
And the transcode is made without further user mediation.
Dark-Cracker
7th March 2007, 10:52
is it possible to use it with faac or the nero aac encoder ? like with bepipe ?
tebasuna51
7th March 2007, 11:27
is it possible to use it with faac or the nero aac encoder ? like with bepipe ?
Just use the 'cmd' output mode, this audio.avs work for me:
NicAc3Source("G:\6chan.ac3")
SoundOut(output="cmd", filename="G:\6chan.mp4", autoclose=true, type=0, executable="d:\Program\Audio\neroAacEnc.exe", prefilename="-q 0.3 -ignorelength -if - -of")
buzzqw
14th March 2007, 11:33
hi Sh0Dan!
i have some serius issue on encoding long files (over 2 hours)
the encoding seems to never start
even if i use the simpliest avs script (without normalize, conversions.. ) seems to hang forever... well not forever but near 1 hour before start conversion
always using command line
thanks!
BHH
sh0dan
14th March 2007, 14:04
@buzzqw: Please post the exact script.
buzzqw
14th March 2007, 14:42
LoadPlugin("NicAudio.dll")
LoadPlugin("SoundOut.dll")
NicAC3Source("audio.ac3")
EnsureVBRMP3Sync()
ConvertAudioToFloat()
#Applyed STEREO downmixing routines
function stereo(clip a)
{
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
c = GetChannel(a, 3)
lfe = GetChannel(a, 4)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l_sl = MixAudio(fl, sl, 0.2929, 0.2929)
c_lfe = MixAudio(lfe, c, 0.2071, 0.2071)
r_sr = MixAudio(fr, sr, 0.2929, 0.2929)
l = MixAudio(l_sl, c_lfe, 1.0, 1.0)
r = MixAudio(r_sr, c_lfe, 1.0, 1.0)
Return MergeChannels(l, r).normalize()
}
#
function original(clip a)
{
Return last
}
6==Audiochannels() ? stereo() : original()
Soundout(output="cmd",type=1,autoclose=true,executable="c:\apps\oggenc2.exe",prefilename=" -q 3 - -o audio.ogg",postfilename="",nofilename=true,showoutput=false)
"x264.exe" --bitrate 200 --progress --output "junk.mp4" "audio.avs"
first of all i must excuse since the culprit seems to be the Normalize()
and seems (but i think is due to "bad" interfacing to soundout) that not all processors power are used
BHH
tebasuna51
14th March 2007, 21:34
i have some serius issue on encoding long files (over 2 hours) the encoding seems to never start.
...
the culprit seems to be the Normalize()
Normalize() is the culprit of a first pass to calculate the max gain and seems never start.
But the culprit of the hours waiting is EnsureVBRMP3Sync().
For what you need this? You don't use mp3 VBR, you use uncompresed audio by NicAudio without sync problems.
BTW, I propose a faster downmix routine (12 min instead 18 min downmixing a 130 min ac3 5.1 to wav)
And ConvertAudioToFloat is not necessary because the NicAudio output is already float, try then:
LoadPlugin("NicAudio.dll")
LoadPlugin("SoundOut.dll")
NicAC3Source("audio.ac3")
#EnsureVBRMP3Sync()
#ConvertAudioToFloat()
#Applyed STEREO downmixing routines
function stereo(clip a)
{
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3)
lfe = GetChannel(a, 4)
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
mix = MergeChannels(lfc, lfc)
lrc = MixAudio(flr, mix, 0.2929, 1.0)
blr = GetChannel(a, 5, 6)
return MixAudio(lrc, blr, 1.0, 0.2929).normalize()
}
#
6==Audiochannels() ? stereo() : last
Soundout(output="cmd",type=1,autoclose=true,executable="c:\apps\oggenc2.exe",prefilename=" -q 3 - -o audio.ogg",postfilename="",nofilename=true,showoutput=false)
buzzqw
14th March 2007, 22:20
thanks tebasuna51 , i will do some more test
but is very strange that bepipe starts encoding very quickly, while soundout seems to seat down...
also thanks about ensure and convert, i will remove it when not necessary
BHH
hatte
16th March 2007, 15:35
Thanks for great plugin, works fine, but
1. Feature request. Please add general script parameter "overwrite" that controls the behavior of encoding to existing file.
2. Got "Vorbis Encoder", "An encoder error occured while initializing the encoder". If soundout uses an external one, I have a bunch of vorbis.acm and vorbisenc.dll in system... Script is avisource(...).soundout(). Source - dvsd (badly clipped).
tebasuna51
16th March 2007, 19:55
One more request if possible for next release:
- I think the presets for mp3 vbr are a bit obsolete, now we use quality 0 to 9.
- The 'fast' now is not important.
- Low bitrates (for low quality players, headphones, ...) can't be accessed (Medium is too much quality).
- Codes for vbrpreset (1001-1007) can be replaced by 0-9 like -V lame parameter.
sh0dan
18th March 2007, 13:02
@hatte:
1) Agree. I plan to add a simple Yes/No/Ask option.
2) You probably hit an internal Vorbis limitation, probably samplerate-related.
@tebasuna51: I noticed the change in LAME. IMO the presets are a bit more descriptive than 0 to 9. "Fast" is still faster, although only about 50%.
The names are aliases for VBR quality 0,2,4. If things still are as they were some time ago, ABR is recommended for bitrates below the one at quality 4. Low bitrate presets are aliases for ABR-presets.
If things have changed I can add GUI for quality 6 and 8. If you use script only you can actually specify the "missing" quality settings, like this:
SoundOut(output="mp3", mode=0, vbrpreset=410)
where:
V9 = 410, V8 = 420, V7 = 430, V6 = 440, V5 = 450, V4 = 460, V3 = 470, V2 = 480, V1 = 490, V0 = 500
buzzqw
1st April 2007, 20:59
rarely (appened only two time) sound out will crash
this is the crash report of virtualdub http://www.64k.it/andres/data/a/crashinfo.txt
this is the avs script
LoadPlugin("C:\Program Files\AutoMKV\exe\filter\NicAudio.dll")
LoadPlugin("C:\Program Files\AutoMKV\exe\filter\SoundOut.dll")
NicAC3Source("C:\video\projects\temp\fixed1.ac3")
Normalize()
#Applying STEREO downmixing routines
function stereo(clip a)
{
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3)
lfe = GetChannel(a, 4)
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
mix = MergeChannels(lfc, lfc)
lrc = MixAudio(flr, mix, 0.2929, 1.0)
blr = GetChannel(a, 5, 6)
Return MixAudio(lrc, blr, 1.0, 0.2929)
}
#
6==Audiochannels() ? stereo() : last
Soundout(output="cmd",type=1,format=3,autoclose=true,executable="C:\Program Files\AutoMKV\exe\besweet\neroaacenc.exe",prefilename=" -ignorelength -q 0.50 -if - -of audio.mp4",postfilename="",nofilename=true,showoutput=false)
the file is opened by virtual dub , with this command
"C:\Program Files\AutoMKV\exe\BeSweet\vdub.exe" /x "C:\video\projects\temp\mkvmaudio.avs"
i cannot provide the audio source but i suppose that could be caused by some crc error on original ac3 file
thanks!
BHH
tebasuna51
2nd April 2007, 01:32
And with:
SoundOut(output="cmd", filename="X:\yourpath\audio.mp4", type=0, autoclose=true, executable="C:\Program Files\AutoMKV\exe\besweet\neroaacenc.exe", prefilename="-q 0.5 -ignorelength -if - -of")
also crash?
(Normalize is recommended after the downmix).
buzzqw
2nd April 2007, 08:29
Thanks tebasuna51!
normalize already after downmixing , about filename="X:\yourpath\audio.mp4" i will add this to the command line
BHH
buzzqw
2nd April 2007, 08:54
tested, not working
the prefilename must be prefilename=" -ignorelength -q 0.35 -if - -of audio.mp4" , specifyng only filename="X:\yourpath\audio.mp4" isn't enough
BHH
tebasuna51
2nd April 2007, 13:19
the prefilename must be prefilename=" -ignorelength -q 0.35 -if - -of audio.mp4" , specifyng only filename="X:\yourpath\audio.mp4" isn't enough
with 'filename' parameter the 'prefilename' must finish with "... -of" like here (simplified):
NicAC3Source("C:\video\projects\temp\fixed1.ac3")
6==Audiochannels() ? stereo() : last
Normalize()
Soundout(output="cmd", filename="X:\yourpath\audio.mp4", type=0, autoclose=true, executable="C:\Program Files\AutoMKV\exe\besweet\neroaacenc.exe", prefilename="-q 0.5 -ignorelength -if - -of")
Is only to test if the crash is for sintax (I test my suggested sintax many times without problems) or for the ac3.
sh0dan
28th May 2007, 18:50
Here is a small update:
v1.0.1
- Updated libaften to rev. 512.
- Added overwritefile="yes"/"no"/"ask". Default is Ask.
sh0dan
18th July 2007, 22:06
Another bugfix release:
v1.0.2
- Updated libaften to rev534.
- Fixed overwriteFile not being recognized in script.
- Fixed crash if mp2 file could not be opened for writing.
- Exit blocked, even if filter is (almost) instantly destroyed, if script is set for output.
- AC3 is now reporting the actual samples encoded (including padding).
buzzqw
19th July 2007, 14:48
Thanks Sh0dan!
one hunble request/question.. how to use trim ?
this is my script (example)
LoadPlugin("C:\Programmi\PureBasic402\AutoMKV\exe\filter\NicAudio.dll")
LoadPlugin("C:\Programmi\PureBasic402\AutoMKV\exe\filter\SoundOut.dll")
NicAC3Source("C:\Programmi\PureBasic402\AutoMKV\test\temp\fixed1.ac3")
#Applying STEREO downmixing routines
function stereo(clip a)
{
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3)
lfe = GetChannel(a, 4)
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
mix = MergeChannels(lfc, lfc)
lrc = MixAudio(flr, mix, 0.2929, 1.0)
blr = GetChannel(a, 5, 6)
Return MixAudio(lrc, blr, 1.0, 0.2929)
}
#
6==Audiochannels() ? stereo() : last
Normalize()
Soundout(output="cmd",type=1,format=3,autoclose=true,executable="C:\Programmi\PureBasic402\AutoMKV\exe\besweet\neroaacenc.exe",prefilename=" -ignorelength -q 0.35 -if - -of audio.mp4",postfilename="",nofilename=true,showoutput=false)
how i can use trim to cut ? (i have done some test.. but always negative)
thanks!
BHH
sh0dan
19th July 2007, 16:09
The easiest way is to add video. Here is a script I've used. It adds video, at 100fps, matching the length of the audio:
function addvideo(clip c) {
blankclip(length = int(100.0 * AudioLengthF(c) / float(audiorate(c))), fps=100)
return audiodub(last,c)
}
This way, you can add video, and multiply your times in seconds by 100 (or dividing by 10, if you use milliseconds).
buzzqw
19th July 2007, 18:15
ok, got it (i will use video framerate... much simplier)
thanks! (as usuall)
BHH
tin3tin
20th July 2007, 12:45
Great plugin!
Two thoughts:
1) If overwritefile="No" then no ask promt should be opened. Soundout should just quit the job. (This would be very helpful because when using SoundOut in HcEnc an avisynth script is opened twice: first for getting info(SoundOut will start and render), second for rendering(SoundOut will run and render the file again). So if overwritefile="no" with no question then SoundOut will only run once automatically.
2) The other thought is that in my opinon 'autoclose' should close the progress window when finished rendering, or else maybe a 'wait' function should be made for the waiting purpose?
Anyway thanks for a top notch plugin! :)
sh0dan
20th July 2007, 13:27
@tin3tin:
1) I experienced exactly the same not an hour ago - also with HC. I agree completely.
2) It will probably be a wait parameter.
tin3tin
23rd July 2007, 20:17
I've added your great SoundOut plugin to DVD slideshow GUI. It works fine on my computer, however there has been a report on SoundOut not shutting down properly when exporting ac3.
http://forum.videohelp.com/topic245071-300.html#1732067
I have no idear what's causing this, what do you think?
sh0dan
24th July 2007, 11:55
@tin3tin: There seems to be a deadlock in aften, when encoding using multiple threads (which is autodetected by libaften). I will have do disable multithreading inside aften to fix this. SoundOut is multithreaded by itself, so I don't think it will be a big change on dualcore anyway.
Opened bug here:
https://sourceforge.net/tracker/?func=detail&atid=863860&aid=1759442&group_id=173013
There is a hang-on-exit, if the encoder fails to initialize, but that is unrelated (and will be fixed in next version).
sh0dan
24th July 2007, 19:29
New version:
v1.0.3
- Vorbis, AC3 and MP3 now checks if file can be created.
- Fixed hang in aften on multiprocessor machines.
- Added wait parameter, how many seconds should SoundOut wait on autoclose.
- Avoid lockup if encoder cannot be initialized and set for direct output.
- Fixed OverwriteFile was not always being respected.
tin3tin
24th July 2007, 22:30
Thanks :)
- Added wait parameter, how many seconds should SoundOut wait on autoclose.
- Avoid lockup if encoder cannot be initialized and set for direct output.
- Fixed OverwriteFile was not always being respected.
That works fine here as well.
- Fixed hang in aften on multiprocessor machines.
I don't have a multiprocessor machine, but hopfully the one who reported the hang will let me know if this solved his problem. :)
[EDIT: The hang is fixed too]
HeadBangeR77
31st July 2007, 12:02
Sorry for a noobish question:
I've already transcoded many AC3 448 files into AC3 384 using SoundOut 1.0.0. a couple of months ago and now using the latest plug-in version. Is the libaften.dll embedded in your plug-in? If so, is it Kuronoise13's build? I'm asking, because I always use and AVS with command line, which points directly to the aften executable (07sse by Wisodev atm). What should I do to use the newer revision? Just leave out the path to the executable?
Good to see the things improving - thanks for the plug-in, it's slowly becoming my only encoder /transcoder for soundtracks. :)
sh0dan
31st July 2007, 12:25
HeadBangeR77, libaften is inside the SoundOut plugin, so when you use the built-in AC3 output, you use the revision in SoundOut.
You can however, as you mention, use an external "aften.exe". If you use a direct path, it will always use that version.
You can also put an aften.exe into a directory called Soundout in your plugin directory. If the program cannot find aften.exe in your current path, it will attempt to load it from there.
HeadBangeR77
31st July 2007, 12:56
:thanks: for the quick answer - now everything is clear :)
I only must compare the built-in one with Wisodev's sse version in terms of speed to decide which one to use.
Thanks again!
buzzqw
25th August 2007, 14:18
i think i found a bug
using this script
LoadPlugin("C:\Programmi\PureBasic402\AutoMKV\exe\filter\NicAudio.dll")
LoadPlugin("C:\Programmi\PureBasic402\AutoMKV\exe\filter\SoundOut.dll")
NicAC3Source("E:\Nuova cartella\Matrix\temp\fixed1.ac3")
Normalize()
Soundout()
fixed1.ac3 is a 3_2ch 384kbps ac3 file
and outputting to flac at 0 compression (or even at 6 compression), whenever the saved file got the 2gb size i got this error
http://img95.imageshack.us/img95/1300/flacsoundoutdx9.png
btw i am using soundout 1.0.3 not 1.0.2 as reported :confused:
BHH
sh0dan
27th August 2007, 14:00
Seems like an error in the OGG/FLAC library. I'll have a look at it. I'm preparing v1.1.0, so it will be included in this one.
For lossless encoding you can look forward to wavpack lossless encoding.
buzzqw
27th August 2007, 14:19
thanks Sh0dan!
i can surely wait!
BHH
IanB
27th August 2007, 15:34
@Sh0dan, The default Flac output with a "Filename" uses crappy stdio with a 2GB limit. You will need to provide a set of output callback routines that implement big file i/o. (or upgrade the standard internal routines :D )
hartford
16th September 2007, 03:06
I get an error with Virtualdub that it cannot load
this plugin if it is not in the Avisynth "autoload" folder.
I discovered that SoundOut.dll and libsndfile-1.dll MUST be located in the plugin autoload folder.
I put plugins in a seperate folder and load them as needed to avoid incompatabilities.
-
Avisynth 2.57, build: Dec 31 2006 [13:16:28]
Windows XP Pro, SP2, all updates through August, 2007
.Net Framework 2.0
buzzqw
16th September 2007, 10:26
there is no need for soundout and libsndfile-1.dll to be in avisynth plugin directory
just copy libsndfile-1.dll to your \windows\system32 , or in a windows path folder
BHH
hartford
21st September 2007, 04:41
there is no need for soundout and libsndfile-1.dll to be in avisynth plugin directory
just copy libsndfile-1.dll to your \windows\system32 , or in a windows path folder
BHH
Yes, I understand, to some degree, how Windows works.
I'm pointing-out that the installation directions don't explicitly say that libsndfile-1.dll must be in "some" path, however derived.
The install directions should make a point of this. The Install directions do not say "install in your "\windows\system32" directory."
In other words, SoundOut doesn't search its current directory for libsndfile-1.dll.
That's my point, apparently poorly expressed.
sh0dan
23rd September 2007, 15:41
v1.1.0:
http://klauspost.googlepages.com/SoundOut-1.1.0.zip
Changes:
- Added WavPack output module.
- Added Sample type selection to WAV Output.
- Updated FLAC to v 1.2.1 - 24 bit/sample seems broken, so only 8 & 16 bit are enabled.
- Fixed bug in FLAC to enable files larger than 2GB.
- FLAC now uses the same GUI as other filters.
- Aften updated.
- Re-enabled Aften multithreading.
- Faster 3DNOW! float to 24 bit conversion.
buzzqw
23rd September 2007, 16:12
:thanks: Sh0dan!
wonderfull plugin!
should be integrated in avisynth directly! (as nicaudio..)
BHH
Wilbert
23rd September 2007, 16:14
- Updated FLAC to v 1.2.1 - 24 bit/sample seems broken, so only 8 & 16 bit are enabled.
I used FLAC 1.2.1 to encode at 96/24 a few times. Why do you think it's broken?
@buzzqw,
should be integrated in avisynth directly!
It will be in v2.6.
buzzqw
23rd September 2007, 17:00
thanks Wilbert!
what about nicaudio plugin ?
BHH
lolent
23rd September 2007, 17:29
:thanks: sh0dan for updating your amazing plugin.
I will try it asap :p
sh0dan
23rd September 2007, 17:33
I used FLAC 1.2.1 to encode at 96/24 a few times. Why do you think it's broken?
It produces broken files for me. I found this bug, that seems to fit:
https://sourceforge.net/tracker/?func=detail&atid=113478&aid=1799513&group_id=13478
Wavpack should be better in most cases, even though it doesn't seem to be as widely supported.
Wilbert
23rd September 2007, 17:46
It produces broken files for me. I found this bug, that seems to fit:
https://sourceforge.net/tracker/?fun...group_id=13478
Ok. I've been using flac-1.2.1a.exe the whole time. I guess the bug was not present in that version.
Kurtnoise
13th October 2007, 09:06
o0ps...problem solves. Sorry for the disturbance...
@Sh0dan: here is a strange behaviour that I noticed. I've 2 Windows OS. The first one (XP) in my first hard drive (C:) and the second one (Vista) in my second hard drive (D:). When I'm running on XP, all works fine with SoundOut and his own extra commands but as soon as I'm running on Vista, nothing works correctly with this plugin. A simple script like this:
AVISource("D:\input.avi")
SoundOut()
returns :
Script error : there is no function named "SoundOut"
(D:\COLLATERAL\Test222.avs, line 2)
Note that Avisynth 2.5.7 is installed on both hard drives. SoundOut.dll and libsndfile-1.dll are of course in the Avisynth plugins directory. So, if I move these dlls on my C drive, all works fine. Any idea ?
foxyshadis
13th October 2007, 09:54
libsndfile has to be somewhere in the dll load path, so putting it in the app folder, the windows or system32 folder, or manually loading it works. (Thanks to myrsloik for that last bit.) I'm hoping the fix to make the autoload folder temporarily part of the path will go into 2.5.8.
Kurtnoise
13th October 2007, 10:08
ok...I found the problem. It was my fault. :p I had changed the path in the registry key. That's why I had this behaviour. Sorry for the noise.
chrishallowell
2nd November 2007, 18:51
Question/Problem #1:
Using HCGUI and the below script HCGUI pops up the sound GUI but when I try to save to ac3 it gives me this error: "Could not initialize encoder. Probably invalid input."
I'm guessing I'm missing a program or it's in the wrong directory....
Any ideas?
Question/Problem #2:
Using the below script, will soundout exclude the audio for frames 4459 through 4999?
Here's my test script:
LoadPlugin("degrainmedian.dll")
LoadPlugin("fft3dfilter.dll")
LoadPlugin("ColorMatrix.dll")
LoadPlugin("AudioLimiter.dll")
LoadPlugin("soxfilter.dll")
loadplugin("SoundOut.dll")
avisource("E:\Orginal with audio.AVI",audio=true)
AssumeFPS("ntsc_video",sync_audio=true)
Trim(101,4458).Fadeio(30)
Trim(5000,6155).Fadeio(30)
ConvertAudioToFloat().SSRC(41000)
fl = GetRightChannel()
fr = GetRightChannel()
cc = mixaudio(GetRightChannel(),GetRightChannel(),0.707,0.707)
lfe = GetRightChannel() #ConvertToMono(a).SoxFilter("lowpass 120","vol 1.2")
sl = GetRightChannel() #.amplify(-1.0)
sr = GetRightChannel() #.amplify(-1.0)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
MergeChannels( fl, fr, cc, lfe, sl, sr).wavgainlimiter(1.0)
SoundOut()
sh0dan
4th November 2007, 09:09
@chrishallowell: #1: You see this error message because the aften AC3 encoder cannot initialize - probably because of sample-rate or similar. Post The sample info the main window shows.
#2: Check your script, you probably meant:
vid = AssumeFPS("ntsc_video",sync_audio=true)
Trim(vid, 101,4458).Fadeio(30) ++ Trim(vid,5000,6155).Fadeio(30)
aleste81
30th November 2007, 20:05
Thanks !
This tool is great. It will allow a fully automated process of encoding A/V.
SoundOut(output = "WAV", filename="D:\CAPTURED\outputFile.wav", autoclose = true, showprogress = true, type = 0)
sh0dan
20th December 2007, 08:49
Note to self, bug report: http://forum.doom9.org/showthread.php?t=132912
Also there are still some overwrite messagebox issues left.
ernstblaauw
11th February 2008, 12:56
Hi,
I found a error in the documentation of this great plugin!
Writing a wav file, the argument 'format = 0' leads to a 8-bit wav-file and 'format = 1' to a 16-bit wav-file. This is contrary to the documentation where the first situation would lead to an 16-bit and the second to 24-bit file.
Thanks!
vlada
23rd February 2008, 11:06
Would it be possible to make a "portable" version of this plugin? Unfortunately I'm on a computer without administrator privileges, so I can't write neither to Avisynth plugin directory neither to system32.
It would be very helpful if the SoundOut would look for libsndfile-1.dll in it's directory. I hope this can be done with a simple change.
sh0dan
23rd February 2008, 13:03
You can place the libsndfile in the current script directory, or the application directory (vdub). OTOH you have already gotten avisynth installed somehow, so you should be able to
A statically linked libsndfile is unfortunately not possible, since no-one has ported it to visual studio.
vlada
25th February 2008, 13:44
Thanks, placing the dll in the application directory is fine for me. I installed Avisynth with administrator rights, but now I don't have them anymore.
I have some more questions regarding your plugin. First of all looking at the size of your plugin, I can't believe it contains all the encoders. So how is it? Are the encoders included (seems so, to me) or do I need some external files (lame, aften, etc.)?
As for lame and oggenc settings, I would suggest to use more standard configuration. Which would be following:
lame: cbr, abr - bitrate, vbr - quality ( -V 0 .. -V 9) + switch whether use --vbr-new (default on).
oggenc: cbr - bitrate, vbr - quality (q -2 .. 10)
What do you think about these changes?
vlada
25th February 2008, 22:28
And one more question:
I need a CLI program, which would just "ping" the AviSynth script and start audio compression through SoundOut. I tried AVS2AVI with this command:
avs2avi.exe "audio.avs" -c "null" -o n
The problem is, that AVS2AVI starts SoundOut two times. Once during analyzing the script and once during the "fake" processing. Do you have any ideas what should I try? Many thanks.
tebasuna51
26th February 2008, 02:42
The problem is, that AVS2AVI starts SoundOut two times. Once during analyzing the script and once during the "fake" processing. Do you have any ideas what should I try? Many thanks.
Try with:
avs2avi.exe "audio.avs" -c null -q -e
vlada
26th February 2008, 19:19
tebasuna51
Many thanks, this works fine.
Ranguvar
11th March 2008, 00:57
The LAME stdin problem (http://sourceforge.net/tracker/index.php?func=detail&aid=1576370&group_id=290&atid=300290) has been fixed since 3.98 beta 5, as long as you have that or later, no need to worry people as you did me :p (http://lame.cvs.sourceforge.net/*checkout*/lame/lame/doc/html/history.html)
Thanks very much for this plugin!
Now, all we need is a direct-to-x264 plugin... :p
tebasuna51
11th March 2008, 03:16
The LAME stdin problem (http://sourceforge.net/tracker/index.php?func=detail&aid=1576370&group_id=290&atid=300290) has been fixed since 3.98 beta 5, as long as you have that or later, no need to worry people as you did me :p (http://lame.cvs.sourceforge.net/*checkout*/lame/lame/doc/html/history.html)
The LAME stdin problem never was a problem for SoundOut, everybody can use 3.97 safely.
LAME never do a fseek (the stdin problem) when standard wav header is send, like do AviSynth methods (SoundOut, BeHappy, Wavi).
jmartinr
10th April 2008, 21:55
SoundOut plugin is very useful. :thanks:
Doing two encodes at the same time I found out that the below normal priority of SoundOut can result in lagging behind if the two CPU's (Core @ Duo E6400) are very busy, resulting in the video being ready before the soundencode.
Because my batch file muxes both right afterwards this leads to problems.
So I would like a possibility to raise the priority to normal, or just a SoundOut with normal priority. Which would make it more predictable when using it on a busy system.
sh0dan
11th April 2008, 08:56
@jmartinr: What is your script and your batch file. It should not be possible for the script to shut down before the sound processing has been completed.
jmartinr
11th April 2008, 10:13
It should not be possible for the script to shut down before the sound processing has been completed. Thanks for your reply. I'll look at it a bit more before I get back to you.
jmartinr
13th April 2008, 22:47
What is your script and your batch file. It should not be possible for the script to shut down before the sound processing has been completed.
Well, that it doesn't do, but it can give an error in x264.
I'm very sorry. I tried to hunt the problem down, but didn't really succeed there. First time I retried I had the same problem, encoding 2 files and watching a video at the same time. But it took more than a half hour.
Convinced it would be easy to reproduce the error in a simple way, I didn't take a good look at it. I just noticed the "x264.exe" and "soundout.dll" in the error message. Instead I simplified my script and batch file and tried again, but although I think I only took the unimportant parts out I was not able to reproduce the error. Going back to the original configuration also did not provoke any errors anymore. I still think it has something to do with workload. The errors only came after x264 had waited for soundout to finish. I don't think it's useful to send you my whole production scheme, video files and machine configuration.
So now what? I dug out the DrWatson log of the error and attached it here. I hope that can be of any use for you.
sh0dan
14th April 2008, 21:07
@jmartinr: Do you have the original script?
I have added a "blockvideo" parameter in my current home code that will block any video requests until the audio has finished encoding - that will ensure that audio gets done before any video can be processed. If you still experience problems, PM me, and I'll send you a version.
Ranguvar
9th June 2008, 21:19
Note, SoundOut() seemed to suppress a message that should have told me I had typed the filename for my input wrong. MPC-HC would just open up the AVS and play a blank clip of correct resolution for the video for a few seconds. It wasn't until I opened it in VirtualDub that I saw the error, by way of its extended error handling.
Ranguvar
9th June 2008, 21:35
Another thing... I would like to increase the volume level of a DVD I have already ripped (5.1 AAC-LC), on the fly. If I want to use the stats from SoundOut, by how much should I AmplifydB()? Where do I look? And is there something special I need to do for 5.1 audio? Thanks, I'm not really that experienced with audio, but I'd like to be.
Example:
Analyzed 100%.
[Ch 0] Maximum:-1.80dB. Average:-36.08dB. RMS:-29.92dB. ReplayGain:5.43dB
[Ch 1] Maximum:-0.92dB. Average:-35.13dB. RMS:-29.13dB. ReplayGain:5.24dB
[Ch 2] Maximum:0.00dB. Average:1.#RdB. RMS:1.#RdB. ReplayGain:2.30dB
[Ch 3] Maximum:-6.17dB. Average:1.#RdB. RMS:1.#RdB. ReplayGain:32.14dB
[Ch 4] Maximum:-1.52dB. Average:1.#RdB. RMS:1.#RdB. ReplayGain:7.72dB
[Ch 5] Maximum:-1.85dB. Average:1.#RdB. RMS:1.#RdB. ReplayGain:7.71dB
[All channels] Maximum:0.00dB. Average:1.#RdB. RMS:1.#RdB
sh0dan
9th June 2008, 22:34
@Ranguvar: It seems like you cannot amplify your sound any more, since channel 2 is already at maximum without clipping.
On another note, the average and rms calculations seems to have problems for the last bunch of channels. Strange.
Ranguvar
10th June 2008, 01:23
Strange. However, suppose for a different 5.1 source, how do I find out how much to AmplifydB()?
And, did you see my post about SoundOut() suppressing error messages?
tebasuna51
10th June 2008, 01:57
However, suppose for a different 5.1 source, how do I find out how much to AmplifydB()?
You have:
...
[All channels] Maximum:0.00dB....
then you can't amplify more, if you have:
...
[All channels] Maximum:-4.00dB....
you can AmplifydB(4) without cut the audio signal.
About the error messages I think is a issue of the player, not SoundOut issue, but maybe sh0dan can answer better.
Ranguvar
10th June 2008, 04:42
You have:
...
[All channels] Maximum:0.00dB....
then you can't amplify more, if you have:
...
[All channels] Maximum:-4.00dB....
you can AmplifydB(4) without cut the audio signal.
About the error messages I think is a issue of the player, not SoundOut issue, but maybe sh0dan can answer better.
Okay, so it's the maximum I'm looking at. Thanks. Just to check, so if I had all channels under 0, I would amplify by the absolute value of the one closest to 0? :thanks:
tebasuna51
10th June 2008, 09:37
Okay, so it's the maximum I'm looking at. Thanks. Just to check, so if I had all channels under 0, I would amplify by the absolute value of the one closest to 0?
Yep, the below line, [All channels], give you the maximum closest to 0.
Underground78
13th June 2008, 17:31
Hello,
I have a quite strange issue when encoding with x264.exe an avisynth script using SoundOut() : after a while the classical error window pops up announcing that x264.exe has crashed but actually the encoding process continues and finally both the video file and the audio file work correctly ... It isn't a serious bug but it's just quite surprising so if you don't have time for that, no problem ! If you need some other informations (and I think so), I would be happy to try to help you.
Thanks
NB : It may be the same problem jmartinr was reported in this message (http://forum.doom9.org/showthread.php?p=1125258#post1125258) but I am not really sure ...
jmartinr
13th June 2008, 23:32
I have a quite strange issue when encoding with x264.exe an avisynth script using SoundOut() : after a while the classical error window pops up announcing that x264.exe has crashed but actually the encoding process continues and finally both the video file and the audio file work correctly ... It isn't a serious bug but it's just quite surprising so if you don't have time for that, no problem ! If you need some other informations (and I think so), I would be happy to try to help you.
Thanks
NB : It may be the same problem jmartinr was reported in this message (http://forum.doom9.org/showthread.php?p=1125258#post1125258) but I am not really sure ...
It might be. And now I've given it a bit more consideration, I think it might also be more of a X264 problem. Can you reproduce? Also with the latest X264 version? Lately quite a few bugs were removed.
Underground78
14th June 2008, 09:21
Yes, I always can reproduce if the encoding is long enough ... I always update x264 so yes, it happens with the latest x264 version too.
Underground78
12th July 2008, 10:04
Hello,
Still no idea about this problem (http://forum.doom9.org/showthread.php?p=1148642#post1148642) ?
vlada
12th July 2008, 16:40
Have anyone of you successfully used FAAC and SoundOut? For me it only encodes one half and then freezes. Nero AAC works, but it is not free for distribution or commercial use.
G_M_C
21st July 2008, 09:54
Probably allready made, but i'd like to request a feature to output 6 (7/8) separate WAVs (one for every channel). Is this possible ?
sh0dan
21st July 2008, 10:29
@All: I hope to be able to put out 1.2.0 beta, with a huge amount of bugfixes, and probably some new ones. I'm looking at FAAC native output, but I was in doubt whether it was worth it, or if the quality of FAAC was too bad.
@G_M_C: I will have a look at it, sounds like a nice feature!
G_M_C
22nd July 2008, 12:23
Probably allready made, but i'd like to request a feature to output 6 (7/8) separate WAVs (one for every channel). Is this possible ?
@G_M_C: I will have a look at it, sounds like a nice feature!
That would be great !
:)
tebasuna51
27th July 2008, 03:03
Probably allready made, but i'd like to request a feature to output 6 (7/8) separate WAVs (one for every channel). Is this possible ?
You can use WavSplit.exe (in BeHappy package) and:
SoundOut(output="cmd", filename="e:\xxx.wav", autoclose=true, showprogress=true, type=0, format=0, executable="d:\Program\wavsplit.exe", prefilename=" - ")
You obtain xxx_FL.wav, xxx_FR.wav, ...
G_M_C
28th July 2008, 09:33
You can use WavSplit.exe (in BeHappy package) and:
SoundOut(output="cmd", filename="e:\xxx.wav", autoclose=true, showprogress=true, type=0, format=0, executable="d:\Program\wavsplit.exe", prefilename=" - ")
You obtain xxx_FL.wav, xxx_FR.wav, ...
:)
Thx, didn't know you could pipe soundout's results to another programm like that. I'll give it a try when i do my next project later this week !
tebasuna51
28th July 2008, 10:13
:)
Thx, didn't know you could pipe soundout's results to another programm like that. I'll give it a try when i do my next project later this week !
You can send the output to encoders like NeroAacEnc (http://forum.doom9.org/showthread.php?p=966892#post966892) or others (http://forum.doom9.org/showthread.php?p=942513#post942513) with STDIN support.
G_M_C
28th July 2008, 11:02
You can send the output to encoders like NeroAacEnc (http://forum.doom9.org/showthread.php?p=966892#post966892) or others (http://forum.doom9.org/showthread.php?p=942513#post942513) with STDIN support.
Didnt know that :o
Thats that is a nice feature, that could save some time on some projects. I asked Sh0dan aubout the WAVs-output because i was looking for a a programm that could convert my audio (and video) to 24.000 fps. EAC3To doesnt speedup/slowdown to 24.000 as yet, so i looked at SoundOut, but it had no "seperate channel WAV-output". I needed that because i use Surcode's encoders, that accept separate channel input.
So in reality: The only thing missing for my situation is a hook to pipe soudouts output straight to Surcode's encoders ;)
I haven't seen this mention before, but when using ver 1.1.1 and MP2 output when ever I select bitrate=384 the opening application crashes after a short time and a truncated MP2 file of 256kb length is created. Any other bitrate works correctly. The source audio is from a type 2 DV avi file, 48k stereo.
But I have found an oddity. When using hcenc 023 to encode the avs video output to MPEG2 the audio saved by soundout has frequent bursts of noise. This doesn't happen if I use virtualdub to create an avi but still use soundout to create an audio file.
Gavino
31st July 2008, 10:54
When using hcenc 023 to encode the avs video output to MPEG2 the audio saved by soundout has frequent bursts of noise. This doesn't happen if I use virtualdub to create an avi but still use soundout to create an audio file.
Have you tried setting silentblock=false ?
tebasuna51
31st July 2008, 12:11
So in reality: The only thing missing for my situation is a hook to pipe soudouts output straight to Surcode's encoders ;)
Sorry but SurCode need physical monowavs files in disk.
You can use SoundOut with WavSplit, configure SurCode with Registry and launch SurCode. After you can delete the monowav files.
WaveWizard and eac3to can launch SurCode (I don't know how).
G_M_C
31st July 2008, 16:27
Sorry but SurCode need physical monowavs files in disk.
You can use SoundOut with WavSplit, configure SurCode with Registry and launch SurCode. After you can delete the monowav files.
WaveWizard and eac3to can launch SurCode (I don't know how).
Seems i have made an error while testing my DR-players capabilities. After my initial tests i concluded that i had to convert audio and video to 24fps, and because of that i really needed soundout to output monowav's/separate wavs per channel.
But it seems i've made an error while expirimenting; There seems to be less need to covert framerates, so i have less use for the separate wav-option i asked for. Sorry about that anyway.
But that doesn't mean it's not a good feature to have. There are may cases where it would be very nice to have such a feature; For instance where you have to convert from NTSC to PAL or vise versa, and you really want to keep the audio as DTS !
So, even isf there is less need for me to have this feature, i would still like to "have it handy", cause it is a good feature to have :)
DrP
1st August 2008, 22:17
Have you tried setting silentblock=false ?
Yes. It didn't make any apparent difference.
sidewinder711
5th August 2008, 15:17
Thanks for the upgrade of Soundout... it is a very neat tool!
So far I used the following command line:
SoundOut(output="mp3",filename="e:\test\audio-1.mp3", autoclose=true,showprogress=true,mode=2,cbrrate=128)
But now I would like to use Soundout for some videos having two different language/audio channels. I read the documentation but it is still unclear for me how to change the command line to get these 2 channels extracted (preferrable to mp3 or ac3). Any help appreciated.
vlada
5th August 2008, 18:02
@All: I hope to be able to put out 1.2.0 beta, with a huge amount of bugfixes, and probably some new ones. I'm looking at FAAC native output, but I was in doubt whether it was worth it, or if the quality of FAAC was too bad.
Sorry for my late answer to this point. I've been on holidays.
I think it makes sense to incorporate FAAC into SoundOut. I'm working on a GPL application which converts video to many formats including MP4s for cellphones. So I need a free AAC-LC encoder and I don't care about quality that much. I will leave the current option to use external NeroAAC encoder. So yes please, if you can incorporate FAAC, do it.
Also for the 1.2 version please try to change settings for MP3 encoding to those suggested by lame developers (http://lame.sourceforge.net/lame_ui_example.php). The vbrpresets are depricated and quality setting in range from 0 to 9 should be used.
A very good source for suggested lame settings is at HydrogenAudio (http://wiki.hydrogenaudio.org/index.php?title=LAME#Recommended_encoder_settings).
Also I'm not sure whether the settings for Ogg Vorbis are correct. The correct parameter should be a quality index, which is a real value from -2 to 10. It is described here (http://wiki.hydrogenaudio.org/index.php?title=Recommended_Ogg_Vorbis).
smok3
29th August 2008, 16:25
i have stereo in, and i would like to mix to center, but remain stereo, how would i do that in avisynth?
edit, nm, got it;
#input stereo audio, ouput stereo center-mixed audio
video = (somefile.avi) # avi has sound as well
audio = ConvertToMono(video)
l_ch = GetChannel(audio, 1)
r_ch = GetChannel(audio, 1)
stereo = MergeChannels(l_ch, r_ch)
audiodub(video, stereo)
probably
stereo = MergeChannels(audio, audio) would work as well.
wuziq
11th September 2008, 00:02
I just wanted to say THANKS for this awesome plugin.
FYI, and I'm sure everyone knows this, but I just realized that if you want to simply open an AVS script to allow SoundOut() to do its thing without actually processing the video, just use vdub.exe:
vdub.exe yourFile.avs
:)
wuziq
7th October 2008, 02:12
What are the exact PC requirements for using SoundOut?
The reason I ask is because I am getting inconsistent results on one of my machines when I use specified format output (not command line, not GUI), eg., MP3 or WAV. On that machine, sometimes the file is perfect, but most times there are one or two bursts of loud noise at the beginning. I can't seem to get any consistent, reproducible behavior.
That machine is running Windows XP Pro SP2, AviSynth v2.57, SoundOut v1.1.1.. dual Intel Xeon 2GHz.. 2GB RAM.. not sure what other details to provide (maybe someone can ask the right questions).
When I use the SoundOut GUI, the audio is always fine.
When I demux the WAV audio in vdubmod, the audio is always fine.
Not sure what else to say. Anyone ever experience something like this?
vlada
7th October 2008, 11:38
@wuziq
I wouldn't suspect your hardware for this. If AviSynth's output is correct and SoundOut output is corrupted, it seems like a bug in SoundOut.
@sh0dan
Any news regarding SoundOut 1.2?
wuziq
14th October 2008, 02:29
Question about AC3 channel ordering on the SoundOut wiki page:
Does acmod describe how SoundOut expects the input source channels to be ordered? If I use acmod=7, would I need to put the LFE channel as the last channel in my input source?
tebasuna51
14th October 2008, 13:22
Question about AC3 channel ordering on the SoundOut wiki page:
Does acmod describe how SoundOut expects the input source channels to be ordered? If I use acmod=7, would I need to put the LFE channel as the last channel in my input source?
Nope, you must preserve the standard uncompressed channel order:
FL.FR,FC,LF,BL,BR
or
FL.FR,FC,LF,SL,SR
is the same for 5.1
The encoders must accept uncompressed input at their default order and Aften encoder is compliant with this requirement.
AlanHK
21st February 2009, 10:19
I was looking at the SoundOut wiki page (http://avisynth.org/mediawiki/SoundOut) and saw
Installation and Usage
The filter is implemented as a plugin (included in AviSynth distribution since v2.6).
And no link for those of us living in 2009 and still using 2.58.
So after Googling my way here I added a link to the beginning of this thread, which has a download link.
I hope no one is annoyed, but it seemed a bit like vapourware as it was.
And a question, or perhaps a request:
Is there a way to script "analyze"?
If not, how about something like
SoundOut(output = "Statistics", filename="c:\Statistics.txt")
Also, the "Analyze" button now gives results like:
[Ch 0] Maximum:-14.58dB. Average:-34.33dB. RMS:-30.98dB. ReplayGain:8.34dB
[Ch 1] Maximum:-14.73dB. Average:-34.22dB. RMS:-30.88dB. ReplayGain:8.38dB
[All channels] Maximum:-14.58dB. Average:-34.28dB. RMS:-30.93dB
Why doesn't the "All channels" line include an average for ReplayGain?
Yes, it's trivial to work it out, but seems an odd omission.
patrick_
27th March 2009, 19:25
I'm getting what seems to be a deadlock when using showprogress=false:
this is my entire script:
Soundout(output="cmd", filename="E:\test\VTS_01_1.aac", overwritefile="Yes", showprogress=false, type=0, executable="E:\App\neroaacenc.exe", prefilename="-q 0.3 -ignorelength -if - -of")
The CommandLine Output window shows up (BTW is it possible to make that not happen?), but it will never close. It does respond to input (it's possible to scroll) but it's imposible to close the window. I have to close the calling application to close the output window. If I remove showprogress=false, it does work well (including using autoclose).
I tried using avs2avi and using custom code.
Thanks in advance.
Blue_MiSfit
27th March 2009, 19:56
This is such a tremendously useful plugin!!!
~MiSfit
zee944
12th September 2009, 10:52
I'd like to use SoundOut to analyze 6ch AC3 files, no encoding yet.
LoadPlugin("NicAudio[2.0.4].dll")
LoadPlugin("SoundOut[1.1.1].dll")
NicAC3Source("audio3.ac3")
ConvertAudioToFloat()
SoundOut()
Is this a reliable way to do it?
And is this the right channels order: FL, FR, C, LFE, SL, SR?
tebasuna51
13th September 2009, 04:06
Yes and yes.
BTW, you don't need ConvertAudioToFloat() because the NicAc3Source output is already 32 bit float.
wuziq
18th September 2009, 01:42
OK, this is a little random, but I just found a fix for a problem I was having with SoundOut(), and thought I'd post it here in case someone is having the same problem.
The problem: loud glitches near the beginning of SoundOut output.
The fix: Use KillVideo() before calling SoundOut(), and include "addvideo=true" in SoundOut() arguments.
tebasuna51
19th September 2009, 22:47
The problem: loud glitches near the beginning of SoundOut output.
I never see this problem, can you provide a sample?
MadRat
21st September 2009, 03:34
I've been using AVISynth to split, normalize and recombine the channels, then use SoundOut to save it for further processing. However, from time to time I notice I get echo when saving as a WAV file. Any idea what might be causing this?
AlanHK
21st September 2009, 10:45
I notice that if I do "Analyze Sound" that SoundOut gives a report on each channel, starting from zero:
Channel[0]
Channel[1]
etc.
However, Avisynth's GetChannel() numbers from 1. So the corresponding channels are off by one.
Shouldn't SoundOut conform to GetChannel's numbering?
tebasuna51
21st September 2009, 12:35
I've been using AVISynth to split, normalize and recombine the channels, then use SoundOut to save it for further processing. However, from time to time I notice I get echo when saving as a WAV file. Any idea what might be causing this?
Can't be a SoundOut effect.
¿How do you recombine the channels?
Sometimes the surround channels are the front channels with a delay (and others effects) and maybe you listen a echo.
AlanHK
31st August 2010, 05:10
I wrote this a year ago, no response.
I notice that if I do "Analyze Sound" that SoundOut gives a report on each channel, starting from zero:
Channel[0]
Channel[1]
etc.
However, Avisynth's GetChannel() numbers from 1. So the corresponding channels are off by one.
Shouldn't SoundOut conform to GetChannel's numbering?
Since Soundout is going to become an internal function, surely it should use the same channel numbering as other Avisynth functions?
If there is a reason for this not to be so, please explain.
EDIT:
Checking the "current" download, it hasn't been updated for three years. So I guess there isn't much chance of any response from the author, let alone an update.
a451guy451
3rd September 2010, 18:43
I'd love to see this thing get updated too. It seems, if it really is going to be included in v2.6, that there must be some kind of recent work done on it.
a451guy451
3rd September 2010, 21:06
When I try to make MP2 files at CBR 384kbps, they all seem to cut short and produce 256kb files. VBR gives me 0kb files. Anybody else experience this at all? I've tried it on a few different machines. Seems to be the only "broken" part of this plugin I can find (but it could just be me).
Raptus
16th May 2011, 14:58
Thank you for this plugin.
I'm also experiencing hangs on exit when using showprogress = false. Thats with an AVS script fed into x264, writing the audio to WAV. With showprogress = true and autoclose = true it works as expected.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.