View Full Version : Another flexible and extensible way of multi channel audio encoding using Avisynth.
Rockaria
21st November 2005, 17:49
The foobar2k v0.83 has been stable(in 6ch decoding & encoding) until nero released the nero 7 with different channel mapping(!) and realizing the next version of foobar has been in beta state very long. The videolan supports variety of formats of decoding but somewhat lacks in bitrates and formats for encoding. The ffdshow is only good for wav, ac3 and some few other format dsfilter encoders. And other tools require lots of broken steps and spaces until to get the final results, which is where we are asking desperately for good feature-rich flexible comprehensive integrated tools.
While reviewing the Avisynth section, thread by thread, I found there already have been good efforts and solutions for multichannel audio encoding for variety of effects and formats which only requires some integrations. The avs2wav is an avsynth client application which can toss multi channel WAV stream to other pipe capable encoders and the avisynth can perform some basic functionalities such as channel remapping and volume gaining. The avisynth can also read virtually all the formats through own plugins, dsfilters and graphedit files. For an example you need the graphedit .grf file to feed to serve the audio frame(dtsac3 source-> ffdshow to decode the dts signal in the dtswav). But for DTS files you cannot use the directshow filter directly or indirectly because of the wrong 48k sample rate information for 44.1k 6ch streams(don't know which tool is responsible), which require the NIC's plugin to be used. Also you may need a hexeditor to extract some blocks of preceding filler(after the header) to make the dtswav decoders(videolan, foobar, ffdshow) seek properly.
Below are the tools and scripts required for my tests encoding with correct channel mappings for different decoders and encoders. The 6ch ac3 speaker test file would be useful to identify the channels correctly by playing the avs script using MPC or any dsfilter enabled players. The encoders are in the same folder and the avsynth plugins are installed in its own plugin folder.
The launcher user interface(shell or gui) wouldn't be that hard to make, for those who transcode a lot, which is left for who actually need it while I am more focused on the existing and ever-growing features of avisynth.
My poor ears cannot find any differnce between vbr he q6 and q8(forced) of nero aacenc, except the result file size..
And the v7 aacenc32.dll is almost half the size of the latest v6 version, which looks like nero excluded all the test routines or actually OPTIMIZED it?(no it requires mfc71.dll).
<6ch cli encoders supporting stdin>
http://www.saunalahti.fi/~cse/files/naac.zip : used with aac.dll & aacenc32.dll of nero 6/7 in the nero plugin directory, can be overrided by local placement
http://www.free-codecs.com/download/FLAC.htm : better space usage than wav
http://www.free-codecs.com/download/Vorbis.htm : no good results for me
http://www.free-codecs.com/download/WavPack.htm : lossy/lossless
...
<avisynth related>
http://www.avisynth.org/ : channel mapping, mixing, volume gain control, resampling...
http://www.avisynth.org/warpenterprises/files/nicaudio_25_dll_20050704.zip : ac3, dts, mpa ..
http://home.pages.at/kassandro/avs2wav.rar : 6ch std/wav out
...
<graphedit related>
http://home.comcast.net/%7eappleguru/graphedt_october2004.zip : decoding, encoding, DSPs
http://www.free-codecs.com/download/DTS_AC3_Source_Filter.htm : dts,ac3 source filter
http://fin.afterdawn.com/ohjelmat/video_ohjelmat/videocodecit/ffdshow.cfm : decoding(includes dtswav), channel mapping, volume gain, ac3 encoding, resampling, up/down mixing and some DSPs
...
<other useful files>
http://www.needfulthings.host.sk/tools : WaveWizard v0.54b (http://www.needfulthings.host.sk/tools/item.php?id=28) and many good tools...
http://jsoto.posunplugged.com/audiotools.htm : multiwav_1001_exe.zip (http://jsoto.posunplugged.com/tools/multiwav_1001_exe.zip) delaycut_1204_exe.zip (http://jsoto.posunplugged.com/tools/delaycut_1204_exe.zip)
http://www.seemoredigital.net/51_Test_Encodes/51_AV_Setup_Test_Files.html : AC3 - 6Ch 'Speaker Test'.7z for setting up the channel orders
http://www.free-codecs.com/download/Media_Player_Classic.htm : for playing avs scripts.
http://www.hiddensoft.com/autoit3/ : an easy gui script programming
http://www.mlin.net/misc.shtml : PathCopyEx.msi (http://www.mlin.net/files/PathCopyEx.msi), RegSvrEx.zip (http://www.mlin.net/files/RegSvrEx.zip)
and doom9's Avisynth section (http://forum.doom9.org/forumdisplay.php?f=33)
...
other recent resources (http://forum.doom9.org/showpost.php?p=779783&postcount=3) : Sox Filter, ffmpeg, Lame...
<aac.avs> : avs script#a=DirectShowSource("C:\a n y\Ds Filter.wma")
#DirectShowSource("c:\44.1k\DtsWav.WAV")
#DirectShowSource("GraphEdit.GRF")
#NicDTSSource("DtsMusic.DTS")
NicAC3Source("DdMusic.AC3")
#GetChannel(a,2,3,1,6,4,5).SSRC(48000).Normalize()
GetChannel(a,2,3,1,6,4,5)
#SSRC(48000)
Normalize()
#below are temporary fix for avs2wav : use SSRC if the 44.1k streaming is pending
#SSRC(48000).SSRC(44100)
#AudioDubEx(Trim(Colorbars(320,240),0,1),last)
<avs2aac.cmd> : simple encoding shell script
avs2wav.exe aac.avs - | naac -profile he -vbr 8 - 8.m4a
rem avs2wav aac.avs avs2wav.wav
rem MakeAVIS.exe -i aac.avs -a makeavis.wav
rem ---somebody might be able to enable the flexibility of behappy using IMPORT() & || *.avsi
rem bepipe.exe --script "import(^ogg2ch.avs^)" | oggenc2.exe -q5 - -o 2.ogg
rem bepipe.exe --script "import(^aac6ch.avs^)" | naac -profile he -vbr 5 - 6.m4a
<enc.cmd> : simple launcherrem START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
rem [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
rem [/WAIT] [/B] [command/program]
start "avs2aac" /LOW avs2aac.cmd
<<implementations>>
<tools>
. kasandro's avs2wav (http://home.pages.at/kassandro/avs2wav.rar) : original , simple and basic
. dimzon's behappy (http://forum.doom9.org/showthread.php?t=104686) : gui replacement of avs2wav, heavily dimzoned, lost some (http://forum.doom9.org/showpost.php?p=750072&postcount=115) flexibility & transparency
. bepipe : a temporary conversion of avs2wav, single command line interface, maybe still usable.
...
<DSP functions & scripts>
..
. tebasuna51's original DPL II function (http://forum.doom9.org/showpost.php?p=750673&postcount=123) with a bit different overall matrix balance.
. MiCK76's DPL II encoder function based on azid? (http://forum.doom9.org/showpost.php?p=753887&postcount=131) with volume reduced matrix of FFDShow
. Rockaria's DPL II encoder functions based on FFDShow's model (http://forum.doom9.org/showpost.php?p=786690&postcount=82), still not the perfect DPL II decoding though
. Rockaria's UPMIX/DPLII encoding examples in CLI mode using avs2wav and bepipe (http://forum.doom9.org/showpost.php?p=787789&postcount=149)
. tebasuna51's DRC macro based on sox plugin (http://forum.doom9.org/showpost.php?p=779165&postcount=60)
. NorthPole's 6ch upmix macro (http://forum.doom9.org/showpost.php?p=786226&postcount=86)
[hostory]
...
xxx xx 2006 : a clarification of the required nero dlls.
Feb 17 2006 : added the implementations on the bottom.
Feb 19 2006 : added a script example using bepipe & avs2wav, modified some script example here.
Feb 20 2006 : Closure.
SeeMoreDigital
21st November 2005, 18:37
Have you actually been able to generate 6Ch AAC files using Foobar2000 with Nero7 filters?
I have not installed Nero7 yet and can't see the point in doing so until they provide a separate NeroDigital only packages (http://www.nero.com/nerodigital/eng/download.php).
If you have managed to do it with Foobar2000. Can you generate an 6Ch AAC encode, using the "6Ch AC3 Speaker Test file" that can be found on my web site and e-mail it to me please?
Iyyyyy thank-you
Rockaria
21st November 2005, 20:50
I corrected some small mistypings and YES i've tested the aac(mp4,m4a) encoding with foo_naac.dll/foo_nero.dll/naac.exe and version 6/7 of aacenc32.dlls. It's easy to detect the difference although I am not sure which is causing it : foobar encloder plugins/cli or nero encoders. When I used the above described method, both v6 and v7 of nero encoder dlls reqired the same channel mappings. Maybe the foobar aac encode-interface routine is checking the nero dll version(i.e. to be v6)?
For your own prompt verification (I am off the test machine ;) ), I think you can install the trial version on any computer and copy the aacenc32.dll from the program files nero common folder to the local script folder to override the existing nero dlls until you get the nero digital, recode 2 or any seperate version equivalent to v7.
SeeMoreDigital
21st November 2005, 20:57
Bummer!
In that case I wonder if anybody else could oblige?
Cheers
Rockaria
21st November 2005, 21:34
Don't be disappointed SeeMoreDigital!
Meanwhile(until I get home), you can check this thread (http://forum.doom9.org/showthread.php?p=733463#post733463) to get other's experience.
In case you still need the proof, I can happily email the result later.
SeeMoreDigital
21st November 2005, 21:51
Don't be disappointed SeeMoreDigital!
Meanwhile(until I get home), you can check this thread (http://forum.doom9.org/showthread.php?p=733463#post733463) to get other's experience.
In case you still need the proof, I can happily email the result later.Yes... I've read this thread (and even taken part)....
Once set-up, Foobar2000 usually makes very light work of re-encoding and correctly mapping 6Ch AC3 to 6Ch AAC. So I'm curious to know how the streams are mapped.
Rockaria
21st November 2005, 23:28
I agreed the foobar2k v0.83 had been very satisfactory with the decent multi-channel aac encodings and I actually liked it(and it's gui!).
But I have no idea about the nero's strategy on the v7 aac encoder but am sure the channel mapping is different from the old stable setup and found there is an alternate & more flexible method as I described above.
Now the foobar2k beta 0.9 version stdinput plugin read the aac stream correctly and we may be having the correct channel mappings interface from the v0.9 regardless of the nero aac encoder version.
My feeling is that the foobar nero aac encoder interface is somewhat hardcoding the channel order somewhere inside. What I've been missing with the foobar is an explicit channel remapping plugin for the flexibility.
Also I think the stream passing between the dlls would be somewhat faster than between the processors through pipe, but not that significantly in processing and the lightweight feature seems to be more from the user interface than the actual processing. The above method uses only two EXEs and some DLLs, less than 3 maybe including the avisynth.dll itself, also it would be worthwhile to check how many dlls and memory are actually used with foobar encoding...
SeeMoreDigital
22nd November 2005, 11:22
I know people are excited about the prospect of using Foobar2000 v0.9 but we could get ourselves into a real mess if we don't test Nero's new filters more throughly with Foobar2000 v0.8.3 first ;)
Cheers
Rockaria
22nd November 2005, 16:34
Let me remind you this is a thread about a new method practically providing a flexible environment for any type of source and target format with correct channel order, where includes the v7 nero aac encoder.
Actually, as for the foobar2k v0.83, they are all known issue, the only way to encode to nero 6ch aac without channel messup, as well as the only player with the messed up channel order in aac decoding.
What tebasuna51 stated in the link above implies something useful :
Using bsn.dll v0.24 by DPeshev,Richard,E-Male,DSPguru (DSPguru.Doom9.org).
or
Using bsn.dll replacement v0.02 by dimzon (dimzon541@gmail.com).
-input FL_FR_C_LFE_SL_SR.wav ... -bsn( -6chnew ... Wrong aac channel mapping
-input Correct.ac3 ... -bsn( -6chnew ... Wrong aac channel mapping
-input FR_C_FL_SR_LFE_SL.wav ... -bsn( -6chnew ... Correct aac channel mapping
Using bse_Nero7WA.dll by dimzon, Build Nov 3 2005, 14:10:28 (latest)
-input FL_FR_C_LFE_SL_SR.wav ... -dimzon( -dllname bse_Nero7WA.dll -6chnew ... Correct aac channel mapping
-input Correct.ac3 ... -dimzon( -dllname bse_Nero7WA.dll -6chnew ... Correct aac channel
The channel order FL_FR_C_LFE_SL_SR looks like for the WAV every decoder should line up to decode or play.
The order FR_C_FL_SR_LFE_SL stands for the remapping a=GetChannel(a,2,3,1,6,4,5) in above script and seems to be the actual channel order for AAC in both nero aac versions.
Then what would be the problem?
Why they needed a new nero7 encoder plugin for besweet?
I guess something hardcoded hidden depending on the aac encoder version.
SeeMoreDigital
22nd November 2005, 17:44
While I understand what you are saying, unfortunately there are many posts on this forum from members asking why there AAC channel orders are messed up!
Some of these channel order problems seem to be associated with people converting AC3 to WAV and then AAC. This approach always waves "red flags" to me, as it opens up two potential places to "cock up" the channel order.
The first "cock-up" area is getting the AC3 to WAV channel mapping right. The second "cock-up" area is getting the WAV to AAC channel mapping right.
As Foobar2000 removes the need to convert to WAV first, it illiminates these two "cock-up" areas!
So until somebody sends me an 6Ch AAC file thats been directly encoded from my 6Ch AC3 source using Foobar2000 v0.8.3 with Nero7's filters, I'm not convinced there's a channel mapping problem!
Cheers
Rockaria
22nd November 2005, 18:07
While I understand what you are saying, ..
The first "cock-up" area is getting the AC3 to WAV channel mapping right. The second "cock-up" area is getting the WAV to AAC channel mapping right.
As Foobar2000 removes the need to convert to WAV first, it illiminates these two "cock-up" areas!
Unfortunately, it seems not. Every trancoding includes these two steps(decoding & encoding) internally or externally.
Hiding things(black box), is what the users cannot control at all, must be used only for something stable or are abused when the author want an everlasting provider position, very opposite to what we are looking for. :rolleyes:
SeeMoreDigital
22nd November 2005, 18:28
Unfortunately, it seems not. Every trancoding includes these two steps(decoding & encoding) internally or externally.
Hiding things(black box), is what the users cannot control at all, must be used only for something stable or are abused when the author want an everlasting provider position, very opposite to what we are looking for. :rolleyes:So have you (or anybody else) tried generating an 6Ch AAC encode using my suggested method, or not?
Here's a link to my 6Ch AC3 Speaker Test Sample (http://81.98.148.105/Uploaded_Files/Doom9_Forum_files/6Ch_AC3_Sample.7z)
Rockaria
22nd November 2005, 19:18
YES i've tested the aac(mp4,m4a) encoding with foo_naac.dll/foo_nero.dll/naac.exe and version 6/7 of aacenc32.dlls
In case you still need the proof,..
Let me remind you this is a thread about a new method..
What tebasuna51 stated in the link above implies something useful ..
Why they needed a new nero7 encoder plugin for besweet?
..are abused when the author want an everlasting provider position, very opposite to what we are looking for.
Yes... I've read this thread (and even taken part)....
My suggestion :
<Now it's your thread.> or <Has anybody tried the introduced method and found anything to be improved?> It has lots of potentials...
SeeMoreDigital
22nd November 2005, 19:29
I don't want to fall out with you about this Rockaria, I'm simply trying to establish whether you generated an AAC file, using the method I suggested!
You say: "YES i've tested the aac(mp4,m4a) encoding with foo_naac.dll/foo_nero.dll/naac.exe and version 6/7 of aacenc32.dlls" but you did not confirm whether it was with Foobar200 v0.8.3.
If you have... can you please e-mail me the file please?
Cheers
Rockaria
22nd November 2005, 19:40
..YES i've tested the aac(mp4,m4a) encoding with foo_naac.dll/foo_nero.dll/naac.exe and version 6/7 of aacenc32.dlls. It's easy to detect the difference although I am not sure which is causing it : foobar encloder plugins/cli or nero encoders. When I used the above described method, both v6 and v7 of nero encoder dlls reqired the same channel mappings. Maybe the foobar aac encode-interface routine is checking the nero dll version(i.e. to be v6)?
For your own prompt verification (I am off the test machine ;) ), I think you can install the trial version on any computer and copy the aacenc32.dll from the program files nero common folder to the local script folder to override the existing nero dlls until you get the nero digital, recode 2 or any seperate version equivalent to v7.
I will try to send you the result even if I believe myself has done the best to explain. :)
Mutual respects to the anonymous,
Rockaria
23rd November 2005, 02:13
OK. let us conclude. I did some more test based on the 6ch ac3 speaker test file I have from nforce 2 speaker setup directory.
naac.exe required two files from nero plugin directory, which can be overrided by the local folder placement : aac.dll and aacenc32.dll.
aac.dll seems to be responsible for the channel lineup from the assigned decoded wav buffer and can be used with any combinations of these two files.
But the channel line ups are different :
.v6 aac.dll : no need for channel remapping : FL_FR_C_LFE_SL_SR or a=GetChannel(a,1,2,3,4,5,6)
.v7 aac.dll : need the channel remapping : FR_C_FL_SR_LFE_SL or a=GetChannel(a,2,3,1,6,4,5)
So the conclusion is :
.nero changed the aac channel order from v7 by mistake or new policy, potentially a big confusion anyway.
.you can use the v6 aac.dll + v7 aacenc32.dll(actual encoder) with existing transcoding environment such as foobar2k v0.83 or besweet.
SeeMoreDigital
23rd November 2005, 02:30
Can you zip up the AAC file and e-mail it to me please?
Cheers
tebasuna51
23rd November 2005, 03:50
@SeeMoreDigital
I recode to aac your ac3 test file with Foobar2000 v0.8.3, foo_naac, Nero7 and i send you by e-mail.
The aac is wrong channel mapping like with BeSweet and normal bsn.
Rockaria
23rd November 2005, 08:03
Thanks for being able to finish the side story of nero 7 channel mapping change, roles of these two nero dlls and walkaround by overriding the v6 aac.dll, which does not depreciate the avisynth's flexibility.
I worried about the LFE and corresponding channel behavior by using the v6 aac.dll for v7 encoder. But it turned out to be safe.
Thanks again for your interest in the introduced avisynth method. period.
tebasuna51
23rd November 2005, 11:20
Sorry, Rockaria, I only want contribute to finish this dialog because I'm interested in your avisynth method, but only to learn (know more about avisynth is in my long todo list).
I like this thread becomes a discussion about your method, but I can't contribute now.
Rockaria
23rd November 2005, 16:53
Well, it's not my method. :)
I just gathered the related links and provided the minimum environment to start with for multi channel audio encoding with lots of potential.
We may find some more pipe-in capable encoders.
Or maybe somebody can provide a friendly user interface with job control.
It's not daemon server, just a dll starting to provide the decoded a/v stream by any application's call(initially designed for vdub).
The script is not like javascript or vbscript, rather a procedure definition language(like RPG), so no if-else-endif.
The provided minimum is enough to start with and maybe already surpassing some other integrated tools..
dimzon
24th November 2005, 12:14
WOW! Very fine idea!
Seems like I can modify avs2wav in order to support inline scripting:
BePipe.exe NicDTSSource("DtsMusic.DTS").GetChannel(2,3,1,6,4,5) | naac -profile he -vbr 8 - AacMusic.m4a
SeeMoreDigital
24th November 2005, 14:13
Thanks for encoding and e-mailing the 6Ch AAC sample as per my instructions. There appears to be no doubt that Nero "has" changed the AC3-to-AAC mapping, when using external tools :devil:
I wonder if I could trouble you guys further by generating one last test file for me please. This time using Nero7's version of Recode 2. As I'm curious to see if this new version of Recode2 is handling the channel mapping correctly.
Could you please use this PAL MPEG-2+AC3 12sec Sample (http://81.98.148.105/Uploaded_Files/Doom9_Forum_files/PAL_MPEG-2+AC3_12sec_Sample.7z) as your source.
Many thanks
Rockaria
24th November 2005, 18:02
WOW! Very fine idea!
Seems like I can modify avs2wav in order to support inline scripting:
BePipe.exe NicDTSSource("DtsMusic.DTS").GetChannel(2,3,1,6,4,5) | naac -profile he -vbr 8 - AacMusic.m4a
That seems one step shortened way of the user interface!
I am not sure if the client application(avs2wav or BePipe) can call the avisyinth methods directly(dll interface calls with parameters) but the stardard interface is through *.avs script file.
In this case, you will have to generate the temporary avs file in the program.
When you replace the avs2wav itself, there seems to be some benefits as well as possible restrictions:
. can make itself a gui appcation with user parameter input
. can display the job progress like fobar2k cli call
. hard to cover all the current & future features with simple user parameters
. possibility of losing the flexibility in favor of the convenience.
Overall, I will have to be satisfied with a role just reintroducing it.
The rest is yours anybody talented. :)
dimzon
24th November 2005, 18:19
Overall, I will have to be satisfied with a role just reintroducing it.
I believe it's great way to create BeSweet successor. BeSweet itself is very good but it's not OpenSource and it's hard to extend functionality. AviSync in other way is very flexible and extensible (via plugins and shared functions)...
So i will stop futher BeSweet plugin development and swith to BePipe development. It will be OpenSource command-line application written in C# (yeah, I do AVS2WAV to C# portation right now)
Kurtnoise
24th November 2005, 20:19
why C# ?
ANSI C is beautiful...
E-Male
24th November 2005, 21:55
why C# ?why not? :)
dimzon
25th November 2005, 10:07
why C# ?
ANSI C is beautiful...
Actually I hate C/C++ :devil:
dimzon
25th November 2005, 12:56
first alpha avail here: http://www.mytempdir.com/281217
bepipe --script "directShowSource(^c:\ab\re\001 Jenny From The Block.m4a^)" | C:\Progra~1\foobar2000\encoders\oggenc.exe -Q -q -2 - -o c:\test.ogg
Note: Replace quotes in script by ^
second alpha is here: http://www.mytempdir.com/281242
dimzon
25th November 2005, 15:11
So have you (or anybody else) tried generating an 6Ch AAC encode using my suggested method, or not?
Here's a link to my 6Ch AC3 Speaker Test Sample (http://81.98.148.105/Uploaded_Files/Doom9_Forum_files/6Ch_AC3_Sample.7z)
bepipe --script "NicAc3Source(^c:\test.ac3^).GetChannel(2,3,1,6,5,4).normalize()" | C:\Progra~1\foobar2000\encoders\oggenc.exe - -q -2 - -o c:\test.ogg
HERE: http://www.mytempdir.com/281434
SeeMoreDigital
25th November 2005, 15:30
Thanks for the Vorbis in .OGG file.....
Sadly the speakers are not correctly mapped :(
Cheers
dimzon
25th November 2005, 15:34
Thanks for the Vorbis in .OGG file.....
Sadly the speakers are not correctly mapped :(
Cheers
Seems like speakers are not correctly mapped in You AC3 or something wrong with my PC/soundcard/etc. Bsz Your original AC3 file has invalid file mapping (left with right).
SeeMoreDigital
25th November 2005, 16:27
Seems like speakers are not correctly mapped in You AC3 or something wrong with my PC/soundcard/etc. Bsz Your original AC3 file has invalid file mapping (left with right).What do you mean by "invalid mapping"?
I've tried my AC3 and MPEG-2+AC3 in VOB files in just about every stand-alone DVD player and software media player I can find and the output appears to be perfectly mapped :confused:
Cheers
dimzon
25th November 2005, 16:30
What do you mean by "invalid mapping"?
I've tried my AC3 and MPEG-2+AC3 in VOB files in just about every stand-alone DVD player and software media player I can find and the output appears to be perfectly mapped :confused:
Cheers
Seems like it's my PC problem (swap left with right)
Just try to encode to ogg using such filter GetChannel(1,3,2,4,5,6) and check channel mapping
SeeMoreDigital
25th November 2005, 16:44
I've just encoded the following 6Ch Vorbis in OGG (http://81.98.148.105/Uploaded_Files/Doom9_Forum_files/6Ch_Vorbis_in_OGG_From_SMD.zip) using HeadAC3he..... and it seems to be correctly mapped, as I can play 6Ch Vorbis in hardware using my Pioneer DVD player ;)
Cheers
dimzon
25th November 2005, 16:45
I've just encoded the following 6Ch Vorbis in OGG (http://81.98.148.105/Uploaded_Files/Doom9_Forum_files/6Ch_Vorbis_in_OGG_From_SMD.zip) using HeadAC3he..... and it seems to be correctly mapped, as I can play 6Ch Vorbis in hardware using my Pioneer DVD player ;)
Cheers
Can You encode using BePipe and GetChannel(1,3,2,4,5,6) ?
Thanx!
Rockaria
26th November 2005, 12:38
second alpha is here: http://www.mytempdir.com/281242
Wow! It's just amazing! Who on earth can capture all( :) ) the requirements and constraints and deliver the solution(alpha) in 24hrs? I just miss those days... It works as it is supposed to.
BePipe and GetChannel(1,3,2,4,5,6)
When I tested the multi channel ogg encoding GetChannel(1,3,2,5,6,4) was correct for several dsfilters including ffdshow and players like foobar, vlc. But the sound was funny, especially on the center and FR.
Since they stopped the multi channel encoding enhancement after the official development of 1.0 spec, it seems even got worse(broken).
Everything(including the foo_ogg which provide right channel order) proves it in my PC environment. What I haven't tested is using the old 1.0 version of the ogg encoder.
The attached encoded ogg file seems to sound ok except the channel messup which you can manage with ffdshow channel mapping. I wonder which encoder version is used with it.
Actually I hate C/C++
I believe any language is OK as far as it satisfies the productivity and minimum portability and speed.
My belief is the inner side of the user interface and the setup routine can be dirty as far as it suffices the flexibility but the core looping routine must be optimized.
As it proves, we cannot satisfy everybody's desire (from the beginning). But it's already providing the decent solutions! As I saw it and you saw it.
Rockaria
27th November 2005, 17:34
Time to temporarily conclude about the multichannel vorbis.
I did some thorough tests on the various versions of vorbis encoders and decorders, there are two groups :
1. foobar, winamp, ffdshow : foo_vorbisenc encodes without channel remappings and plays decently(not perfectly) on these decoders.
The two ffdshow vorbis decoder plugins failed to play reasonably.
When encoded with oggenc/oggenc2, it required the channel remapping GetChannel(a,1,3,2,5,6,4) to be played on these decoders
2. oggenc, oggenc2 and illuminate dsf pack : looks like original line
foobar encoded music sounds really funny here. The format seems to keep the channel order in FL_C_FR_SL_SR_LF.
3. Both seems to have some slight echoing especially on short media, which requires some tuning as well as the channel coupling enhancement promised in their spec.
Also as seen in the nero aac case, the different formats of channel order causes huge-confusion or no-more-use. People need to streighten them out.
Overall, it again does not depreciate the avisynth's flexibility at all.
SeeMoreDigital
27th November 2005, 18:06
3. Both seems to have some slight echoing especially on short media, which requires some tuning as well as the channel coupling enhancement promised in their spec.
Also as seen in the nero aac case, the different formats of channel order causes huge-confusion or no-more-use. People need to streighten them out. Agreed....
Which I why I would like to confirm if the channel mapping is incorrect when generating 6Ch AAC encodes in new Nero7 version of Recode2.
If the new Nero7 version of Recode2 generates "incorrectly" mapped files then Nero have a real problem/bug on their hands....
But if new Nero7 version of Recode2 generates correctly mapped files, then Nero are just being bloody minded by cocking-up the channel orders up for all us people who like to use their audio encoding filter with other encoding tools :angry:
Cheers
Rockaria
27th November 2005, 18:58
The funny thing is nero released the new v6 version after the v7 release, which forces me to keep as silent as possible. I don't believe they will abandon the v6 user or force them to upgrade to v7 while keeping two different versions of aac formats. Looks like a temporary confusion. I am gonna wait until nero settle down on this.
The trap of the confirmation or the authority is actually everybody's role. I learn from anybody's experience regardless of the posting count, registered date or birthday, do some tests if I need more facts and like to share what I've learnt, and sometimes get disappointed when misunderstood like everybody does. ;)
dimzon
28th November 2005, 12:23
http://img505.imageshack.us/img505/2240/untitled0hz.gif
I'm working on GUI right now :)
SeeMoreDigital
28th November 2005, 12:38
Does anybody know how the channel mapping information is stored for 6Ch AAC streams?
I know this may sound ridiculous (to those people who know about such things) but is could it be possible to change the mapping information of 6Ch AAC streams. Ie: Is there something in the stream that can be re-written without having to re-encode it?
Cheers
Wilbert
28th November 2005, 13:39
@dimzon,
This is great stuff! Do you consider to make bepipe+gui OS?
dimzon
28th November 2005, 14:05
Do you consider to make bepipe+gui OS?
Yes!
Linking Avisynth statically or dynamically with other modules is making a combined work based on Avisynth. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
BePipe alpha sources is avaliable by request if You need it.
dimzon
28th November 2005, 18:57
http://img505.imageshack.us/img505/2240/untitled0hz.gif
I'm working on GUI right now :)
first GUI pre-alpa http://www.mytempdir.com/287448
Note! Encoding is not working Yet! Just to test how to manage
sources/dsp/encoders!
Note! Settings are stored in c:\be-happy.xml (will be fixed soon)
Rockaria
29th November 2005, 02:48
Extreme flexibility!
Yeah, methods are applied to the last(defined) clip.. hmm :)
Maybe we can add more sources to join(+) or mix in the version 2.
Or set the sequences to the DSPs by allowing the up/down arrow button to the focused if it affects(Sorry, it's already there!). And do we need a profile management(overall)?
Drop-down and/or shell extention menu(like dbPowerAmp) would be another good bonus(as well as the copy-to-clipboard or save to *.avs).
These are all that I can think of for now..
This is great! I am waiting for the working version already!
Rockaria
29th November 2005, 05:19
Does anybody know how the channel mapping information is stored for 6Ch AAC streams?
.. Is there something in the stream that can be re-written without having to re-encode it?I guess(derived from the facts here) the channel order is implicitly hardcoded to the stream(body) itself. If the format is designed to read the channel assignment from the header, any player should decode the media without the messup regardless of the versions. I've heard your v6 AACs are decoding well with your h/w player. But in the s/w player, I believe we can use the FFDSHOW channel remapping in decoding time depending on the versions, until nero resolves the issue.
SeeMoreDigital
29th November 2005, 13:13
I've heard your v6 AACs are decoding well with your h/w player. But in the s/w player, I believe we can use the FFDSHOW channel remapping in decoding time depending on the versions, until nero resolves the issue.If the Nero7 version of Recode2 produces incorrectly mapped AAC channels then I agree, Nero will have to resolve the issue.
But if however Recode2 generated streams are okay.... I can't, in all honesty, see Nero's engineers "busting-a-gut" to help out the users of "third-part" software.... It would not be in there best interest to do so ;)
Cheers
Rockaria
29th November 2005, 14:19
Yeah, the problem seems to be any backups to be played on your h/w decoder. Would they support the special firmware upgrade too, for the v7 recode 2-ed contents?..
SeeMoreDigital
29th November 2005, 15:27
I'm not with you!
All my 6Ch AAC streams are perfectly mapped because they were all encoded using the Nero6 version of Recode2 or Foobar2000 with Nero6 filters!
Like I've said before, we need to "map test" a 6Ch AAC sample generated with the Nero7 version of Recode2 before we can establish whether Nero has a real problem it needs to address!
If we discover that 6Ch AAC samples generated with the new Nero7 version of Recode2 are "incorrectly mapped" then we all need to inform Nero for a fix before we waste time creating our own fixes.....
That's all I'm trying to say ;)
Cheers
Rockaria
29th November 2005, 16:26
SMD, I understand your situation. But I (perhaps including many others) am still looking for a proper format to backup the contents with least space usage.
With nero's aac he vbr streaming or any forced quality, I am not still convinced with it for a backup purpose unlike you. So the recode 2 is not of any special interest to me at the moment. I am just trying to focus on the purpose of this thread.
As I've said ever since from the beginning, this thread is intended for introducing the new multi channel transcode method. Because it can handle any channel mess up (with version changes noticed by many already) with it's flexibility, I learned it's not a proper place to go into any further detail's of the unstabilized issue, also because you don't want to believe what is said by anybody normal.
So I will have to agree with you. Some we might need to resolve the issue right now but in a correct place with a proper title please...
SeeMoreDigital
29th November 2005, 17:11
It's not "my situation", it's everybody's situation!
It's vital we establish whether Nero have made a mistake with their AAC codec using their own encoder first.
Once this has been properly established we can then take the appropriate action!
If we discover Nero have made a mistake at their end. It would be a waste of everybody's time here developing "third party" fixes. Even more so if Nero correct the problem on the next release!
Now.... has anybody taking part in this thread, checked to see whether the Nero7 version of Recode2 generates 6Ch AAC streams the wrong way round. If so can you please confirm your findings?
Cheers
dimzon
29th November 2005, 17:46
This is great! I am waiting for the working version already!
Get alpha here: http://www.mytempdir.com/289180
Rockaria
29th November 2005, 17:48
It's open here (http://forum.doom9.org/showthread.php?t=103397) and hope dimizon take the thread. thanks.
Rockaria
30th November 2005, 03:18
It works exactly as the gui prototype.
The channel mapping GetChannel(2,3,1,6,4,5) and GetChannel(1,3,2,5,6,4)
geterate correctly mapped channel orders depending on the encoders(& target decoders) with a mouse click.
By far the most generouse & hassle-free transcoder supporting virtually all the formats!
Only some pipe-in encoders are left for few more unsupported formats.
The interface is so flexible as it can answer to any DSPs and I/O requirements on a single clip.
I've not compared the performance yet but it seems reasonably fast.
Pretty much impressed by dimizon. Wish you continue the good work and everybody share the flexibility with this. :thanks:
But where did the be-happy.xml go?
dimzon
30th November 2005, 09:34
GetChannel(1,3,2,5,6,4)
Read about OggVorbis channel mapping (http://www.hydrogenaudio.org/forums/index.php?showtopic=38618&st=0)
But where did the be-happy.xml go?
look @ DocumentsAndSettings\<YourLogin>\LocalSettings\ApplicationData\dimzon\BeHappy\
dimzon
30th November 2005, 09:41
BeHappy development is paused until next year... (I'm busy IRL again)
BeHappy & BePipe source code is avaluable by request (feel free to PM me or send mail to dimzon541<dog>gmail<dot>com)
Rockaria
30th November 2005, 12:28
OggVorbis channel mapping (http://www.hydrogenaudio.org/forums/index.php?showtopic=38618&st=0)
..
look @ DocumentsAndSettings\<YourLogin>\LocalSettings\ApplicationData\dimzon\BeHappy\
Oggenc appears not to remap 5.1 channel order from WAV order (L/R/C/LFE/BL/BR) to Vorbis order defined by xiph's specifications :
six channels : the stream is 5.1 surround. channel order: front left, front center, front right, rear left, rear right, LFE
Tested with rarewares build 2005-07-10.
The same problem applies to oggdec (again assumes WAV channel order on libvorbis output, so it actually decodes incorrect oggenc output back to correct WAV).
It again backs up my test results : GetChannel(1,3,2,5,6,4) == front left, front center, front right, rear left, rear right, LFE based on the wav order
Other trivials :
. maybe we can share the xml configuration by request.
. for the graphedit DirectShowSource, I couldn't find any way to replace the path inside of the GRF file. So the best way so far is to copy-rename to the predefined path for any media used in the GRF.
BeHappy development is paused until next year... (I'm busy IRL again) Yeah, it has proved everything perfectly, at least to me. See Ya Next Year!
dimzon
30th November 2005, 12:43
. maybe we can share the xml configuration by request.
Seems like You read my mind. I'm thinking about Source/DSP/Encoder import/export feature :)
redfordxx
30th November 2005, 18:23
Hi,
my same issue, but I feel interresting to mention it here too.
WMA 5.1 on WinXP as an input does not work correctly for me. Test SeeMoreDigital's testing WMA 6Ch file on your machine, if you please.
Or, maybe, there is an alternative wma filter for avisynth?
But in general, I consider it cool ;)
R.
Rockaria
1st December 2005, 14:17
Dimzon, you seem to read my mind also ;)
@redfordxx :
It reminds me of this thread (http://forum.doom9.org/showthread.php?p=740887#post740887) which backs up my experience too.
WMA pro 5.1 can be encoded easily using DBPowerAmp, but gets only 2ch from default directShow streaming.
If we can learn the MPC dsfilter usage, I think we can make a GRF contained to an avs to be tested on any dsfilter capable player.
You can also test the encoding using the DirectShowSource("*.GRF") in a BePipe or BeHappy.
I will try to find a way here too. good luck.
redfordxx
1st December 2005, 14:35
It reminds me of this thread (http://forum.doom9.org/showthread.php?p=740887#post740887) which backs up my experience too.yeah I started it...
backs up means... it happened to you too?
WMA pro 5.1 can be encoded easily using DBPowerAmp, but gets only 2ch from default directShow streaming.
If we can learn the MPC dsfilter usage, I think we can make a GRF contained to an avs to be tested on any dsfilter capable player.
You can also test the encoding using the DirectShowSource("*.GRF") in a BePipe or BeHappy.
SeeMoreDigitals and my experitence: GraphEdit makes 2ch too
MPC plays 6ch and VLC plays 6ch with incorrect mapping.
I don't know the architecture of these SW, but maybe there are some filters in MPC or VLC which can be used?
Now I have to keep 6ch do WMV-->Stream Editor-->WMA-->Canopus Procoder-->PCM-->AviSynth script.
Rockaria
1st December 2005, 15:01
I linked the thread because it missed the details : how and in what environment.
VLC uses it's own plugin while MPC uses mostly from DSFs and perhaps from it's own(which I doubt), which begs more of OWN study and tests.
If you have a PCM or wav from the source, you don't have to rely on the avisynth for a transcoding, unless you need the channel remapping or other available DSPs.
As we know avisynth(and BeHappy) having open architecture, if you can play the AVS(including GRF) in MPC correctly, there should be no problem using these tools.
redfordxx
1st December 2005, 19:16
I linked the thread because it missed the details : how and in what environment.WinXPProSP2If you have a PCM or wav from the source, you don't have to rely on the avisynthIt was just for testingif you can play the AVS(including GRF) in MPC correctlyNo, I can play WMA in MPC correctly, but not WMA via AVS in MPC (probably because there is already the M$WMADecoder inbetween, which downmixes it to 2ch
Rockaria
1st December 2005, 21:11
I also noticed the WMA DMO(wmadmod.dll) changing the 6ch to 2ch, which you can see with zplayer graph info. but I am not sure if it is downmixing.
Gomplayer also did this behavior until I changed the ASF reader(qasf.dll) and Window Media source filter merit to 'DO_NOT_USE', then the DMO started to stream 6ch, but still noticed the ASF reader is being used.
So my conclusion is, it's not using any extra plugin besides the DSFs. But there seems to be some option 'not to restrict' passed to the DMO.
In this case we may have to get a newer version of graphedit and see what happens.
My walkaround would be transcoding to a flac or wav 6ch in the VLC(possibly with messed up ch order) and feed to this environment correcting the channel orders....
redfordxx
1st December 2005, 21:34
I changed the ASF reader(qasf.dll) and Window Media source filter merit to 'DO_NOT_USE', then the DMO started to stream 6ch, but still noticed the ASF reader is being used.Can you please describe it more understandable for me (I don't have ZPllayer but I hope I can help with BSPlayer too.)
Current status: when I play WMV, following DSFs are loaded:
WMAudioDecoderDMO (there is written dasf.dll)
WMVideoDecoderDMO (there is written dasf.dll)
EQ (don't know what is it)
AC3Filter (makes again 6ch)
Default DirectSound Device
Rockaria
1st December 2005, 22:21
It is a setting in players overriding the priority of the dsfilters when there are candidates performing the same function.
I am not sure if the bsplayer has this feature, but zplayer's feature seems to be GLOBAL like other DSFILTER merit tools.
The WMA Decoder seems to be internally connected to wmadsod.dll.
My zplayer is an old version and still produces 2ch from 6ch wma.
Yeah, it's end of year! I am gonna be busy too... ;)
redfordxx
1st December 2005, 22:52
There is filter management in BSP.
But when I disable the filter, no other filter is loaded.
Which filter is loaded for you instead?
Rockaria
1st December 2005, 23:28
WM ASF Reader-> WMA Decoder DMO->ffdshow.........->Default DirectSound Device.
From the DMO pin out, it's PCM 6ch or 2ch depending on the players.
And you know that you can right click the content and open with grapheditor.
It (can) auto-render the filter chains.
Also when the GRF is used for the AVS input, you must disconnect the sound device renderer in the graph.
Good luck.
[edit]
Oh, check if foobar is working(mine works charm). I don't know why I forgot it.
guada 2
2nd December 2005, 18:28
Hello dimzon,
Just a question:
Would it be possible to use others plug in, like those of the mastering audio?
dimzon
2nd December 2005, 18:32
Hello dimzon,
Just a question:
Would it be possible to use others plug in, like those of the mastering audio?
You can use ANY AviSynth plugins/functions :)
guada 2
2nd December 2005, 19:01
It is clear, :) :) :) :) :) ; but you think that it is possible: yes or no. ;)
dimzon
2nd December 2005, 19:04
It is clear, :) :) :) :) :) ; but you think that it is possible: yes or no. ;)
Hm. I really dos'nt understand what does you want from me. Can you point me on actual concrete plugin which you want to use?
guada 2
2nd December 2005, 20:03
PSP MasterComp.dll, BIAS SoundSoap Pro.dll, TRackS.dll, L3 Multimaximizer.dll
Rockaria
2nd December 2005, 20:20
By the architecture, there are several places to attach the plugins :
1. as a dsfilter in a graphedit file
2. as an avisyhth plugin
3. as a plugin in an application which can read avs(also in a form of MakeAvis avi)
4. as an application can read pipe-in wav stream
5. as a plugin in an application which can read pipe-in wav stream
IgorC
3rd December 2005, 13:54
Where can I get bse_Nero7WA.dll?
Pendalf
4th December 2005, 02:21
Where can I get bse_Nero7WA.dll?
I also would like to know. :)
Old files have been removed from sharing servers.
dimzon
5th December 2005, 10:05
Where can I get bse_Nero7WA.dll?
I realy can't help you with this dll now - my HDD is dead, all sourcecode/binaries lost...
But source code is really easy ( I remember) so I can rewrite bse_Nero7WA.dll later (but i'm really busy now)
dimzon
5th December 2005, 10:06
PSP MasterComp.dll, BIAS SoundSoap Pro.dll, TRackS.dll, L3 Multimaximizer.dll
I does'nt know this plugins... Which API does them expose?
dimzon
5th December 2005, 12:24
So have you (or anybody else) tried generating an 6Ch AAC encode using my suggested method, or not?
Here's a link to my 6Ch AC3 Speaker Test Sample (http://81.98.148.105/Uploaded_Files/Doom9_Forum_files/6Ch_AC3_Sample.7z)
check this: http://www.mytempdir.com/300341
hitbit
5th December 2005, 15:51
PSP MasterComp.dll, BIAS SoundSoap Pro.dll, TRackS.dll, L3 Multimaximizer.dll
I think they are DirectShow and/or VST filters... AFAIK they can't be used with AviSynth
dimzon
5th December 2005, 15:55
I think they are DirectShow and/or VST filters... AFAIK they can't be used with AviSynth
1) It's possible to use DirectShow Graph as AVI-Synth source
2) I believe it's possible to write generic VST -> AviSynt adapter using VST SDK (http://ygrabit.steinberg.de/users/ygrabit/public_html/index.html)
Rockaria
5th December 2005, 16:15
The WinAmp AAC encoder (http://forum.doom9.org/showthread.php?p=746806#post746806) ,which now supports 6ch cbr & stdin, must be a good addition to this environment.
It worked flawlessly when I check the 'resize to 16bit', muxed to mp4 with the foobar mp4util(cause i did not copy the mp4box yet) but stayed stable @94kbps stable(default bit rate).
When I tested the winamp bundled Kaje - Hey Buddy Aacplus Surround.aac, it showed 130~210kbps vbr. Maybe the option is waiting hidden somewhere. :thanks:
tebasuna51
5th December 2005, 16:43
Congratulations Rockaria, Dimzon!. Good program BeHappy, it remain to much work but is promising. My small comments:
1) DECODERS. I need learn more about this, now:
I test ac3 and dts with NickAudio plugin and works fine.
Problems with DirectShow (ffdshow): wrong wav headers, streams with different duration than original...
2) DSP functions. The best.
Even for a newbie in AviSinth like me is easy write DSP functions:
A problem with BeSweet, resample a multichannel wav with ssrc, works fine with "ssrc 5.1 48000":
#a = last
#f = GetChannel(a, 1, 2).SSRC(48000)
#c = GetChannel(a, 3, 4).SSRC(48000)
#s = GetChannel(a, 5, 6).SSRC(48000)
#MergeChannels(f, c, s)
#EDITED: the precedent lines works but is only necessary:
SSRC(48000)
A typical function of BeSweet-azid, "Downmix dpl II"
a = last
f = GetChannel(a, 1, 2)
c = GetChannel(a, 3)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l = MixAudio(sl, sr, -0.2818, -0.1627) # -0.2222, -0.2222 for dpl (I)
l = MixAudio(l, c, 1.0, 0.2301)
r = MixAudio(sl, sr, 0.1627, 0.2818) # 0.2222, 0.2222 for dpl (I)
r = MixAudio(r, c, 1.0, 0.2301)
st = MergeChannels(l, r)
MixAudio(f, st, 0.3254, 1.0).Normalize()
3) ENCODERS. The hard work.
We need interfaces with encoders like Lame for mp3, ac3enc.dll, ...
The interface with Nero aac (naac) accept only a few parameters.
I know, Dimzon, you are busy until new year. See you later.
Rockaria, is possible to maintain a list in your first post with decoders/encoders checked with BeHappy?
Edited: New coefficients in "Downmix dpl II" from a more efficient matrix.
Second edit: (I'm really newbie in AviSinth) The internal plugin SSRC() works with multichannel streams, then "ssrc 5.1 48000" is very simple.
dimzon
5th December 2005, 16:55
I'm talking with Doom9 about integration BeHappy into MeGUI :)
Rockaria, is possible to maintain a list in your first post with decoders/encoders checked with BeHappy?
As fact - you can use any command-line encoder able to process StdIn:
Ogg Vorbis (avoTuVo oggenc)
AVS: 6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last
Arguments: -Q -q -2 - -o "{0}"
tebasuna51
5th December 2005, 17:28
Based in the example in Lame help:
"Streaming mono 22.05 kHz raw pcm, 24 kbps output:
cat inputfile | lame -r -m m -b 24 -s 22.05 -- > output"
We can use Lame.exe?
Rockaria
5th December 2005, 18:13
'Catenate' is basically for merging raw sources(no header) into stdout, although some readers handle the stream with generosity.
Yes, if you can use the "|" for a input for the following encoder, the encoder is stdin capable.
As I said earlier, I am already satisfied(yeah, introduction) with the flexibility and extensibility this environment provides, and proved by dimson's excellent work in coding & interface design.
Unfortunately I don't touch the source any more especially when there are talented proven. Instead, I can see better through the architecture and resources.
But I will try to contribute in this thread depending on the progress, to keep and enhance the flexibility.
As for the wav source containing other stream inside, check the ffdshow 'pcm' option in more detail and possibly attaching the ac3Filter after the ffdshow may stabilize the sync.
Rockaria
6th December 2005, 12:17
A typical function of BeSweet-azid, "Downmix dpl II" That's exactly what I was thinking, in addition to merging channels or clips from more than one. Also I was thinking the job control on multiple clips, which is what foobar is already doing.
But my second thought is, the DPL II can be done through a 'included' user function(the local variable does not affect the global). I also think other process can be done this way.
The in-line conditional assignment is somewhat weak to replace the IF-THEN-ELSE-ENDIF. Although it is possible to EMULATE the IFs but the efforts would be tremendous.
Also the clip can be previewed inside of the BeHappy, through a temporarily generated avs, played on a dsf capable player.
There are many already from my analysis not mentioned here, and certainly much more from other's contribution I bet.
But the most urgent thing for the flexibility(the integration onto the existing environment) I think is generating an avs for a verification and preview purpose, possibly in addition to the command line launcher script.
And we also know how hard it is to mention 'SOMETHING to be IMPROVED' onto an already PERFECT work. ;)
dimzon
7th December 2005, 10:27
Just additional threads about downmix/upmix via AviSynth:
http://forum.doom9.org/showthread.php?t=103466
http://forum.doom9.org/showthread.php?t=103482
My suggestion about VST to AviSynth adapter:
http://forum.doom9.org/showthread.php?t=103656
Some words about possible assimilation BeHappy by MeGUI (i hope)
http://forum.doom9.org/showthread.php?p=744846#post744846
dimzon
7th December 2005, 10:32
@Rockaria
Please, can you check and provide sample command line for MENCODER or/and FFMPEG for 6ch AC3 encoding? Thanx!
@All
Seem's like this methodology beat BeSweet by all features/formats/filters
Does anybody know any BeSweet feature not implementable by this methodology?
Kurtnoise
7th December 2005, 10:47
Does anybody know any BeSweet feature not implementable by this methodology?
- hybridgain/pregain/postgain functions.
- delay insertion.
- surcode dts encoding.
- lst/mux input files.
..... ;)
dimzon
7th December 2005, 10:53
- hybridgain/pregain/postgain functions.
Wrong!
Pregain is possible using Normalize() AviSynth function. Postgain is encoder feature - it's supported by some encoders, HybridGain is combination of both...
- delay insertion.
Wrong!
Look @ DelayAudio() AviSynth function
- surcode dts encoding.
Wrong?
All what You need - to find command line encoder with StdIn support - I believe - it's possible
- lst/mux input files.
I really don't underdstand what does it mean (Sorry, my english is Poor)
Kurtnoise
7th December 2005, 12:27
Wrong!
Pregain is possible using Normalize() AviSynth function. Postgain is encoder feature - it's supported by some encoders, HybridGain is combination of both...
don't say it's wrong because Postgain is a BeSweet feature...and, HybridGain also. You can't reproduced these features.
Wrong!
Look @ DelayAudio() AviSynth function
good point.
I really don't underdstand what does it mean (Sorry, my english is Poor)
I mean to have the possibilty to encode & merge several files into one directly.
Another good point for BeSweet, this is azid commands (dynamic compression , etc...) and id3 tagging.
dimzon
7th December 2005, 13:25
don't say it's wrong because Postgain is a BeSweet feature...
I believe it's same as ReplayGain (is'nt it?)
lame --longhelp
output:
LAME 32bits version 3.97 (beta 2, Nov 29 2005) (http://www.mp3dev.org/)
... skipped ..
--replaygain-fast compute RG fast but slightly inaccurately (default)
--replaygain-accurate compute RG more accurately and find the peak sample
--noreplaygain disable ReplayGain analysis
--clipdetect enable --replaygain-accurate and print a message whether
... skipped ..
I mean to have the possibilty to encode & merge several files into one directly.
You can achieve same effect using:
SomeSource(..) ++ SomeSource(..) + ... + SomeSource(..) in AviSynth script
Another good point for BeSweet, this is azid commands (dynamic compression , etc...)
Yes! We need it (http://forum.doom9.org/showthread.php?t=103742). I believe it's possible to use some AVS function or external filter to do it.
and id3 tagging
this is container/encoder feature. Lame supports tagging too.
Rockaria
7th December 2005, 23:06
Firstly, Megui and ac3 encoding :
I skimmed the megui development thread and some videohelp info. It looks like a hybrid system adopting several back ends including mencoder, ffmpeg besweet and even mp4box.
The besweet seems to be the audio encoding back end, where include the AC3 and AAC supports. So we seem to be unable to expect more than what the besweet provides currently.
My initial idea was importing existing excellent tools such as johnman's WW which is based on the wav, or at least 6 mono wave splitter mentioned in the first post to support existing(OLD fashioned) encoder such as surcode or softencode(it can read almost any formats even raw).
Secondly, the volume gain :
The replaygain (http://en.wikipedia.org/wiki/Replaygain) seems to be almost a standard adopted in many formats including the general approach in the foobar2k (http://www.replaygain.org/).
As we know, we can process the clip with 'max gain with no clipping'(no parameter : requires a scanning time) or with a given value which can be set by the replaygain contained in the meta info on each clip if we can read the replaygain anyhow in the BeHappy.
DRC and other issue :
The FFDSHOW has two places for the DRC : it has options on DTS and AC3 codec definition. It also has this function on the volume DSP, which is clearer in ac3Filter.
If we anyhow can control the DSF usage like MPC/zPlayer/graphedit.. in the avisynth's altered DirectShowSource method, this would be an easy job in addition to the AC3 encoding.
My opinion on the MeGui integration is almost negative because they are both frontend and the requrements and milestones are supposedly defined already. This system or methodology has strong advantages on the flexibility and extensibility. It's lightweight in itself but accomodates almost any input sources and destination formats, existing and future.
We can just implement the automation and convenience one by one and welcome the new plugins/dsfilters or encoders...one by one.
Sorry for any mistyping because of my rush.. busy for a while.
Kurtnoise
8th December 2005, 09:09
I believe it's same as ReplayGain (is'nt it?)
no...it's not the same thing.
You can achieve same effect using:
SomeSource(..) ++ SomeSource(..) + ... + SomeSource(..) in AviSynth script
it doesn't work for me here...
this is container/encoder feature. Lame supports tagging too.
fortunately no...there are some tagger tools outside encoders. And this feature doesn't concern the container himself.
btw, Avisynth is very powerfull, I didn't say the contrary. I use it almost everyday for my dvds backups but bear in mind that BeSweet is more used for audio transcoding than Avisynth for the moment...Moreover, you make a great stuff with BePipe you know. Keep up the good work dude. :)
Kurtnoise
8th December 2005, 10:58
I just tried with ffmpeg to encode a wav file to ac3 but it seems that ffmpeg failed to do that or I missed something.
BePipe.exe --script "WavSource(^c:\input.wav^)" | "C:\Program Files\FFMpeg\ffmpeg.exe" -i - -ab 256 "E:\output.ac3"
http://kurtnoise.free.fr/ffmpeg.7z
Hint: directly into ffmpeg it works fine...it seems there is a pipe issue. :(
stephanV
8th December 2005, 11:43
fortunately no...there are some tagger tools outside encoders. And this feature doesn't concern the container himself.
Uhm, tagging is a container feature. ID3 was only invented because mp3 (as raw format) lacks a tagging standard. Putting ID3 tags on ogg vorbis or mp4 (aac) is a rather bad thing to do.
Kurtnoise
8th December 2005, 13:26
mmh why we have id3 support in some lossless encoders in this case ?
Rockaria
8th December 2005, 14:27
SomeSource(..) ++ SomeSource(..) + ... + SomeSource(..) in AviSynth script it doesn't work for me here...
I tested it before for joining several files as well as looping and splitting(trim).. even it can join 6 mono waves into a 6ch wav in a step.
I just tried with ffmpeg to encode a wav file to ac3
Thanks for the clarification(videohelp said a bit about it). I am busy for a very long while.
Avisynth is very powerfull, I didn't say the contraryNobody mentioned the weakness of the Be series either.
The thing is it has just started to be enhanced, open , working and already powerful.
Thanks for the contributions. I am on a long travel and dimzon take the thread. :thanks:
dimzon
8th December 2005, 14:44
BePipe.exe --script "WavSource(^c:\input.wav^)" | "C:\Program Files\FFMpeg\ffmpeg.exe" -i - -ab 256 "E:\output.ac3"
try
"C:\Program Files\FFMpeg\ffmpeg.exe" -i - -ab 256 "E:\output.ac3" < c:\input.wav
stephanV
8th December 2005, 16:58
mmh why we have id3 support in some lossless encoders in this case ?
Because they didn't bother to make their own? :)
I know at least the wavpack encoder still supports writing tags (but maybe they are APE, not ID3) though, for other CLI encoders I'm not sure. But this doesn't make the ID3 tag writing capability of BeSweet still a major advantage.
dimzon
9th December 2005, 10:26
BeHappy is now hosted on www.gotdotnet.com !
Check my signature
tebasuna51
9th December 2005, 18:15
-In previous post I use a matrix copied from source code of BS_Downmix plugin for BeSweet ( http://besweet.notrace.dk/plug-ins.htm ), used until BeSweet v1.5b19.
There are a newest, more efficient, matrix in http://forum.doom9.org/showthread.php?t=57988 used, I think, by Midas Azid 1.9 and/or BeSweet v1.5b20.
Then I must correct the coefficients in my function "Downmix dpl II"
a = last
f = GetChannel(a, 1, 2)
c = GetChannel(a, 3)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l = MixAudio(sl, sr, -0.2818, -0.1627) # -0.2222, -0.2222 for dpl (I)
l = MixAudio(l, c, 1.0, 0.2301)
r = MixAudio(sl, sr, 0.1627, 0.2818) # 0.2222, 0.2222 for dpl (I)
r = MixAudio(r, c, 1.0, 0.2301)
st = MergeChannels(l, r)
MixAudio(f, st, 0.3254, 1.0).Normalize()
You can use Normalize() for 100% or Normalize(0.95) for 95%...
- About methods in http://forum.doom9.org/showthread.php?t=103466 or http://md2.boerde.de/scharfi/
1) Now "Downmix dpl II" is a normalized version (to avoid clipping problems in int audio formats) of "function dpl2" (works with float audio format)
2) The "function dpl" is intended for sources 3/1 (4 input channels). For 3/2 you can use "Downmix dpl II" changing the coefficients in #comments.
dimzon
9th December 2005, 18:24
@tebasuna51
How about "Simple Stereo" downmix mode?
Thanx!
tebasuna51
10th December 2005, 04:43
Downmix to stereo is not critical because there aren't a dpl decoder involved. You can use also the LFE channel (not recommended for Dolby for dpl I/II).
A generic downmix may be:
FL' = FL + cc*C + ce*LFE + cs*SL
RL' = RL + cc*C + ce*LFE + cs*RL
These coefficients can vary with source type and users preferences. A decoder like azid have parameters to select these values.
For 6 independents channels may be:
FL' = FL + 0.7071*C + 0.7071*LFE + SL
RL' = RL + 0.7071*C + 0.7071*LFE + RL
And normalized:
FL' = 0.2929*FL + 0.2071*C + 0.2071*LFE + 0.2929SL
RL' = 0.2929*RL + 0.2071*C + 0.2071*LFE + 0.2929RL
Then "Downmix to stereo":
a = last
f = GetChannel(a, 1, 2)
c = GetChannel(a, 3)
e = GetChannel(a, 4)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l = MixAudio(sl, c, 0.2929, 0.2071)
l = MixAudio(l, e, 1.0, 0.2071)
r = MixAudio(sr, c, 0.2929, 0.2071)
r = MixAudio(r, e, 1.0, 0.2071)
st = MergeChannels(l, r)
MixAudio(f, st, 0.2929, 1.0).Normalize()
Edited: r = MixAudio(sr, e, 1.0, 0.2071) must be
r = MixAudio(r, e, 1.0, 0.2071).
Thanks MiCK76.
tebasuna51
10th December 2005, 14:02
- Mp3 encoder
Tested the Lame.exe (+ lame_enc.dll, in habitual package), and works fine with BeHappy with:
Arguments: - [-parameters ...] "{0}"
The first '-' make to Lame accept, by standard input, the audio stream send by BeHappy.
I think all requeriment about mp3 are covered by this standard encoder.
- Ac3 encoder
Tested ffmpeg.exe (CVS_2005-09-09) to encode ac3 files with:
Arguments: -i - -ab 448 "{0}"
AVS Script: 6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last
The only parameter allowed, AFAIK, is -ab 'bitrate', is very limited but, at last, we have the same than BeSweet-ac3enc.
The besweet seems to be the audio encoding back end, where include the AC3 and AAC supports. So we seem to be unable to expect more than what the besweet provides currently.
My initial idea was importing existing excellent tools such as johnman's WW which is based on the wav, or at least 6 mono wave splitter mentioned in the first post to support existing(OLD fashioned) encoder such as surcode or softencode(it can read almost any formats even raw).
To use SoftEncode (I don't know Surcode) we need:
- Write a .ini file with the parameters. Possible with AviSynth internal plugins WriteFileStart/WriteFileEnd.
- Write 6 mono wav with the channels. The mentioned 6 mono wave splitter. (?)
- Send the job to SoftEncode. (?)
- General Note
For the future we can think add a new button 'Configure' to open a new window, specific for each encoder/decoder, to capture the parameters to construct the Arguments for Lame, the ini file for Softencode, ...
Rockaria
10th December 2005, 16:41
The besweet not being the backend is what I admitted already. I just read some info from videohelp but had no time to (fully) test all the backends.
Surecode expects 6 mono wavs and 6ch wav/6 mono wavs/ raw is allowed for softencode(it also has the batch mode).
Whether it accepts the parameter from any formats or not(I doubt surecode), if we have to launch the application and can use it's own profiles(the worst thing is the disk space usage of the temporary wav files), the integration is at it's least or almost nothing.
I thought that this methodology or system includes all the existing capabilitis and tools(manual/automation), which does not need to be neat/unified sacrificing the flexibility.
The ffdshow(or dsfilters, grf) portion is too big to abandon, to me.
So the (new) BeHappy has the 'user defined function' capability now?
tebasuna51
11th December 2005, 00:00
Sorry Rockaria, I don't understand very well your comment about SoftEncode because my bad english.
I talk, of course, about batch mode. From the SoftEncode Help:
"Command Line Operation of Soft Encode
Soft Encode provides the ability to be run from completely command line based commands. The Soft Encode main screen will never have to be open to run these commands. The syntax is as follows:
Sftencdd.exe -A -P <ini_file> -o <out_file> -L <left> -R <right> -C <center> -l <sleft> -r <sright> -e <LFE>
-A auto switch, this must be set for it to process the command line
-P specifies the full path and file name of an ini file that has overrides for the AC3 settings ..."
Then:
- The job work without more interaction of the user.
- The ini_file control all possible parameters of the encoder.
- In batch mode only mono wav are accepted
- The main problem, like you say, is the necessity of create these 6 mono wav.
About your last comment:
"So the (new) BeHappy has the 'user defined function' capability now?"
May be the word 'function' is too ambitious and must use the word 'macro'.
Rockaria
11th December 2005, 00:42
"So the (new) BeHappy has the 'user defined function' capability now?"
May be the word 'function' is too ambitious and must use the word 'macro'.The user function is clearly defined in the avisynth's manual and I clearly agree with it's correct use of the terms.
The 'macro' is used for 'something to be expanded to code blocks before the compilation. So preprocessors has this behaviors usually.
The major advantage of the avisynth is treating the stream instead of the resource-taking file-io between the processors. Even though it does not require the user interface, if it asks 6 mono waves for the input, it has very loose integration.
I assume the surecode behave similar, which begs somebody's clarification.
And one(actually two) of my questions is left unanswered : the last and the first.
My last comment : The language would be no problem if we try to use the international accent and can understand more than what is said.
Rockaria
12th December 2005, 02:34
I had to find a way to insert some customized script block in the BeHappy.
If not allowed the avs save or the user function editor yet, the Import() is the only but effective way to include the unsupported complicated scripts and connect to BeHappy, keeping the gui interface as neat as it is.
We can put user functions there and can define DSPs for the each function which returns a clip. So some issue mentioned before(joining, mixing, splitting...) is covered with this way.
But it is still somewhat inconvenient with the file path, in which case the PathCopyEx.msi mentioned @#1 would be useful.
As I mentioned in other thread, any plugins installed in the avisynth's plugin folder do not need to be loaded explicitly.
Also we can omit the clip variable reference when working on the last defined clip, identified as the global variable last
Using Amplify() will be useful if we have a ReplayGain dB data from other scanning tools such as foobar2k.
[edit]
O.K., I found the DSP editor has the multi line text editing capability. The predefined simple DSPs forced me to overlook it's existance. It turned out rather proper for the profile(configuraions) management use.
The confusion is initially caused by some predefined DSP functions not using the variable(--> last) forcing the strict variable naming convention for the clips between the DSPs, the scope of which can be managed automatically inside of the user functions.
So if used in a macro style, the variables need to be strictly managed, which is not desirable forcing me to deny the possibility of the adoption.
But if used in a user function style, we can choose two ways to define:
. define as a DSP in the BeHappy. if enabled, can be called from anywhere.
. define in groups of avs. if imported once anywhere, can be called from anywhere
Overall, it depends on the tastes. You can choose. Nothing is wrong or right if used correctly. /slience.
dimzon
12th December 2005, 11:47
Hi!
Does whe really need LoadPlugin ability? Maybe intslling plugins in the avisynth's plugin folder is better way?
You can use *.avsi files into avisynth's plugin folder to provide you custom functons...
dimzon
12th December 2005, 11:51
- General Note
For the future we can think add a new button 'Configure' to open a new window, specific for each encoder/decoder, to capture the parameters to construct the Arguments for Lame...
It will be added later. I want to create extensible API to allow multiple GUI plugins for DSP/Encoder configuration :)
dimzon
12th December 2005, 11:53
But if used in a user function style, we can choose two ways to define:
. define as a DSP in the BeHappy. if enabled, can be called from anywhere.
. define in groups of avs. if imported once anywhere, can be called from anywhere
Does You really need to define custom function in one DSP to be able to call it from another? Can you post example?
Rockaria
12th December 2005, 16:49
It's rather a basic language/pattern concept. A good architecture prevents any possible mistakes or self-restrictions.
[a possible mistake in macro use]
a1=clip1 // a global clip to join later
a2=clip2 // a global clp to join later but need some preprocessing
<dsp1>
a1=last
fl=..
<dsp 2>
a2=getchannel...
...
c=a1+a2
--
In this case, we need to lookup every DSPs used to verify if the variables are used correctly, other than that a strict process structure or variable naming convention is required, yeah restrictions very opposite to flexibility.
[a very simple user function usage]
ta=duration(clipa) //inside of DSP1
tb=duration(clipb) //inside of DSP2
function duration(clip){return frames/framerate} // defined in a UserFunctions1 DSP(or in a avs form to be imported) possibly with other related functions
Also any variable names can be used freely inside of the functions(at least it's a common sense).
[a possible DSPs use as profile management]
<nero 6 48000 ReplayGain Join>
<nero 7 48000 MaxNorm Single>
...
SSRC(48000).Normalize()
GetChannel(2,3,1,6,4,5)
..
<oggenc 48000 MaxNorm Single>
...
GetChannel(1,3,2,5,6,4)
..
<AC3 ffmpeg 48000 MaxNorm Single>
...
GetChannel(1,3,2,5,6,4)
..
<MIX User Functions>
function DPL II-1{.. return clip}
function DPL II-2{.....}
function UPMIX-1{...}
...
<Common utils>
...
[save to avs & launcherscript]
. I have experienced a trouble in the file path, in which case I had no option to check if the script is generated correctly.
. the gui log message is not as detailed as dosbox or avs preview in MPC.
. cannot preview how it sounds before the long encoding work
. cannot try test-tuning on the fly.
. cannot integrate to other avisynth clients such as MakeAVIS, avs2avi or avs2wav. Any special reason to restrict this?
[other things]
. I guess if placed in a local folder (together with avisynth.dll), the avis plugins need not be loaded explicitly also.
. the configuration xml seems better to be placed in the local folder.
....
......
........
But again, it depends on the tastes. BeHappy is extremly flexible as I said before.
dimzon
12th December 2005, 20:16
@Rockaria
I asking You about real-life sample to approve You needs to to define custom function in one DSP to be able to call it from another
the configuration xml seems better to be placed in the local folder
It's really BAD bcz only Administrators can write to Program Files folder!
tebasuna51
12th December 2005, 21:13
I edited a previous post:
A problem with BeSweet, resample a multichannel wav with ssrc, works fine with "ssrc 5.1 48000":
#a = last
#f = GetChannel(a, 1, 2).SSRC(48000)
#c = GetChannel(a, 3, 4).SSRC(48000)
#s = GetChannel(a, 5, 6).SSRC(48000)
#MergeChannels(f, c, s)
#EDITED: the precedent lines works but is only necessary:
SSRC(48000)
Because the internal AviSynth plugin SSRC() works with multichannel streams, like Rockaria say me in another thread.
Sorry, I'm really newbie in AviSynth.
Rockaria
12th December 2005, 21:33
@Rockaria
I asking You about real-life sample to approve You needs to to define custom function in one DSP to be able to call it from another
me no junior, nor even senior /retired.
Closure! Not compliant to my philosophical standard!
Unless explained reasonably why it cannot be backward compatible, which is where this system is from, I also respectfully decline using my name with the project together, while you can continue the exploration with the idea anywhere.
I have been just trying to introduce and help anybody for the full realization of this potentials under the GPL spirit, despite the initial noise.
But if most of the reasonable checkpoints are skipped, ignored and left unanswered, it's no more a cooperational job, which is why it cannot be approved compliant.
And no more dead horse please. Thanks.
dimzon
13th December 2005, 09:22
@Rockaria
please do not make a drama
Current BeHappy status is not even alpha - it's really planning. I have no time to work on BeHappy hard right now but I'm collecting user requests and analyzing them:
- Is it really requred? Can same effect be achived using current abilities?
- How to implement this
If I harm You - please sorry - my poor english is a reason...
Unless explained reasonably why it cannot be backward compatible, which is where this system is from...
Can You explain me what does it means?
Rockaria
13th December 2005, 11:06
No drama to make, your 'approval' & 'real example' was the drama. And the BeHappy doesn't need to be dramatically BIG.
No, it's already there, you don't have to change anything, if you read carefully. Just take away those misleading predefined DSPs and change the title to Profiles instead of DSPs if you agree.
I've told you the need for 'avs save' at least three times. Were you there listening? Read again & get ready to discuss/answer all the checkpoints before making any new post just to change the focus.
Even though I stopped the coding years ago, I've been doing the architect work around a decade, seeing through the architecture and resources where includes the human factor also.
So there should have been no waste at all if we met in the real world.
Anyway, whether you understand or not, I seem to have discussed all the crucial topics enough already.
Another thing is, start from the next version in a new thread. This thread has got ruined too much from the beginning.
/bye
dimzon
13th December 2005, 11:32
No drama to make, your 'approval' & 'real example' was the drama.
I just can't believe You need such functionality in real life, really! And I don't want to harm You!
No, it's already there, you don't have to change anything, if you read carefully.
The current code is a little ugly. I want to simplify and refactor it before continue!
Just take away those misleading predefined DSPs and change the title to Profiles instead of DSPs if you agree.
IMHO profile is set of DSP - not simple "DSP". Maybe I'm wrong?
I've told you the need for 'avs save' at least three times. Were you there listening?
Hey! I don't say NO on it is'nt it? It will be implemented. I'm realy busy now (my workday duration is 10-12 hrs - not a 8) and sometimes I need some time to make a design before answer!
/bye
Rockaria
13th December 2005, 13:21
I just can't believe You need such functionality in real life, really! And I don't want to harm You!
Yeah you don't really need the float in your real NORMAL life.
But I agree. go ahead. I don't really want to HURT your servicemanship. ;)
IMHO profile is set of DSP - not simple "DSP". Maybe I'm wrong?That's right, unlike the initial definition. But later, I found it has multiline editor, turned out better suitted for each profile containing all the DSP function(inluding user function) calls. So no more need for the seperate profile management. You will find the macro insertion is not that flexible as function calls in many respects. It's language/pattern BASIC not the SPECIAL functionality.
Hey! I don't say NO on it is'nt it? It will be implemented.Good to know that. But a very looooooose answer or no answer...hmm..
But no problem. It's a test purpose. I am doing almost no transcoding in my real life.
/Progress in the usability with your BeHappy
tebasuna51
13th December 2005, 17:10
@Rockaria you must be more patient with us. With a Avisynth newbie like me, and with the busy Dimzon.
I'm sure Dimzon don't want offend you with the word 'approval'.
I'm not offended by your 'senior/retired' (I'm retired).
And the language is another handicap, at last for me. (What mean 'dead horse'?)
I agree with your comments about 'macro style', then "Downmix dpl II" can be written, to avoid problems with variable names, like this:
function DPL_II(clip a) {
Assert(a.Audiochannels == 6, "DPL_II: audio input must have 6 channels")
f = GetChannel(a, 1, 2)
c = GetChannel(a, 3)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l = MixAudio(sl, sr, -0.2818, -0.1627)
l = MixAudio(l, c, 1.0, 0.2301)
r = MixAudio(sl, sr, 0.1627, 0.2818)
r = MixAudio(r, c, 1.0, 0.2301)
st = MergeChannels(l, r)
return MixAudio(f, st, 0.3254, 1.0).Normalize()
}
DPL_II # Execute now
Or without the last line for only define the function, and another DSP to execute. At the moment, with simple flow like Decoder -> DSP's -> Encoder, I canīt imagine a situation to call twice DPL_II.
For the future we can think a tool 'Construct AVS' like a precompiler to detect the used functions and include the definitions needed, maybe from external libraries (for easy update). But, like Dimzon, I need a real problem to imagine a solution.
Of course the 'Save avs' button is very interesting
dimzon
13th December 2005, 17:50
I agree with your comments about 'macro style', then "Downmix dpl II" can be written, to avoid problems with variable names, like this:
function DPL_II(clip a) {
Assert(a.Audiochannels == 6, "DPL_II: audio input must have 6 channels")
f = GetChannel(a, 1, 2)
c = GetChannel(a, 3)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l = MixAudio(sl, sr, -0.2818, -0.1627)
l = MixAudio(l, c, 1.0, 0.2301)
r = MixAudio(sl, sr, 0.1627, 0.2818)
r = MixAudio(r, c, 1.0, 0.2301)
st = MergeChannels(l, r)
return MixAudio(f, st, 0.3254, 1.0).Normalize()
}
DPL_II # Execute now
Or without the last line for only define the function, and another DSP to execute. At the moment, with simple flow like Decoder -> DSP's -> Encoder, I canīt imagine a situation to call twice DPL_II.
For the future we can think a tool 'Construct AVS' like a precompiler to detect the used functions and include the definitions needed, maybe from external libraries (for easy update). But, like Dimzon, I need a real problem to imagine a solution.
Of course the 'Save avs' button is very interesting
1) Why not just place DPL_II to dpl2.avsi into AviSynth plugin folder
2) I can implement additional macro to prevent variablename conflict:
function DPL_II_{0}(clip a) {
...
}
DPL_II_{0} # Execute now
will be transofmed into something like this (in final AVS)
function DPL_II_B4137A36CBAA41E0841208386EE7A408(clip a) {
...
}
DPL_II_B4137A36CBAA41E0841208386EE7A408 # Execute now
where B4137A36CBAA41E0841208386EE7A408 will be unique per DSP (System.Guid.NewGuid().ToString("N"))
or you can still use functionless style:
a{0} = last
f{0} = GetChannel(a{0}, 1, 2)
c{0} = GetChannel(a{0}, 3)
e{0} = GetChannel(a{0}, 4)
sl{0} = GetChannel(a{0}, 5)
sr{0} = GetChannel(a{0}, 6)
l{0} = MixAudio(sl{0}, c{0}, 0.2929, 0.2071)
l{0} = MixAudio(l{0}, e{0}, 1.0, 0.2071)
r{0} = MixAudio(sr{0}, c{0}, 0.2929, 0.2071)
r{0} = MixAudio(sr{0}, e{0}, 1.0, 0.2071)
st{0} = MergeChannels(l{0}, r{0})
MixAudio(f{0}, st{0}, 0.2929, 1.0).Normalize()
dimzon
13th December 2005, 18:13
At the moment, with simple flow like Decoder -> DSP's -> Encoder, I canīt imagine a situation to call twice DPL_II.
Agreed! I can't imaginate whe need such ability in real transcoding process at all! This is a reason for 'approval' word - I just need a real AVS sample!
And some words about BeHappy concepts:
BeHappy is not all-in-one universal audio processor. Don't bother me about audio concatenation via GUI. I'm not evil but I don't need such functionality myself and I have not time to design and code such GUI part (I prefer to spent time for AviSynth audio plugin development - I really need dynamic range compression and reverb). You can write such AVS manualy and load it into BeHappy via WavSource or Import. Or You can write such GUI code Yourself (BeHappy is GPL!) But it's really rare case, is'nt it?
BeHappy is BeLight/BeSweet replacement/concurrent - primary usage is audio track transcoding during DVD-Backup process.
future BeHappy vision/anonce/plans
Complete code refactoring and GUI redesign
Job control like in MeGUI
Import/Export Source/DSP/Encoder functionality
Large set of predefined DSP - to cover current BeSweet functionality
AVS Export
AVS Preview (Prelisten :D )
GUI plugins for LAME/OggVorbis etc
Rockaria
13th December 2005, 18:57
@tebasuna51 :
The communication rule #x : at least nod or give your eyes to express you are listening.
When it requires the repetition more than two, it really becomes a matter of patience, normally, isn't it?. Retired from the thread or whatever, I am not offended by any case either..
Onto a clip, you will seldomely find the case calling the same function twice. But onto several clips, it wouldn't be a rare case. Or already self-restricting the number of clips to one? Even if it is used once, there are still several advantages of the function style.
Because the function call is so streightforward, it would be better using the current DSPs as PROFILEs(like 'nero aac v6 48000 single') and include complete DSP functions there. It's a little shift of the scheme.
BTW, if you get an email from the retired company three years ago, asking to return some document debated on the day three month's before the retirement, the email is a dead horse, AFAIK.
I can't imaginate whe need such ability in real transcoding process at all! This is a reason for 'approval' word - I just need a real AVS sample!
Again, It's your limitation requiring other's support not your approval! Or don't use the user functions in your program at all! It's patented. :confused:
No more dead horse please.
dimzon
13th December 2005, 19:23
Or already self-restricting the number of clips to one?
Yes! Just remember 20/80 rule from MSF aka Pareto principle (http://en.wikipedia.org/wiki/Pareto_principle)! BeHappy goal is not to use ALL AviSynth power (You can write AVS manualy in complex cases) but provide nice user-friendly GUI for common tasks. There are 2 reason of this:
I have no time to implement functionality not interested for me.
It's impossible to use all 100% AviSynth power via GUI - just remember programming languages - you still need to write code!
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Because the function call is so streightforward, it would be better using the current DSPs as PROFILEs(like 'nero aac v6 48000 single') and include complete DSP functions there. It's a little shift of the scheme.
Ok, I will think about it!
Rockaria
13th December 2005, 19:38
Yes! Just remember 20/80 rule from MSF! BeHappy goal is not to use ALL AviSynth power (You can write AVS manualy in complex cases) but provide nice user-friendly GUI for common tasks. There are 2 reason of this:
I have no time to implement functionality not interested for me.
It's impossible to use all 100% AviSynth power via GUI - just remember programming languages - you still need to write code!
..
Ok, I will think about it!OK. that is expected by my common sense.
As far as it is backward compatible(avs export) and provide the minimum flexibility for multi clip use by the architecture, as I said before, it would be a smooth & complete job.
Everybody is busy and it's already end of year...
/next year
dimzon
16th December 2005, 17:47
new version GUI prototype
http://img371.imageshack.us/img371/4041/bh06sd.gif
http://img269.imageshack.us/img269/4301/bh16pl.gif
Any comments?
tebasuna51
19th December 2005, 04:46
Very nice job, Dimzon. For me is enough like GUI at the moment.
I found a bug in wav output and I send you a pm about this.
MiCK76
19th December 2005, 15:13
hi everyone and kudos to dimzon for the excellent work.
i found the avisynth downmix functions not working properly for me (they gave me the "speech" from the central channel only in the left channel in simple stereo downmix for example) so i've rewritten them this way and i found the result correct:
function DPL_II(clip a) {
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
c = GetChannel(a, 3)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
ssl = MixAudio(sl, sr, 0.2818, 0.1627).Amplify(-1.0)
fl_c = MixAudio(fl, c, 0.3254, 0.2301)
ssr = MixAudio(sl, sr, 0.1627, 0.2818)
fr_c = MixAudio(fr, c, 0.3254, 0.2301)
l = MixAudio(ssl, fl_c, 1.0, 1.0)
r = MixAudio(ssr, fr_c, 1.0, 1.0)
return MergeChannels(l, r).Normalize()
}
function SimpleStereo(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()
}
dont know why the remapping didnt work correctly with the original syntax, but this one is correct for me
bye
MiCK76
19th December 2005, 15:17
same way i've written also a DPL II with LFE channel downmix (i know it's not suggested by Dolby, but if you dont care....) ;)
function DPL_II_LFE(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)
c_lfe = MixAudio(c, lfe, 0.1871, 0.1870)
fl_c_lfe = MixAudio(fl, c_lfe, 0.2645, 1.0)
fr_c_lfe = MixAudio(fr, c_lfe, 0.2645, 1.0)
ssl = MixAudio(sl, sr, 0.2291, 0.1323).Amplify(-1.0)
ssr = MixAudio(sl, sr, 0.1323, 0.2291)
l = MixAudio(ssl, fl_c_lfe, 1.0, 1.0)
r = MixAudio(ssr, fr_c_lfe, 1.0, 1.0)
return MergeChannels(l, r).Normalize()
}
tebasuna51
19th December 2005, 20:28
@MICK76
I don't know what is the problem. The two syntax are equivalent and work for me.
May be AviSynth version? I'm work with v2.5.5.0.
MiCK76
20th December 2005, 16:10
@MICK76
I don't know what is the problem. The two syntax are equivalent and work for me.
May be AviSynth version? I'm work with v2.5.5.0.
yes i know, they "should" be equivalent, but they're not for me...
i use avisynth 2.5.5 too, and i tried the simpledownmix exactly how you wrote it and gave me the central channel only in the left one, while rewritten in this way gave me correct downmix..
dont know if MixAudio function mess up working with multichannel tracks like in your MixAudio(f, st, 0.3254, 1.0) where both f and st are stereo and not mono..
same is for MixAudio(sl, sr, -0.2818, -0.1627)...are you sure is correct? i mean in avisynth documentation MixAudio doesn't seem to support negative scale values, while Amplify() does (that's why i use MixAudio(sl, sr, 0.2818, 0.1627).Amplify(-1.0)).
anyway your work is great and kudos to you.
thx for pointing at the correct dplII downmix matrices
bye
MiCK76
20th December 2005, 18:27
ops i found what was wrong in your simple stereo function syntax that gave me that error:
a=last
f = GetChannel(a, 1, 2)
c = GetChannel(a, 3)
e = GetChannel(a, 4)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
l = MixAudio(sl, c, 0.2929, 0.2071)
l = MixAudio(l, e, 1.0, 0.2071)
r = MixAudio(sr, c, 0.2929, 0.2071)
######################
r = MixAudio(sr, e, 1.0, 0.2071) # <-- here it is
###################### correct one: r = MixAudio(r, e, 1.0, 0.2071)
st = MergeChannels(l, r)
MixAudio(f, st, 0.2929, 1.0).Normalize()
just so easy...dont know why i didnt notice it before...
anyway it remains the issue of the negative
scale values in MixAudio: Amplify(-1.0) is the supposed
correct way to do it imho.
MiCK76
20th December 2005, 18:31
i tried encoding the same small clip with your syntax (both dplII and simple stereo mode) and mine, both with lame and oggenc2, and i get different
file size results (just 1-2 kB on a 270 kB end result file), but if the scripts
are equivalent why does it happen????? i really dont know
strange things happen on these damn'd machines ;)
tebasuna51
21st December 2005, 02:12
@ Thanks MiCK76. You are right with the error in "Downmix to stereo" in my post #106 (edited). It remain in the #124 by Dimzon
Inside BeHappy I use a correct version and work for me. Sorry.
About:
same is for MixAudio(sl, sr, -0.2818, -0.1627)...are you sure is correct? i mean in avisynth documentation MixAudio doesn't seem to support negative scale values, while Amplify() does (that's why i use MixAudio(sl, sr, 0.2818, 0.1627).Amplify(-1.0)).
In my first test I use Amplify(-1.0), after I try with negative values and work also. The differences between this two methods are below 0.0002 (-73.41 dB).
Using coefficients with four digits we can expect this differences. If the coefficients are applied in distinct order the result must be different.
dimzon
21st December 2005, 19:36
Does anybody know how to apply trim() to audio to mimic BeSweet's --split switch? Maybe creating 16х16 1000fps video and AudioDub it before trim? Can anybody check?
dimzon
22nd December 2005, 14:23
- complete rewritten from scratch
- new GUI layout/feel
- export to AVS functionality
- job control
- ready to external plugins & extension's (look @ NicAudio.extension)
- encoding is not working yet!
http://img376.imageshack.us/img376/2885/untitled34gu.gif
http://www.mytempdir.com/336548
redfordxx
22nd December 2005, 14:38
Does anybody know how to apply trim() to audio to mimic BeSweet's --split switch? Maybe creating 16х16 1000fps video and AudioDub it before trim? Can anybody check?I can only say what I did: I do not say it is the best. The input was 5.1 wav. I made some clip (as you write) with audio_clip_fps=2*movie_fps. Then IIRC trim(0,movie_frame_count*2-1). But not sure about the -1.
I think beHappy would be nice for me, if only there was a WMA 5.1 decoder for AviSynth;-).
Joking, I will have other sources than wma too...
dimzon
22nd December 2005, 19:32
External plugin in action :)
http://img461.imageshack.us/img461/2629/untitled48gw.gif
<?xml version="1.0"?>
<BeHappy.Extension
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://workspaces.gotdotnet.com/behappy">
<AudioEncoder UniqueID="970151FD-EB11-4c93-BA3D-481C5976CF66">
<Plugin>
<OggVorbisEncoder
Type="BeHappy.OggVorbis.Encoder.Extension.OggVorbisEncoder, BeHappy.OggVorbis.Encoder.Extension"/>
</Plugin>
</AudioEncoder>
</BeHappy.Extension>
dimzon
23rd December 2005, 11:36
http://www.mytempdir.com/338321
Encoding not working yet!
Sample extensions:
NicAudio.extension - simplest extension sample
DownMix.extension - configureable extension
BeHappy.OggVorbis.Encoder.extension - configureable extension with it's own GUI
Generated script:
########################################
#Created by BeHappy v1.0.2183.23933
#Creation timestamp: 23.12.2005 13:19:48
########################################
#Source FileName:C:\1 1 1.m4a
#Target FileName:C:\1 1 1.ogg
########################################
########################################
# [Source: DirectShowSource]
########################################
DirectShowSource("C:\1 1 1.m4a")
########################################
# [DSP: Downmix - DPL II (LFE)]
########################################
# Store clip in variable
c64e934d9334b4d9f8ae9e16fe4aa5498=last
# Define transformation function
# DPL II (LFE)
function f64e934d9334b4d9f8ae9e16fe4aa5498(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)
c_lfe = MixAudio(c, lfe, 0.1871, 0.1870)
fl_c_lfe = MixAudio(fl, c_lfe, 0.2645, 1.0)
fr_c_lfe = MixAudio(fr, c_lfe, 0.2645, 1.0)
ssl = MixAudio(sl, sr, 0.2291, 0.1323).Amplify(-1.0)
ssr = MixAudio(sl, sr, 0.1323, 0.2291)
l = MixAudio(ssl, fl_c_lfe, 1.0, 1.0)
r = MixAudio(ssr, fr_c_lfe, 1.0, 1.0)
return MergeChannels(l, r)
}
# Call function
f64e934d9334b4d9f8ae9e16fe4aa5498( c64e934d9334b4d9f8ae9e16fe4aa5498 )
########################################
# [DSP: Normalize to 100%]
########################################
Normalize()
########################################
# [Encoder: OggVorbis (Q=3)]
########################################
6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last
Dark-Cracker
23rd December 2005, 11:43
is there a way to upmix 2ch audio file at 6ch using avisynth ?
dimzon
23rd December 2005, 11:45
is there a way to upmix 2ch audio file at 6ch using avisynth ?
I found some method but it requres REVERB function in AviSynth. I'm planning to write apropriate AviSynth plugin later.
http://forum.doom9.org/showthread.php?p=747809#post747809
dimzon
23rd December 2005, 12:02
Yet another petition: http://forum.doom9.org/showthread.php?p=756054#post756054
dimzon
23rd December 2005, 15:35
Yet another demo build (last per this year)
http://www.mytempdir.com/338780
Encoding not working yet!
+New Upmix exrtension (not working Yet!)
+Per-plugin settings persistance
+Normalize now have a GUI
Please post Your feedback/suggestions
Bye!
dimzon
26th December 2005, 15:00
http://img452.imageshack.us/img452/3268/bl04pg.gif
http://img484.imageshack.us/img484/7261/bl19mo.gif
http://www.mytempdir.com/343621
+ Preview
+ Encoding
Rockaria
3rd February 2006, 19:16
Wow, it's been a very long time!
I really appreciate everybody engaged in these projects, although I cannot contribute any more because too good many people are joined, almost certainly..(in fact I am busy). However, I had some different beliefs than what is going on.:)
# Call function
f64e934d9334b4d9f8ae9e16fe4aa5498( c64e934d9334b4d9f8ae9e16fe4aa5498 ) I understand it is emphasizing(almost upto frustration level) the equal unique names on both references : functions & varibles
But simply, any duplicated function names will be filtered by compiler or interpreter, while duplicate variables are not covered at all in this avisynth script.
I admire tebasuna51 for his generous personality, dimzon for his excellent inspirations and sorry for MiCK76's possible frustration.
Although it seemingly has some other issues(not that straightforward dsp, function, encoder definition and no profile management yet), I believe it will definitely benefit everybody.
Good luck guys.:)
Rockaria
19th February 2006, 12:27
Below is a (enhanced) guide(examples) for those who are using the Avisynth scripts for audio transcoding because of the compatibility requirements of the existing resources(especially for avs2wav). I also found that bepipe(cli)/behappy(gui) can utilize the existing compatible resources using import() method.
Now some side story of the 70/30 or 80/20 rule.
. the script based tools are more focused on power user requirements : 20~30% of users are considered using this flexible tool together with other powerful tools such as Sox?...
. 70~80% of the users who do not require sophiscated handling, will be satisfied by the existing abundant of GUI tools(winamp, dbpoweramp, foobar2k, Be~tools......) providing patternized processing
. my efforts are for some few of the power users who want the flexibility and transparency with Avisynth scripts, in other words the freedom and power...., which is also the basic/essential requirement of any new coming powerful simple tools(with just few hrs or days work).
<startEnc.cmd> for anybody who want multi tasking when performing a long transcoding
rem START ["title"] [/Dpath] [/i] [/MIN] [/MAX] [/SEPARATE | /SHARED]
rem [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
rem [/WAIT] [/b] [command/program]
start "encoding" /LOW profiles.cmd
<profiles.cmd> encoding profiles, yeah the bepipe can replace the avs2wav.
rem ---unlock the temporary FIX lines for avs2wav on the BOTTOM of the script
avs2wav.exe upmxdpl2.avs - | oggenc2.exe -q5 - -o 2.ogg
rem avs2wav.exe ogg6ch.avs - | oggenc2.exe -q5 - -o 6.ogg
rem avs2wav.exe aac2ch.avs | naac -profile he -vbr 5 - 2.m4a
rem avs2wav.exe aac6ch.avs | naac -profile he -vbr 5 - 6.m4a
rem avs2wav.exe aac6chB.avs | naac -profile lc -vbr 8 - 8B.m4a
rem ---somebody might be able to fix the flexibility problem of behappy using IMPORT()
rem bepipe.exe --script "import(^upmxdpl2.avs^)" | oggenc2.exe -q5 - -o 2.ogg
rem bepipe.exe --script "import(^aac6ch.avs^)" | naac -profile he -vbr 5 - 6.m4a
rem avs2wav.exe upmxdpl2.avs
<upmxdpl2.avs> : (2ch->upmix) / 6ch->(dpl2), check the avs2wav temporary fix on the bottom, preview(play) the script with MPC(or any DS media players) before encoding.
import("upmix.avs")
import("dpl2enc.avs")
DirectShowSource("1.mp3")
#NicDTSSource("1.dts")
#DirectShowSource("1.m4a")
#DirectShowSource("SSWAV06.m4a")
#DirectShowSource("DPLII.grf")
Amplify(0.92)
#AmplifydB(-1.01)
convertaudiotofloat()
#upmixComedyDrama(last)
#upmixActionAdventure(last)
upmixBalCenter(last)
#upmixIncCenter(last)
#upmixDecCenter(last)
#upmixGerzen(last)
#upmixFarina(last)
#upmixMultisonic(last)
#upmixSoundOnSound(last)
#dpl2FFDA(last)
#dpl2FFDLFEA(last)
#dpl2FFDA(last, 0.7)
dpl2Enc(last, 0.7071, 0.6, 0.866, -0.5, -0.5, 0.866)
#dpl2Enc(last, 0.707, 0.4, 0.8165, -0.5774, -0.5774, 0.8165)
#dpl2Enc(last, 0.7071, 0.4, 0.866, -0.5, -0.5, 0.866)
#dpl2Enc(last, 0.707, 0.4, 0.8165, -0.5774, -0.5774, 0.8165)
#ConvertAudioTo16Bit()
ConvertAudioTo24Bit()
SSRC(48000)
#Normalize()
#below are temporary fix for avs2wav : use SSRC if the 44.1k streaming is pending
#SSRC(48000).SSRC(44100)
#AudioDubEx(Trim(Colorbars(320,240),0,1),last)
<upmix.avs> a (heavy) reconstruction( for a compatibility) of NorthPole's (http://forum.doom9.org/showpost.php?p=787656&postcount=95) hardwork.
...
function invertFilter(clip a, fv, rv){return invertFilter(a,fv,-1*fv,rv)}
function invertFilter(clip a, fv1, fv2, rv){return invertFilter(a,fv1,fv2,rv,-1*rv,"vol -0.5")}
function invertFilter(clip a, fv1, fv2, rv1, rv2, lv){
f = a.soxfilter("filter 20-20000")
fl = f.GetChannel(1)
fr = f.GetChannel(2)
r = a.soxfilter("filter 100-7000").DelayAudio(0.02)
rl = r.GetChannel(1)
rr = r.GetChannel(2)
lfe = ConvertToMono(a).SoxFilter("lowpass 120", lv)
return MergeChannels(mixaudio(fl,fr,fv1,fv2),mixaudio(fr,fl,fv1,fv2), fl,fr, mixaudio(rl,rr,rv1,rv2),mixaudio(rr,rl,rv1,rv2), lfe)
}
function upmixComedyDrama(clip a){
# Profile to use with audio sources that have mostly mono content.
f = invertFilter(a, 0.794, 0.562)
l = f.GetChannel(1)
r = f.GetChannel(2)
c = mixaudio(mixaudio(f.GetChannel(3),l,1,-1),mixaudio(f.GetChannel(4),r,1,-1),0.224,0.224)
return MergeChannels(l,r,c,f.getChannel(7),f.getChannel(5),f.getChannel(6))
}
function upmixActionAdventure(clip a){
# Profile to use with audio sources that have a wider range of sound content. 20ms delay and -3db attenuation on surround
f = invertFilter(a, 0.668,-0.668, 0.473,-0.473, "vol -0.447")
l = f.GetChannel(1)
r = f.GetChannel(2)
c = mixaudio(mixaudio(f.GetChannel(3),l,1,-1),mixaudio(f.GetChannel(4),r,1,-1),0.398,0.398)
return MergeChannels(l, r, c, f.getChannel(7), f.getChannel(5), f.getChannel(6))
}
function upmixBalCenter(clip a){
# Balanced approach L' = (L-R)*0.668 R' = (R-L)*0.668 C' = (L-L')*0.398 + (R-R')*0.398
# Profile for general purposes to use with audio sources that have a wide range of sound content
f = invertFilter(a, 0.668, 0.531)
c = mixaudio(f.GetChannel(3),f.GetChannel(4),0.3980,0.3980)
return MergeChannels(f.getChannel(1), f.getChannel(2), c, f.getChannel(7), f.getChannel(5), f.getChannel(6))
}
function upmixDecCenter(clip a){
# Balanced approach L' = (L-R)*0.668 R' = (R-L)*0.668 C' = (L-L')*0.398 + (R-R')*0.398
# Profile to use for older movies or videos with mostly mono content.
f = invertFilter(a, 0.668,-0.668, 0.531,-0.531, "vol -0.596")
l = f.GetChannel(1)
r = f.GetChannel(2)
c = mixaudio(mixaudio(f.GetChannel(3),l,1,-1),mixaudio(f.GetChannel(4),r,1,-1),0.224,0.224)
return MergeChannels(l,r,c,f.getChannel(7),f.getChannel(5),f.getChannel(6))
}
function upmixIncCenter(clip a){
# Increased center approach L' = (L-R)*0.596 R' = (R-L)*0.596 C' = (L-L')*0.473 + (R-R')*0.473
# Profile to use with audio sources where quieter dialog or lots of loud sound effects.
f = invertFilter(a, 0.596,-0.596, 0.473,-0.473, "vol -0.473")
l = f.GetChannel(1)
r = f.GetChannel(2)
c = mixaudio(mixaudio(f.GetChannel(3),l,1,-1),mixaudio(f.GetChannel(4),r,1,-1),0.473,0.473)
return MergeChannels(l,r,c,f.getChannel(7),f.getChannel(5),f.getChannel(6))
}
function upmixGerzen(clip a){
# Gerzen approach Profile modified with 20ms delay and some attenuation on surround
f = invertFilter(a, 0.885, -0.115, 0.668)
c = mixaudio(f.GetChannel(3),f.GetChannel(4),0.4511,0.4511)
return MergeChannels(f.getChannel(1),f.getChannel(2),c,f.getChannel(7),f.getChannel(5), f.getChannel(6))
}
function upmixMultisonic(clip a){
# Multisonic approach Profile modified with 20ms delay and some attenuation on surround
f = invertFilter(a, 0.9,-0.45, 0.596)
c = mixaudio(f.GetChannel(3),f.GetChannel(4),0.5000,0.5000)
return MergeChannels(f.getChannel(1),f.getChannel(2),c,f.getChannel(7),f.getChannel(5), f.getChannel(6))
}
function upmixFarina(clip a){
# Farina/Sursound approach Profile M=L+R, S=L-R, c=0.75, L' = (1-c/4)*M+(1+c/4)*S, C' = c*M, R' = (1-c/4)*M-(1+c/4)*S
f = invertFilter(a, 0.500, 0.668)
ff= mixaudio(f.getChannel(3),f.getChannel(4),0.500,0.500)
l= mixaudio(ff,f.getchannel(1),0.8125,1.1875)
r= mixaudio(ff,f.getchannel(2),0.8125,-1.1875)
c = mixaudio(f.GetChannel(3),f.GetChannel(4),0.3750,0.3750)
return MergeChannels(l, r, c, f.getChannel(7), f.getChannel(5), f.getChannel(6))
}
function upmixSoundOnSound(clip a){
# SOS approach Profile with 20ms delay and some attenuation on surround
f = invertFilter(a, 0.000, 0.668)
c = mixaudio(a.GetChannel(1),a.GetChannel(2),0.5,0.5)
return MergeChannels(f.getChannel(3), f.getChannel(4), c, f.getChannel(7), f.getChannel(5), f.getChannel(6))
}
<dpl2enc.avs> for those who have experienced the existing DPL II encoders(FFDShow, Azid, ...) are not decoding correctly on digital receivers or headphones(2ch).
...
function dpl2FFD(clip a){return dpl2FFD(a, 0)}
function dpl2FFDLFE(clip a){return dpl2FFD(a, 0.7)}
function dpl2FFD(clip a, LF2){return dpl2Enc(a, 0.7071, LF2, -0.866, -0.5, 0.5, 0.866)}
function dpl2FFDA(clip a){return dpl2FFDA(a, 0)}
function dpl2FFDA(clip a, LF2){return dpl2Enc(a, 0.7071, LF2, 0.866, -0.5, -0.5, 0.866)}
function dpl2FFDLFEA(clip a){return dpl2FFDA(a, 0.7)}
function dpl2Enc(clip a, CC2, LF2, Ls3, Rs1, Ls1, Rs3){
cc = MixAudio(GetChannel(a, 3),GetChannel(a, 4),CC2,LF2)
Lt = MixAudio(GetChannel(a, 1),cc,1,1)
Rt = MixAudio(GetChannel(a, 2),cc,1,1)
Ls = GetChannel(a, 5)
Rs = GetChannel(a, 6)
Lss = MixAudio(Ls, RS, LS3, Rs1)
Rss = MixAudio(Ls, RS, LS1, Rs3)
return MergeChannels(MixAudio(Lt,Lss,1,1), MixAudio(Rt,Rss,1,1))
}
Closure.
sjchmura
6th March 2006, 22:29
I am a bit confused ....
If we have a DTS 5.1 ripped (U2 live chicago say :) and want 2 channel with HFRT "3D" encoded INTO it so on say an iPOD it "sounds like" 5.1 can you not use FFDShow and AVIsynth to achieve this? I ant to "build in" the effect to the 2 Channel sound so ANY player gives the "effect"
Rockaria
6th March 2006, 23:07
Of course, some players may have the spatial effects on any 2ch formats/speakers/headphones.
But the intended(surround effects on 2ch players) encoded signal would be the FFDShow's HRTF directly intended to the headphones.
The DPL (II) encoded stream also contains the intended signal, possibly for any intelligent 2ch players or receivers to reconstruct the (virtual) spatial effects(check boss's 2ch virtual speaker set, dolby headphone, dolby virtual speaker ;) ). But it is originally intended for 5.1ch DPL II decoder/speaker system through the limited 2ch carriers.
[edit] clarification : added dolby headphone & dolby virtual speaker
sjchmura
7th March 2006, 00:22
But iPOD like devices are NOT intelligent. Thus you MUST encode what you want INTO the stream with the assumption no benefit from teh hardware
Rockaria
7th March 2006, 00:48
But iPOD like devices are NOT intelligent. Thus you MUST encode what you want INTO the stream with the assumption no benefit from teh hardwareI have no iPOD! ;)
That reality only applies to people like you who has non-intelligent(precisely speaking, with no HRTF or dolby headphone DSP) portable players but wants such effects.
You must also consider the use of the contents other than the headphones.....
sjchmura
8th March 2006, 15:54
I think alot of people have iPODs. IN fact, NONE of the "play for sure devices" have the DSP or dolby built in.
Thus if 99% of the market for portable players do not have this capability I don't think a simple solution is out of hte question.
Of course at home you can just "play the DTS track" - agreed. But if you want ot cut it up and "hear it" through your MP3 player we must encode the HFRT into the stream
Rockaria
8th March 2006, 16:37
I agree in general.;)
My point was it depends on the needs.
Normally it will satisfy the headphone only use.
But what if an iPOD user wants to plug the HRTF DSP applied signal to a receiver or speaker set in a party place?
3dsnar
8th March 2006, 17:09
One issue should not be ommited.
When using HRTF, to achieve reliable results,
the filter characteristics should perfectly match
the individual's shoulders and head shape, to
simulate the sourround feeling.
Therefore some sort of averaged model (applicable for all),
which is usually used
is a sort of compromise...
In my opinion this compromise in most of the cases is not acceptable (i.e. not convincing for me at least)
3dsnar
8th March 2006, 17:10
There should be a software for tuning the filters for each individual.
I do not know is such exists...
Rockaria
8th March 2006, 18:45
That's a good point.
I will buy one like iPODs only when it supports :
. multi channel decoding
. the customization of the DSPs(including HRTF) for headphone or line/spdif out.
Until then, I will rely on my laptop(or possibly tablet) for portable use...
NorthPole
17th March 2006, 04:29
I am a bit confused ....
If we have a DTS 5.1 ripped (U2 live chicago say :) and want 2 channel with HFRT "3D" encoded INTO it so on say an iPOD it "sounds like" 5.1 can you not use FFDShow and AVIsynth to achieve this? I ant to "build in" the effect to the 2 Channel sound so ANY player gives the "effect"
I believe that in order to encode a 2 channel signal to playback and "sound like" the original 5.1 channel sound you would need to do something like the dolby encoding approach. I believe you can do that using various audio editors like cooledit or sound forge, but the process is somewhat involved.
I have thought about trying to speed up the process by using various command line tools such as sox, etc. but I have difficulty understanding how to create a 90 degree phase shift on the surround channels.
Does anybody know of a method other that an audio editor to perform such a function?
Rockaria
17th March 2006, 05:18
Does anybody know of a method other that an audio editor to perform such a function?
The issue is oiginally discussed here : http://forum.doom9.org/showthread.php?t=108090
Dark-Cracker
6th July 2006, 14:49
perhaps this thread could help you.
http://forum.doom9.org/showthread.php?t=101259
++
Rockaria
6th July 2006, 18:25
perhaps this thread could help you.
No, never! And I don't get the purpose of your post reasonably...:cool:
The DPL II encoding methos are fully examined here.
http://forum.doom9.org/showthread.php?t=112122
http://forum.doom9.org/showthread.php?t=111603
All the invert-only methods(including some of my models) are just partial incomplete implementations.
The full DPL II encoding requires the full-pass (frequencies) 90deg phase shifts in addition to the inverts.
If you are interested and cannot read all the related threads, I can include the links to explain why those approaches are misleading.
BTW, Avisynth is based on the streaming i/o. So in order to get the peak volume to use for Amplify(1.0) like other tools, it must scan the entire stream first, which is Normalize(1.0) : max gain with no clipping.
Also you will have to check if the Normalize() performs seperately(by each peak volume) on each channel. If it does, use the amplify(x) on all channels with the replaygain value x from other tool such as foobar2k.
NorthPole
22nd September 2006, 16:07
.
The full DPL II encoding requires the full-pass (frequencies) 90deg phase shifts in addition to the inverts.
I've read the above referenced posts. If I understand this correctly, you are using ffdshow to decode 5.1. I've never used ffdshow, can you use it to upmix to 5.1 from stereo?
I still have not found a avisynth filter capable of the 90 deg phase shift to use in a avisynth/bepipe script.
Rockaria
23rd September 2006, 02:09
Unfortunately, me neither yet..:rolleyes:
There are some VST(PhaseBug,) & winamp(Stereo Tool,) plugins which perform the 90 deg phase shift on cetrtain channel(s) that can possibly be used through avs::grf:: (DC-DSP or ffdshow::winamp) on rear channels to be aligned-mixed to the fronts before the DPL II mix.
But aligning the delay of the shifted channels would still be the problems unless we have more accurate contol on the phase shift algorithms.
I have found Csound has a c++ hilbert() and FMOD has a built-in DPL(II) mix function that can be reasonably integrated into a avisynth plugin. But unfortunately it's a long future plan for me(if I have to) because I am not into the development any longer(my fingers have lost the touches).
It just is strange why the relatively simple plugin is not integrated into avisynth yet. Maybe partially because it can only enhance the seperation quality to 10~30% over the invert-only model and can never be better than the current discrete multichannel encoding(DD, DTS, AAC...).
However, it's an intended(from multi channel sources) multichannel encoding differentiating itself from the artificial multi channel effects(any kind of upmix from 2ch sources) and still be applied to the higher channels as dpl IIx.
The ffdshow DSPs(including the upmix, downmix, hrtf, resample...but no decoding) can be used within the avs with ffavisynth.dll. But as the avisynth development has got complicated(with different branches), there seems to be some problems in the dynamic linking(probably because of different versions of interfaces used in the ffavisynth.dll. I remember avisynth v2.55 worked fine with some old versions of ffavisynth.dll) and cannot be used correctly as described in the avisynth manual.
Currently, the only way to use the ffdshow as a decoder & dsp container together is to use in a graphedit file(*.grf) included in a avs script with directshowsource("a.grf"). To reuse the GRF, copying the sources and renaming to the predefined ones will be the simplest way.
But I believe the avisynth having the very open architecture thus lots of types of plugins attachable, it's a matter of time than the technology.
Meanwhile, you can evaluate the true DPLII with lots of existing professional vst(or with phase shifts DSPs) enabled wav editors if it really satisfies the tastes as is tested in the mentioned link.
NorthPole
23rd September 2006, 14:34
@Rockaria
Thanks for the info, I'll post if I run across anything. Untill then, I think I may try the foobar approach with the ATsurround dsp plugin and the aften encoder.
Rockaria
23rd September 2006, 20:36
Yes, as I mentioned in the related thread(http://forum.doom9.org/showpost.php?p=867873&postcount=6),
the foobar2k+ATSurround+any-encoder solution seems to be the most economic DPL II encoding solution ATM.
They say in their forum, it does the 90deg phase shift. But when I inspected the image, it shows a bit altered but very close to the original.
So I suspect it might be doing the selective-freq(10k?) phase shift, at least producing the un-biased playback in general.
NorthPole
23rd September 2006, 22:35
the foobar2k+ATSurround+any-encoder solution seems to be the most economic DPL II encoding solution ATM.
Just curious about what the channel mixer is doing for your mix? (Note about LFE volume control?)
And I think you are use the hard limiter or the winamp dsp to do DRC?
I'm just using the ATsurround plugin on RG'd files.
Sorry, this is a bit off topic.
Rockaria
23rd September 2006, 23:27
No problem, it's related and also mentioned in this thread before.
The ATSurround with no ch-gaining control gave me too much LFE. I used the channel mixer to control the ch-gains from the 6ch source before feeding to the ATSurrounf DPL II encoding.
The DRC is compressing the bit depth, usually volume range reduced centered around the typical average sound patterns. The more application, the more distortion will be created.
The hard limiter is dealing with the upper area of the wave form to soften the clippings(over 0dB), simpler and better fidelity than just allowing the clippings or any DRC or DN(Dynamic Normalization) solutions. The RG application in decoding may cause the clippings and I believe any RG-enabled players are designed to prevent these clippings when decoding.(check the new foobar RG application options)
The same resoning goes to the AC3 coding. Even if we can encode the AC3 with proper dialnorm and DRC by freq-levels encoding without clippings, the decoder might encounter the situation to hard-limit the over-peak decoded(freq-summed) area(by the dialnorm application) especially if the user chose not to use the DRC(for more fidelity because of the quiet listening environment). In this case(with or without considering the DRC), the pre-attenuation or hardlimiting is considered necessary for the safer transcoding(to me).
[edit] some additions to ac3 dialnorm
The decoder will eventually make the dialnorm value to -31dB. So when given -1dB it will attenuate -30dB when decoding. And when given -31dB, it won't adjust the volume level. So theoretically, the decoded wave form should not exceed the original volume level(conservative than RG).
But practically it is known that the decoded wave form can exceed the 0dB by psychoacoustic processing and in case of originally clipped source, it is also observed the decoder is rebuilding the clipped area depending on the decoder logic.
So if we suppose those effects are less than 3dB, the dialnorm range -1dB ~ -28dB will be safe if there are no other decoder specific constraints.
However, in my case of DDLive, the -31dB of dialnorm delivers tranparent(equal) steady volume level regardless of clippings onto my two receivers.
[edit2]some remarks on AC3 DialNorm & DRC for transcoding
My problem is my output often has low volume and I was wondering why this is.
..
Im using ProCoder 2.0 which has built in filters for audio.
The filter Normalize has two options:
1. Normalize to mean RMS of sources
2. Normalize peak to specified DB level
..
use Dynamic Range Compression then(and after) normalize.
..
I don't like wide dynamic ranges (and the neighbourhood too :D )
The first often-low-volume is covered by Dolby's normalize-to-mean-rms(aka. dialnorm) which is designed to have the average preceived dialog levels(between the sources).
Secondly, the DRC in Dolby is applied in two steps :
. encoding time : average the dynamics with certain predefined patterns scanning inside : looks a bit closer to the mastering concept
. decoding(play/transcoding) time : the decoder mostly has the scanned DRC application level(0~1, the more the less fidelity) to personalize the listening environment(listener + neighborhood + devices), losing this flexibility(personalized) by transcoding.
So 'preferred DRC decoding level + normalize(-3dB) | RG(scan)+limiter' is expected for normal ac3 transcoding steps.
In case, 'RG(scan)+limiter' can be used for further average-boosting the perceived sound levels without touching the volume knob when switching between the sources.
A remind : Dolby's DialNorm mean RMS sound level is expected to be altered by the 'normalize(-3dB)' here.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.