Log in

View Full Version : L-SMASH Source


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 [35]

flossy_cake
8th December 2025, 13:00
Yes you are right. You can easily check what files are already cached in RAM with this cool tool
https://learn.microsoft.com/en-us/sysinternals/downloads/rammap

Thanks but I can't look at it cause I've blocked all microsoft domains at router level as a precaution against auto updates of the OS :devil:

Anyway the moral of the story: you don't need to do audio indexing first cause OS will deliver it out of RAM - BUT - there are other media files that take longer to index like say a movie with a 1500kbps 5.1 DTS audio track, the indexing takes way longer for that so still ultimately better to do the Audio first as a general rule or "best practices" type thing. For a typical 2 hour DVD movie though it's only about 5 seconds extra to do it out of RAM a second time.

flossy_cake
14th February 2026, 07:32
Is there any possibility that audio track selection by language could be added?

LAV video decoder for DirectShow supports it - wouldn't this mean language detection is built into libav itself and would be trivial to implement?

Anyway here is a use case scenario: Looney Tunes collection (800GB) contains hundreds of mkv files, each with multiple language tracks and the English track is on a different track number for each file. So selecting by track number is not an option unless you want to manually inspect each file.

Currently: LWLibavAudioSource(stream_index=1)

Proposed: LWLibavAudioSource(stream_lang="eng")

:thanks:

edit: well, there is a theoretical way to work around it: using DirectShowSource() for the audio track (which invokes nevcairiel's DirectShow LAV splitter in the system tray, which handles the language selection). But DirectShowSource() can't handle non-English characters in file paths (which many files in this large collection contains) so I'd still need to manually inspect/modify each file. Plus DirectShowSource is kind of flakey and I'd much prefer to use libav. Kinda crazy after decades of Avisynth development there is still not a source filter that can select audio track by language.

edit2: DirectShowSource() is indeed janky with audio sync issues, seem to need EnsureVBRMP3Sync() to fix it from being up to 10 seconds out of sync, but reliability is questionable.

edit3: and in the LAV Splitter instance in the system tray that was invoked by DirectShowSource(), untick "Prefer audio streams with highest quality" to force it to choose the first english track rather than the highest quality english track (avoids some false positives where the highest quality english track was actually a commentary track).

edit4: and to clean the file path of foreign language characters: cleanedFilePath = RegExReplace(filePath, "[^\x20-\x7E]", "") (replaces any characters outside the range ASCII 32 to 126 with empty string: "")

StainlessS
14th February 2026, 10:53
Thanks but I can't look at it cause I've blocked all microsoft domains at router level as a precaution against auto updates of the OS :devil:

Flossy, above, older post but maybe you wanna try this,

https://www.sordum.org/9470/windows-update-blocker-v1-8/

https://i.postimg.cc/MHH153X8/Untitled-01.jpg (https://postimages.org/)

Easy Peasy to switch on/off, been using it for several years.
[I only ever select the "enable/disable updates" radio buttons and then apply.]

EDIT: non-install, run it directly.

EDIT: Maybe its because of telemetry that you block all M$ domains, not necessary just to block Auto Update.

flossy_cake
14th February 2026, 12:50
Flossy, above, older post but maybe you wanna try this,

https://www.sordum.org/9470/windows-update-blocker-v1-8/

https://i.postimg.cc/MHH153X8/Untitled-01.jpg (https://postimages.org/)

Easy Peasy to switch on/off, been using it for several years.
[I only ever select the "enable/disable updates" radio buttons and then apply.]

EDIT: non-install, run it directly.

EDIT: Maybe its because of telemetry that you block all M$ domains, not necessary just to block Auto Update.


Cool, looks like it works by blocking the Windows update service(s).

Of course, the first thing I tried ages ago was disabling those services and they just kept getting automatically re-enabled by Windows. So that app must be polling the service running state every n seconds or so and saying "no ya dont" :devil:

The way I'm currently blocking updates is with a bunch of regkeys and a group policy setting (the latter of which only works on the Pro version since Home has no group policy editor) and that resulted in the update screen looking like this now:

https://i.imgur.com/FNx4Rdx.png


https://i.imgur.com/f7y5EZK.png


Clicking "check for updates" would still update, so I needed to block all these domains at my router too:


https://i.imgur.com/hE4XsgU.png


After blocking those domains, now when I click "check for updates" I just get the animating spinner for eternity and it never updates.

However it's probably wise to also block the update services with that app as well because for all I know Windows could force click the "check for updates" button click at some point, in which case my only line of defense would be my router, and I'd like at least 2 lines of defense.

Another line of defense is to use Clonezilla to image the OS drive so I can roll back if the worst happens.

Looks like I'll be using Windows 10 for the next 10 years or so, I can't think of anything I would need 11 for.

StainlessS
14th February 2026, 13:25
I have not ever found it necessary to use any of the more 'advanced' options of WindowsUpdateBlocker, it aint ever failed for me.

But could additionally try "WindowsUpdatePause.reg" from here:-
https://forum.doom9.org/showthread.php?p=2014221#post2014221

Yes, always a good idea to have an image of OS (or several images including initial setup with then current updates, perhaps updated to W10 Final updates).

flossy_cake
27th February 2026, 06:33
Is there any possibility that audio track selection by language could be added?
Currently: LWLibavAudioSource(stream_index=1)
Proposed: LWLibavAudioSource(stream_lang="eng")
edit: well, there is a theoretical way to work around it

I will post the solution here for how to open audio track by language, AND also render subtitle track by language!

Note: you will need the Directshow LAV and and DirectVobSub installed (recommend installing k-lite codec pack for this)

source = "C:\MyVideo.mkv"

video = DSS2(source, /* http://www.avisynth.nl/index.php/DSS2mod */
\
\ subsm=2, /* force loading of DirectVobSub to the graph for subtitle rendering.
\ Select rendering style options through the DirectVobSub tray icon. */
\
\ lavs="l3 sa[*:eng|f]", /* sa[*:eng] = choose first eng sub
\ sa[*:eng|f] = choose eng "forced" sub eg. sign subs only
\ sa[eng:off; *:eng] = choose eng sub only when audio track is not eng */
\
\ lavd="l3 d1", /* d0=ordered dithering, d1=random dithering.
\ Needed for 10 bit videos since DSS2 downconverts to 8-bit - doh!
\ Verified with "gradient_1920-1080_0-25_yuv420p10_x265.mp4" on github */
\
\ lavf_path="C:\Program Files (x86)\K-Lite Codec Pack\Filters\LAV64" )


try {
audio = DirectShowSource(source,
\
\ video=false,
\
\ audio=true /* Make audio track selection rules through the LAV Splitter tray icon, eg.
\ type "eng" in audio field, and choose "prefer stream with highest quality"
\ if needed eg. when there are multiple eng tracks. Note: there will be
\ multiple instances of LAV splitters in the tray if using MPC-HC, so make
\ sure to identify the correct one belonging to DirectShowSource().
\ On my system it's coloured differently to the MPC-HC instance. */
\ )

AudioDub(video, audio)
EnsureVBRMP3Sync() /* Needed for audio sync in some files */
}
catch (noAudio) { video }


Bonus: for NTSC soft telecine files like DVD remuxes, use DSS2(fps=59.940).SelectEven() which should
produce 30p 1:1:1:2 cadence like you would normally get out of TFM for hard telecine files, then you can
TDecimate() the 1 in 5 to 24p as usual.

:thanks:


edit: tip - make sure to check and understand all the LAV audio decoder settings (via the system tray icon). Especially "normalize matrix" should be turned on when Directshow LAV is downmixing surround to stereo to avoid clipping and then Normalise() in Avisynth afterwards to regain lost volume caused by LAV's downmixing.

hello_hello
28th February 2026, 18:18
flossy_cake,

This isn't DirectShow related, but if you don't mind encoding the audio separately, foobar2000 can be a good option for downmixing and re-encoding.
It can open most file types, but there's also a 32 bit AVS plugin for the 32 bit foobar2000 (which means you need to have 32 bit Avisynth installed) so you can downmix in Avisynth and then scan the output of the script to check the peak level.

The audio in this example was opened in a script with FFMS2 (although DirectShowSource should work just as well). It's from a 45 minute episode of a TV show. As you can see at the bottom of the scan result window, it took FB2K about 7.5 seconds to scan the script output. Reducing the volume by 2dB in the script was enough to prevent clipping.

# Downmixing 5.1ch

KillVideo() # FB2k will likely crash if the script outputs video.

Audio = last.ConvertAudioToFloat()

FL = GetChannel(Audio, 1)
FR = GetChannel(Audio, 2)
FC = GetChannel(Audio, 3)
LFE = GetChannel(Audio, 4) # Not included in downmix
SL = GetChannel(Audio, 5)
SR = GetChannel(Audio, 6)

FrontGain = 1.0
CentreGain = 0.7079457
SurroundGain = 0.7079457

# Mix Front Left/Right & Surround Left/Right

FL_SL = MixAudio(FL, SL, FrontGain, SurroundGain)
FR_SR = MixAudio(FR, SR, FrontGain, SurroundGain)

# Add Centre

Left = MixAudio(FL_SL, FC, 1.0, CentreGain)
Right = MixAudio(FR_SR, FC, 1.0, CentreGain)

# Merge channels

Stereo = MergeChannels(Left, Right)

# Adjust volume if necessary

Stereo = Stereo.AmplifydB(-2)

return Stereo

https://i.imgur.com/K04zYmk.png

And of course you can use FB2K's converter to convert it.
It took about 15 seconds to convert my 45 minute test script to AAC with QAAC, and this was the result after scanning it.

https://i.imgur.com/ACCmLy3.png

flossy_cake
1st March 2026, 06:54
flossy_cake,

This isn't DirectShow related, but if you don't mind encoding the audio separately, foobar2000 can be a good option for downmixing and re-encoding.

Neat.

And let's not forget Avisynth LAV can downmix too with eg. LwLibavAudioSource(layout="stereo").Normalise(0.98)

99% of my Avisynth usage is for realtime use watching stuff through MPC-HC so I don't usually do any transcoding.

I did have an audio transcoding issue recently where my father's bluray player wouldn't decode DTS from an mkv file (but could from bluray discs) so I had to transcode to AAC and then I found out there are other issues to do with 5.1 layout like AAC defaulting to hexagonal layout or whatever it was, I already forgot what the solution was lol why does it all have to be so technical like this? :devil: