Log in

View Full Version : SoundOut 1.1.1 - Sound Output Plugin [10/15/07]


Pages : 1 [2] 3 4

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, 19: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, 00: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, 07: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, 07: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, 12: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, 17: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, 21: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, 13: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, 15: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, 17:15
ok, got it (i will use video framerate... much simplier)

thanks! (as usuall)

BHH

tin3tin
20th July 2007, 11: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, 12: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, 19: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, 10: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, 18: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, 21: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]