View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
Klaus1189
29th August 2022, 16:51
I think I found new introduced typos: https://github.com/Nevcairiel/LAVFilters/commit/8e16215de51b5e15928512f877de9e4c4d074277
It is designed to offer the ability to take over the graph-building process from the player`s side.
It only exports one function which LAV Splitter will call when a stream change happens on the user`s requests
To be more precise, not simple typos but the Acute accent (https://en.wikipedia.org/wiki/Acute_accent) should not be used as Apostroph (https://de.wikipedia.org/wiki/Apostroph)
wrong:player`s
right: player's
wrong:user`s
right:user's
Klaus1189
29th August 2022, 16:58
I just corrected it here:
https://github.com/Nevcairiel/LAVFilters/pull/512
clsid
29th August 2022, 17:32
I thought installing this would make thumbnails show up for x265 10b .mkv files :/
In Codec Tweak Tool all things are selected for thumnails.
How to do it? Win11.No, LAV Filters is not used at all for thumbnails. You need to install Icaros (https://www.majorgeeks.com/files/details/icaros_beta.html).
LigH
30th August 2022, 09:49
Thanks, just last week I tried to remember its name... :o
filler56789
30th August 2022, 13:28
To be more precise, not simple typos but the Acute accent (https://en.wikipedia.org/wiki/Acute_accent) should not be used as Apostroph (https://de.wikipedia.org/wiki/Apostroph)
wrong:player`s
right: player's
wrong:user`s
right:user's
You meant GRAVE accent (https://en.wikipedia.org/wiki/Grave_accent) alright :)
But you are right, neither of them is a replacement for the apostroph.
Balling
4th September 2022, 08:18
I don't think you really get it at all.
Its not about there being random mentions of 4:4:4 (without context, without further information which profiles are supported, for which codecs, etc), but the absolute lack of clear information what is actually supported. The feature matrix does not mention 4:4:4 at all, in fact it lists a bunch of profiles that are all 4:2:0. Some other feature pages list 4:4:4, some qualify that to lossless, some don't elaborate at all. Its a messy situation, and one I do not want anything to do with.
I specifically wrote it all on wikipedia. For avc only 444 predictive can be lossless, high is not lossless. Nvidia does not support 10 bit avc anyway.
Balling
4th September 2022, 08:20
No point doing 4:4:4 when even Blu-ray is 4:2:0. All U R doing is WA$TING CPU & file size = LOL!!
Quote: "Blu-ray and UHD Blu-ray both store the video signal in the 4:2:0 format."
You will never get 444 Blu-rays (RGB Blu-ray more like it) if there is no support. Why do you think nvidia added lossless RGB and YCbCr 444 nvenc hevc? And, anyway, cameras from Panasonic, Leica and Nikon Z9 do lossless in some cases (Nikon) bayered N-RAW, true RAW, that is only supported by Red as it is covered by their patents (above 24p). Davinci uses lossless hevc decoder in nvidia. Does not use ffmpeg, cause 3 or 4 bugs are not present there.
Look at this nutjob samples, XAVC 444, maybe even lossless: https://trac.ffmpeg.org/ticket/9898#comment:13
Balling
4th September 2022, 08:28
So when atmos open source decoder? https://github.com/VoidXH/Cavern
Brownian motion: https://photos.app.goo.gl/biAubMWnT8AM18Xm6
Balling
4th September 2022, 15:16
' All the 'RAW' stuff is silly because if U simply set up the camera or whatever 2 save things in a natural-looking way with the 'correct gamma curve & saturation' & stuff in the first place, when U shoot, then U don't need 2 WA$TE all that data & 'extra resolution' trying 2 keep 'everything' instead of just what U will actually NOTICE! =)
About your black comments: eye is adapted to black outside. Try walking in the dark with your phone on. It is very not nice, but I do it often. Black is more prominant in the closed space. It is also scene referred: black just means camera 20 stops cannot quite get it. The N-RAW video that is truely patented by Red >24 fps and Red is suing Nikon for it: https://forum.grassvalley.com/forum/editors/editing-with-edius/572094-n-raw-from-z9-sample-download
Open it in Davinci. You will be shocked if you render it to BT.2020 PQ HDR. Believe me. Red is not suing them for nothing, 8256x4644x50fps.
max79
4th September 2022, 19:39
MPC-BE Menu > Play > Filters
It is probably using "File Source (URL)", which may be caching the whole file before playback starts.
You can edit this registry key to change the source filter:
HKEY_CLASSES_ROOT\ftp
LAV = {B98D13E7-55DB-4385-A33D-09FD1BA26338}
Hello,
is the any way starting to play such URLs in "LAVSplitterSource":
ftp ://MyPassword@SiteName.com/FolderName/FileName.mp3
At this moment works only URLs like this:
ftp ://SiteName.com/FolderName/FileName.mp3
filler56789
4th September 2022, 22:26
Hello,
is the any way starting to play such URLs in "LAVSplitterSource":
ftp ://MyPassword@SiteName.com/FolderName/FileName.mp3
AFAIR the "syntax" of that command is incorrect, or rather, incomplete;
try this one instead:
protocol://username:password@SiteName.domain/directory/filename.MP3
filler56789
4th September 2022, 22:43
<OFF-TOPIC>
Maybe a moderator should clean this thread AND the ffdshow topic too by deleting some posts AND doing some additional "moderator magick" as well :-/
</OFF-TOPIC>
max79
5th September 2022, 08:48
try this one instead:
protocol://username:password@SiteName.domain/directory/filename.MP3
This is it! Thank you very much for your help. Works!:goodpost:
tormento
6th September 2022, 21:49
No point doing 4:4:4 when even Blu-ray is 4:2:0. All U R doing is WA$TING CPU & file size = LOL!!
So many words, without even knowing the reason I asked 444 support for... kek...
tormento
6th September 2022, 21:50
Why do you think nvidia added lossless RGB and YCbCr 444 nvenc hevc?
I am actually using lossless HEVC as intermediate files, now that I have proper HW decoding in AVS too.
Let him throw his time. If only we could have a forum option to hide his posts.
Balling
24th September 2022, 13:12
So when atmos open source decoder? https://github.com/VoidXH/Cavern
Brownian motion: https://photos.app.goo.gl/biAubMWnT8AM18Xm6
Nev? Will it be in Lav? I opened and asked to fix 12 bugs in Cavern, I think it is more or less ready.
lvqcl
24th September 2022, 13:37
Will it be in ffmpeg?
Because LAV Filters use ffmpeg for decoding.
Balling
28th September 2022, 23:44
Will it be in ffmpeg?
Because LAV Filters use ffmpeg for decoding.
https://github.com/FFmpeg/FFmpeg/search?q=Hendrik+Leppkes&type=commits
https://github.com/FFmpeg/FFmpeg/search?q=Nevcairiel&type=commits
I am just saying.
flossy_cake
29th September 2022, 06:59
For LAV Video decoder, what do the "deinterlacing mode" and "field order" settings actually do?
I've thrown a ton of videos at various combination of those 2 settings and they never seem to actually do anything.
The only video file I have managed to see a difference with is a 1080p25 file that is incorrectly flagged as progressive and actually contains 1080i25 @ 1:1 cadence. With this particular file, DXVA deinterlacing won't work unless I set LAV to "deinterlacing mode: force" and "field order: top field first". This is with MadVR as the renderer, and MadVR set to enable DXVA deinterlacing via file tag [deint=video].
Am I correct in assuming that those 2 LAV deint settings just set some flags in the decoded video stream which the renderer or DXVA is looking at and making decisions based on those flags? i.e LAV doesn't actually modify the video frames in any way? (I have LAV's "software deint" disabled btw).
This seems relevant but doesn't really answer my question:
Let me explain how things are from the view point of a video renderer. The renderer must deal with a wide number of decoders and they all behave differently. Some decoders always set interlaced flags, others never set interlaced flags, again others set them sometimes and sometimes not, depending on user configuration (and the user doesn't always know what he's doing), or depending on the weather or the configuration of the planets. There are typically 2 things that I've seen decoders do:
(1) Either the decoder sets the interlaced flags to 0. If that happens, madVR doesn't know if that is supposed to mean "this file is progressive", or if the decoder is not in the mood to share information, because 0 is also the non-initialized value used by all decoders which never properly fill in these values (like CoreAVC).
(2) Or the decoder sets the flags to "AMINTERLACE_DisplayModeBobOrWeave". Again, this information is more or less useless, because by definition is means "the stream could be totally progressive, or totally interlaced, or a mixture of both". In other words, by setting "AMINTERLACE_DisplayModeBobOrWeave", the decoder pretty much says: "I've no idea whether this file is interlaced or progressive or whatever".
Even though all of the above is quite bad, madVR *still* tries to behave identical to VMR/EVR, which means that if the interlace flags are set to 0, madVR will by default not activate deinterlacing, and if the flags are set to "AMINTERLACE_DisplayModeBobOrWeave", madVR will by default activate deinterlacing, but only after the first interlaced video frame is received. I don't consider this behaviour really alright, but since VMR/EVR are doing it this way, I'm trying to have madVR behave identical.
There is one thing that makes madVR's behaviour different from VMR/EVR: While VMR/EVR always blindly trust the decoder (and thus will stumble when decoders don't set the flags correctly, or not at all), madVR gets itself access to the video bitstream to make its own analyzation of whether deinterlacing is needed or not. If the video bitstream clearly says whether deinterlacing is necessary or not, madVR will value this information higher than the rather non-specific flags described above. I believe this is a good thing, and I challenge anyone to argue otherwise.
If LAV wants to force deinterlacing to on/off, it's easy enough to do that with madVR. There are interlace flags available for that, described by Microsoft, which madVR properly honors. "AMINTERLACE_DisplayModeBobOnly" asks for the whole video stream (every frame) to be deinterlaced, so that would be the correct flag to set to force the renderer to turn deinterlacing on. And "AMINTERLACE_DisplayModeWeaveOnly" asks for the whole video stream to not be deinterlaced, so that would be a good flag to set to force the renderer to turn deinterlacing off. If LAV used these flags, madVR would obey. madVR has supported these flags from the first version deinterlacing was introduced.
nevcairiel
29th September 2022, 10:16
The settings just influence the metadata, indeed. Of course if LAV itself were to deinterlace, it would also obey them. madshi's stance to play fast and loose with the metadata provided by the decoder is not something I care for, and if i set the interlaced flag to 0, I would expect a renderer to act accordingly.
flossy_cake
1st October 2022, 04:44
Is there any chance of considering a filename tagging scheme similar to MadVR so we can turn LAV features on for certain files/folders. eg. [SoftDeint=bwdif], [FieldOrder=tff], [DeintMode=force]. I'd like to use software deint on some problematic files that don't work very well with DXVA deint and MadVR's ivtc. And maybe turn off DXVA2 decoding for certain files as well. Having to manually change the setting through the GUI every time we watch an episode of some show is kind of a dealbreaker.
nevcairiel
1st October 2022, 09:39
There are no plans for that. LAV is primarily designed to be used by player software, those can control the configuration, and in theory also support per-file overrides.
Manni
1st October 2022, 14:40
Is there any chance of considering a filename tagging scheme similar to MadVR so we can turn LAV features on for certain files/folders. eg. [SoftDeint=bwdif], [FieldOrder=tff], [DeintMode=force]. I'd like to use software deint on some problematic files that don't work very well with DXVA deint and MadVR's ivtc. And maybe turn off DXVA2 decoding for certain files as well. Having to manually change the setting through the GUI every time we watch an episode of some show is kind of a dealbreaker.
You can easily export LAV registry with each settings and put them (or a shortcut) on the desktop or call them from a batch file. This means that you only have to click on a file to swap settings. I had to do this to switch between audio passthrough and LPCM. Better than accessing LAV config each time.
flossy_cake
1st October 2022, 21:20
You can easily export LAV registry with each settings and put them (or a shortcut) on the desktop or call them from a batch file. This means that you only have to click on a file to swap settings. I had to do this to switch between audio passthrough and LPCM. Better than accessing LAV config each time.
Thank you, but the HTPC has to be usable by the average person in our household and they won't remember to click some batch file for certain shows. All they can do is open Kodi , browse for the file and then launch it (which opens with MPC-HC). Perhaps I could configure Kodi to launch batch files or something? But then every single file in the video library would have to be a batch file otherwise it would use whatever settings were applied by the last batch file.
Manni
1st October 2022, 22:51
Thank you, but the HTPC has to be usable by the average person in our household and they won't remember to click some batch file for certain shows. All they can do is open Kodi , browse for the file and then launch it (which opens with MPC-HC). Perhaps I could configure Kodi to launch batch files or something? But then every single file in the video library would have to be a batch file otherwise it would use whatever settings were applied by the last batch file.
I used MCE controller to assign a batch file to a button on my iPad control with iRule when I needed this, it worked well. Event Ghost works well too for this. Of course it's not ideal, but it's easier to ask the user to press on a button than to tell you go into LAV control panel and select the right option.
flossy_cake
1st October 2022, 23:12
I used MCE controller to assign a batch file to a button on my iPad control with iRule when I needed this, it worked well. Event Ghost works well too for this. Of course it's not ideal, but it's easier to ask the user to press on a button than to tell you go into LAV control panel and select the right option.
I really appreciate your suggestions, it's just that having to remember to manually intervene on certain files isn't practical enough.
I was thinking, if there was some way to apply LAV settings through the registry while LAV is running, it may be possible to implement a scripted solution which eg. detects when mpc-hc64.exe is running, gets the currently playing filename from mpc's window title, and then applies the custom LAV settings through registry. But I don't think those setting would apply until the next time LAV launches. Perhaps it could be scripted to re-launch MPC & LAV, but then Kodi will see MPC has closed and will exit back to its GUI. And the whole thing is just super convoluted.
edit: I've since learned that LAV's deinterlacing settings can be applied per-file by using an avisynth script, eg.
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64\LSMASHSource.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64\BWDIF.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64\yadifmod2.dll")
file = "c:\myvideo.mkv"
audiotrack = -1 # -1 = first track
video = LWLibavVideoSource(source=file, cache=false)
IsInt(audiotrack) ? AudioDub(video, LWLibavAudioSource(source=file, stream_index=audiotrack, cache=false)) : video
BWDIF(field=-2)
# yadifmod2(mode=1)
# save as eg. myvideo.avs and open with MPC-HC
Thunderbolt8
5th October 2022, 11:54
for a TV broadcast with 5.1 AC3 track LAV shows the info "5.1(side)"
what does this "side" here mean?
huhn
5th October 2022, 12:22
there are 2 5.1 (maybe more i know 2) one where the "rear" speaker are "behind" you and one where they are to the "sides" like 7.1 missing the rear speakers.
this file is mastered for side speaker. it knows this form meta data 2 or 4 hexa values or something like that.
Thunderbolt8
5th October 2022, 16:05
hm is this a specialty of AC3, compared to DTS? because e.g. in DTS master suite theres only 1 configuration for 5.1 tracks (Ls, Rs)
nevcairiel
5th October 2022, 17:20
Both Dolby and DTS define a whole list of speaker positions and their naming.
These are the DTS names for channels, and their speaker position according to the DTS specification (degrees relative to your nose when looking at the screen)
Ls/Rs: Left/Right surround, 110 degrees
Lsr/Rsr: Left/Right surround rear, 150 degrees
Lss/Rss: Left/Right surround side, 90 degrees
Lw/Rw: Left/Right wide, 60 degrees
Typically, in 5.1 you'll find Ls/Rs being used (thats what the "side" layout in FFmpeg uses, its named after the WAVE specification which uses plain rear and side names), in older formats the Lsr/Rsr are used sometimes (thats the plain 5.1 in ffmpeg).
In 7.1, its typically both Ls/Rs and Lsr/Rsr, but that can vary.
Dolby defines the channel similarly, but not necessarily with equal angles etc.
Thunderbolt8
5th October 2022, 17:30
so the (side) Ls/Rs setup is the common one nowadays? and so the track is not a rather a-typical one? would it sound strange if your setup is rather rear/behind when you play this "side" track or would it sound as it is supposed to be?
huhn
5th October 2022, 18:48
if you want it to sound as it is intended you theoretical need to change the speaker setup in that case.
with bit streaming your AVR my even be remixing to move them ever so slightly if it knows your speaker position.
i suggest you to just ignore it. it's a spec that is hard to follow.
maybe there are now audio renderer where you can specify your setup but i don't know that.
even if your setup is "incorrect" it will not sound terrible.
tebasuna51
6th October 2022, 12:09
Standard channel layouts:
...
5.1 FL+FR+FC+LFE+BL+BR standard in XX Century (decoded from Ls-Rs in AC3,DTS,...)
5.1(side) FL+FR+FC+LFE+SL+SR standard in XXI Century (decoded from Ls-Rs in AC3,DTS,...)
...
Read also https://mediaarea.net/AudioChannelLayout to understand different names for channels
An AVR 5.1 send to Surround speakers (Ls-Rs 110-120º) both channels SL-SR 90º (Lss-Rss) and BL-BR 150º (Lb-Rb)
flossy_cake
23rd October 2022, 19:48
In LAV Video if I set Deinterlacing Mode to Auto, does this mean my selected Software deinterlacer will only be activated if the stream has interlace flags? And is this 100% reliable in terms of avoiding false positives -- i.e could some progressive sources be accidentally detected as interlaced and therefore have software deinterlacing applied to them which would needlessly degrade the progressive image?
el Filou
24th October 2022, 13:10
Yes; and no.
As the tooltip says, 'Auto' uses frame flags to decide.
If a progressive stream is incorrectly flagged as interlaced frames, it will be passed through the chosen software deinterlacer.
flossy_cake
1st November 2022, 09:34
Thanks.
Sorry if this is a silly question but is there an arg I can pass to LAV Splitter to tell it to select a particular subtitle track? I know I can pass it eg. "eng" to select the English track, but I have multiple English tracks, eg. track 2 is an English commentary track. Is there some arg I can pass to tell it "track 2"?
I have read the readme here (https://github.com/Nevcairiel/LAVFilters/blob/master/README.txt) but it doesn't seem to cover such a scenario.
In case you're wondering why don't I just use MPC-HC's built in subtitle selector or LAV Splitter's tray icon...the answer is that I'm calling LAV Splitter from Avisynth via DSS2() (http://avisynth.nl/index.php/DSS2mod#Syntax_and_Parameters) and I am trying to pass it arguments for subtitle track selection so that I don't have to manually set it every time I open the .avs file.
edit: code sample
video = dss2(sourcefile, subsm=2, lavs="l3 vc2 sm3 sl[] sa[eng] es0 ti1", lavf_path="C:\Program Files (x86)\K-Lite Codec Pack\Filters\LAV64")
audio = directshowsource(sourcefile, video=false, audio=true)
AudioDub(video, audio)
Sunspark
2nd November 2022, 04:24
The only way I know of is via using the @ operator.
eng@SDH eng@ass both work.. I don't have commentary tracks so I can't see how they're labelled on your side, but eng@commentary or whatever is in the square brackets should work.
flossy_cake
2nd November 2022, 11:35
The only way I know of is via using the @ operator.
eng@SDH eng@ass both work.. I don't have commentary tracks so I can't see how they're labelled on your side, but eng@commentary or whatever is in the square brackets should work.
Thank you, it works:
https://i.ibb.co/nDHhtJR/subs.png
flossy_cake
6th November 2022, 01:13
I was wondering about how LAV Video handles the "repeat flags" for "soft telecined" NTSC DVD MPEG2 streams.
From what I can tell the MPEG2 stream on the disc is stored as 24p but contains some "repeat flags" to tell the player when to repeat frames/fields to make it come out as 60hz 3:2 pattern.
This makes sense but how does LAV handle it exactly -- is it creating repeat FIELDS or FRAMES? Does it assume 60hz in its calculation for repeating these fields/frames?
I noticed when playing such material on 120hz display, I still have 3:2 judder even though 24 goes 5:5 into 120. From this I'm inferring that LAV Decoder must be assuming the repeat flags are intended for 60hz display -- is that codified in the MPEG2 spec or does LAV make the decision about the timing of the repeat flags?
edit: after some more testing it seems LAV uses the repeat flags to convert it to 60p. The LAV settings GUI doesn't seem to offer an option to not perform this conversion and just output it as 24p.
edit: a 60i option would be nice too as there are some edge cases where that can be beneficial.
nevcairiel
6th November 2022, 10:29
LAV does not repeat fields on its own. It forwards the metadata to the renderer, which can decide to repeat frames, or not to.
huhn
7th November 2022, 08:14
as far as i know the Microsoft decoder is outputting soft telecine as hard telecine and the lav is not so you have to disable the Microsoft decoder to get soft telecine.
and if i remember correctly the microsoft decoder is used by default when a normal dvd is loaded to make menus work.
nevcairiel
10th November 2022, 17:29
LAV Filters 0.77
LAV Splitter
- Fixed: Improved handling of multichannel PCM channel assignments
- Fixed: MP4 Keyframe information could be wrong
LAV Audio
- NEW: Support for audio with more then 8 channel, including automatic downmixing if required
Download: Installer (both x86/x64) (https://files.1f0.de/lavf/LAVFilters-0.77.exe) -- Zips: 32-bit (https://files.1f0.de/lavf/LAVFilters-0.77.zip) & 64-bit (https://files.1f0.de/lavf/LAVFilters-0.77-x64.zip)
Nothing much to say for this one. Lots of under-the-hood changes in FFmpeg, bugfixes, speedups, etc. dav1d was updated for faster AV1 decoding.
Thats it. Short and sweet.
Manni
10th November 2022, 18:26
Thanks for all your work :)
ryrynz
10th November 2022, 20:05
Stellar as always.
SeeMoreDigital
10th November 2022, 21:13
I wonder if someone can help...
I've managed to configure LAV Filters to parse every audio format with MPC-BE 1.6.4. except LPCM.wav files!
What do I need to do?
chros
11th November 2022, 11:40
Thanks Nev!
tebasuna51
11th November 2022, 11:57
LAV Filters 0.77
[CODE]
LAV Splitter
- Fixed: Improved handling of multichannel PCM channel assignments
...
Many thanks!
AYColumbia
14th November 2022, 03:34
Thanks very much. :)
Mercury_22
11th December 2022, 23:08
@Nev
Strange thing happens when playing a YouTube clip: audio ends 20s - 60s before video ends, which doesn't happen when using MPC-BE's internal splitter
clsid
11th December 2022, 23:41
Working fine here. So if it happens with all files/streams, the problem is at your end.
If problem only happens with certain files/stream, you need to give a link to an example.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.