Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
1st December 2023, 17:11 | #1 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
SoxFilter 2
Latest:
SoxFilter 2.2 for AviSynth - 20240104 https://github.com/pinterf/SoxFilter/releases ---- SoxFilter 2.0 for AviSynth. Based on Sox audio library 14.4.2. Requres Avisynth+ 3.7.3 Download: https://github.com/pinterf/SoxFilter/releases/tag/v2.0 Previous discussion: https://forum.doom9.org/showthread.php?t=104792&page=3 Treat it as a beta, you are the real testers. Spent some weeks on the project this year, got tired of it. Some effects has been changed, merged with others or removed from the Sox core library since the 1.1 release; do not erase your old dll's yet. Last edited by pinterf; 3rd January 2024 at 19:52. Reason: subversion independent thread name |
2nd December 2023, 15:42 | #5 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,915
|
Tested the downmix 7.1->5.1 (than can be applied in MEGUI):
Quote:
__________________
BeHappy, AviSynth audio transcoder. |
|
2nd December 2023, 22:49 | #6 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Thanks for trying it out.
I'm just testing the behavior of effects which change the channel count and/or the sample rate, so far so good. 2.1 will get this feature, 2.0 is giving an error message intentionally. This works in my test for example Code:
ColorBars().Trim(0,30*60*1) # ~1 min Stereo 48000Hz SoxFilter("rate 2400", "remix -") # resample to 2400 Hz and convert to mono |
3rd December 2023, 02:03 | #7 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Thank you so much for this!
I look forward to try version 2.1 on the various upmix functions! (UpSoundOnSound() etc). On Monday I'll try version 2.0 at work and I'll report back, but thank you for picking this one up, it feels like yesterday but it's been a long time since the last release as we have to go all the way back to 2006! Back then I had just started fansubbing in Italy, I was still studying at school and my main worry at the time was going to the beach on summer and hanging around in winter. Man, those were the days... Little did I know things were gonna get harder growing up from there... Anyway, enough for the depressing thing, this is a very nice present under the Christmas tree! Oh, I almost forgot: if anyone wants to try this on XP, don't, it's not compiled targeting it so it lacks the function GetLocaleInfoEx and won't work when it makes a kernel call ('cause it doesn't exist in kernel32). Last edited by FranceBB; 3rd December 2023 at 02:07. |
3rd December 2023, 11:45 | #8 | Link | ||
Registered User
Join Date: Aug 2016
Posts: 609
|
Thank you very much for this.
I was wondering though if this issue got fixed: Quote:
I am interested in using it as a compressor like this: Quote:
The result sounds crackly but then I tried changing the final curve point to 0,-5 and it sounds better but maybe still a bit crackly, not sure. If I seek too much the audio then gets really crackly, but then I can seek again and it resolves itself. Does it still require linear access? |
||
3rd December 2023, 12:02 | #9 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
I think the -5db trick might be solving the crackling issue mentioned by tebasuna51.
And I lowered the attack/decay for less "pumping" effect, and made the curve less steep: Code:
SoxFilter("compand 0.01,0.1 6:-90,-90,-70,-70,-50,-30,0,-5") So I guess my only request would be to make it more compatible with seeking, but that's probably not of interest to most users. |
3rd December 2023, 12:18 | #10 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
May I ask how you came up with this curve? Is it some standard curve used by Dolby or something? It sounds quite good to me. But I see you didn't specify a soft knee -- does that mean it uses linear segments or does it default to something?
|
3rd December 2023, 16:37 | #11 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Version 2.1
https://github.com/pinterf/SoxFilter/releases/tag/v2.1 Code:
- Allow effects which can alter sampling rate - Allow effects which can change the number of channels - Add XP build (v141_xp toolset) |
3rd December 2023, 19:49 | #13 | Link | ||||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Thank you Ferenc!
I tested version 2.1, but when I call Quote:
SoxFilter: (filter) could not find any effect. The function I'm trying to use is: Quote:
Other upmix functions end up with the same results, for instance: Quote:
SoxFilter: (filter) could not find any effect. Quote:
|
||||
3rd December 2023, 20:03 | #14 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
This is the day of the diligently read f** readme files
@FranceBB "Also, some effects were removed, and others added in the past ~15 years. The parameters of some effects had been changed as well. E.g. reverb parameters were modified in 2008; "filter" was removed, use "sinc" instead (with a different syntax)." @richardpl "SoxFilter will convert the audio to 32 bit integer format, this is how libsox works internally. It calls "ConvertAudio" which is part of AviSynth+." |
3rd December 2023, 20:10 | #15 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
I admit, this error message "SoxFilter: (filter) could not find any effect." is not something I would expect. I'm going to check, as far as I remember such an unknown effect name would return a proper error message. At least it returned in April , this UpSoundOnSound and "filter" issue was my first surprise (showing that things has been changed in two decades).
Last edited by pinterf; 3rd December 2023 at 20:23. Reason: typo |
4th December 2023, 03:17 | #16 | Link | ||||||||||||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Of course it was, it's been 15 years, silly me! xD
Ok, so, second test, first I extracted the first two channel (stereo) out of a sample mxf and trimmed it to 1 minute only: Quote:
then I upmixed using the original SoxFilter 1.0 and the SoundOnSound 5.1 upmixing function: Quote:
Then I upgraded to SoxFilter 2.1 and I replaced Filter with Sinc: Quote:
Then I compared the two versions: Quote:
and of course the Surround Left and Surround Right are different between the two version as we can also see with Subtract: I then grabbed SL and SR from both the old Sox upmix and the new Sox upmix and I compared them individually: Quote:
Quote:
I then wrote something silly to prevent the upmix functions from failing when using an older version of Sox: Quote:
The samples are here (link valid for 7 days): https://we.tl/t-Q83d2Uthtr in the package there's: - stereo.wav (original audio) - SoxFilter_10_Upmix_51.wav (old sox upmix) - SoxFilter_21_Upmix_51.wav (new sox upmix) - SoxFilter_10_SL_SR_Only.wav (Surround Left Surround Right only of the old Sox Upmix) - SoxFilter_21_SL_SR_Only.wav (Surround Left Surround Right only of the new Sox Upmix) Before I go on with this, though, I'd like to ask Tebasuna as he's far more expert than me on this. Needless to say, the same "workaround" can be applied to the other upmix functions of course. UpAction: Quote:
UpDialog: Quote:
Quote:
Quote:
Quote:
Last edited by FranceBB; 4th December 2023 at 09:19. |
||||||||||||
4th December 2023, 12:07 | #17 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,915
|
About these old upmix filters I make some comments longtime ago:
1) Filters like front = a.soxfilter("sinc 20-20000") does not have sense only can waste time and quality. 2) Create a LFE channel with a lowpass of front channels is don't understand what is the LFE channel, and how work all audio equipments: the bass frequencies of ALL channels (not only LFE) are sended to SubWoofer speaker. The mix of bass from front channels and LFE channel can be doubled/cancelled/distorted. The best option is always a LFE empty: lfe = fl.Amplify(0) 3) To avoid problems, at least with SoxFilter 1.0 and multichannel, I recommend use multiple mono instances for sox filters, instead back = a.soxfilter("filter 100-7000"): bl = fl.soxfilter("filter 100-7000") br = fr.soxfilter("filter 100-7000") 4) Some mix with sum of coeficients greater than 1 can cause clips for instance fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),1,-0.5) A example of my suggested upmix: Quote:
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 4th December 2023 at 12:23. |
|
6th December 2023, 09:08 | #19 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Wrong doorbell, complain here
https://sourceforge.net/p/sox/mailma...ail.gmail.com/ |
1st January 2024, 16:32 | #20 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
Not sure if I'm knocking at the wrong doorbell but, as noted by tebasuna51:
Demo: Code:
# Make sine tone ColorBars().ConvertToYV12().Trim(0, 3000) # Apply "Dolby film standard" compression profile which looks like this: tiny.cc/dolbydrc SoxFilter("compand 0.05,0.10 -90,-90,-70,-64,-43,-37,-31,-31,-21,-21,0,-20") # Problem occurs here # Normalize(0.98) # audible distortion & visible clipping on histogram # Normalize(0.60) # no visible clipping on histogram but still audible distortion # Show levels Histogram(mode="audiolevels") Code:
"C:\program files\ffmpeg\bin\ffmpeg.exe" -i "C:\script.avs" -c:v libx264 -tune film -b:v 8000000 -pix_fmt yuv420p -c:a aac -b:a 320k "c:\audiotest.mkv" A workaround seems to do the Normalize first, then Soxfilter, then AmplifyDB(15.0) or so to gain back the 20db headroom created by the Soxfilter (or put " 15" at the end of the Soxfilter string). But seeking backwards can still cause it to bug out and become audibly distorted - more so in MPC-HC and less so in AvsPMod. I have tried mucking around with Preroll, Prefetch and SetCacheMode without success. Last edited by flossy_cake; 1st January 2024 at 16:56. |
Thread Tools | Search this Thread |
Display Modes | |
|
|