View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
Sebastiii
3rd May 2011, 06:21
Oh, something else i want to test today is adding an option to LAV Audio for audio delay. My TV adds an extra long delay when running on 24p (~around 200ms), and my receiver can only go up to 100ms correction...
I know the existing delay options, in ffdshow and MPC-HC audio switcher, never worked with bitstreaming properly. Lets see if i can make that work. :)
That was one of the main reasons i never even considered using bitstreaming.
Yeah :) it's the definitive option to swith to lav, i have the same delay of you here :)
Thanks again :)
nevcairiel
3rd May 2011, 07:08
WMA is still an issue, its fine if you use LAV Splitter, but if you use the MS splitters it still doesn't work.
That media type looks ok. Did you re-register LAV Audio (and remove and re-add it to the MPC-HC external filter list), so both DirectShow and MPC-HC pick up on the newly added WMA media types?
I tested it with the WM ASF Reader, and it worked fine last night.
nevcairiel
3rd May 2011, 07:59
LAV Audio Decoder didn't connect LAV Splitter in the MP4 sample (E-Ac3)
It doesn't actually detect that its e-ac3. Its a ffmpeg problem, but i'll add the format mapping.
All format descriptions that look like that ( <fourcc> / <hex code> ) are actually undetected formats, but just let me know and i can fix them.
Sebastiii
3rd May 2011, 08:10
Hi nevcairiel,
Is it easy to show up a tray icon with inside LAV AUDIO and LAF Splitter ? it was usefull when application can't have information on splitter, actually i use ffdshow icon to get list of directshow filter and or reclock when i enable it.
I didn't try last Bitstream code but i will do tonight :)
One last addon is audio delay for 24fps movies.
And oh yes :) ordered chapter lol
It's amazing m8 the work you do, thanks.
nevcairiel
3rd May 2011, 08:20
Is it easy to show up a tray icon with inside LAV AUDIO and LAF Splitter ?
Its not hard, but its alot of work. Its something for a much later stage.
Sebastiii
3rd May 2011, 08:34
Its not hard, but its alot of work. Its something for a much later stage.
Ok :) Audio delay will be more cool :)
I have a request, i know that [forced] is here when track is forced.
Is it possible to parse this information like MPC Matroska does ?
If not can you explain why and maybe how does it work ?
Last question, if we can make it and supply a patch for you, are you ok on that ?
It's surely better if you can do on your own :) (for no breaking thing :P)
Thanks again,
Seb.
nevcairiel
3rd May 2011, 09:25
I have no idea what you're talking about, the MPC Matroska Splitter does not parse anything. The only thing it uses is the ITrackInfo interface, but i have not seen any player that actually uses it.
Also, ITrackInfo is rather useless if you use a stream switcher, its only useful for MPC Matroska because it exports all streams as separate pins.
Sebastiii
3rd May 2011, 09:32
Actually, on MPC-HC engine for Mediaportal, cpp2005 get the flag and parse it to MP to know if track is forced or not. Maybe he's using ITrackInfo for that, i will ask him :)
And if yes, it is possible to do the same with LAV right ? :P
I have actually code in MP to look @ streamname and if [Forced] is show, automatly MP select it (for MKV) but it will be better to get it with the same way :).
nevcairiel
3rd May 2011, 09:38
I can add ITrackInfo, but it'll most likely work differently then on the MPC Matroska splitter - because of the before mentioned difference of not creating one pin for every track. :p
Sebastiii
3rd May 2011, 09:57
Thanks you nev :) oh yes effectively MPC has one pin for every track :P
nevcairiel
3rd May 2011, 10:40
There, i implemented ITrackInfo, well, some of the functions anyway. Most of the GetTrackCodec* functions are silly, and will only return NULL in LAV Splitter. :p
GetTrackCount, GetTrackInfo, GetTrackExtendedInfo, GetTrackName and GetTrackCodecName will work now - well as soon as i check the changes in when i get home.
Sebastiii
3rd May 2011, 10:43
Thanks, I think is not good if we have return NULL in LAV :)
nevcairiel
3rd May 2011, 10:51
If someone can't deal with a NULL return, its their damn fault. Its perfectly valid to indicate that there is just no value for this field.
Sebastiii
3rd May 2011, 10:57
There, i implemented ITrackInfo, well, some of the functions anyway. Most of the GetTrackCodec* functions are silly, and will only return NULL in LAV Splitter. :p
GetTrackCount, GetTrackInfo, GetTrackExtendedInfo, GetTrackName and GetTrackCodecName will work now - well as soon as i check the changes in when i get home.
Cool :)
Sebastiii
3rd May 2011, 10:59
If someone can't deal with a NULL return, its their damn fault. Its perfectly valid to indicate that there is just no value for this field.
Ok :) i surely misunderstand you, so all is correct :) nice m8 :)
Mercury_22
3rd May 2011, 11:03
IIRC LAV could detect PGS subtitles language no? But now (Nevcairiel-LAVFSplitter-054fb45) it can't, it only shows PGS!
nevcairiel
3rd May 2011, 11:04
The stream language is independent of the codec used. Anyhow, for m2ts files on Blu-rays, you need to actually open the Blu-ray (index.bdmv or a .mpls file) for languages to be detected. The language is not contained in the m2ts, its in the special Blu-ray files.
That media type looks ok. Did you re-register LAV Audio (and remove and re-add it to the MPC-HC external filter list), so both DirectShow and MPC-HC pick up on the newly added WMA media types?
I tested it with the WM ASF Reader, and it worked fine last night.
Ok, I will do some more testing, I did a complete unreg/reg and clear registry. I didn't set LAV Audio in MPC as preferred, but blocked the WM Audio DMO and ffdshow Audio filters.
Could anyone upload a x64 build as well, so I can test if its maybe x86 that's bit broken on my side?
Thanks
Mercury_22
3rd May 2011, 11:33
The stream language is independent of the codec used. Anyhow, for m2ts files on Blu-rays, you need to actually open the Blu-ray (index.bdmv or a .mpls file) for languages to be detected. The language is not contained in the m2ts, its in the special Blu-ray files.
But MPC-HC's internal splitter it's working with m2ts files too :confused:
The language code is most of the time contained also in the .M2TS file. But not all of the time. Like Nev mentioned, for 100% reliability you should open the correct playlist file.
Cheers,
-jj-
nevcairiel
3rd May 2011, 12:14
m2ts on Blu-rays typically don't contain the language code at all, at least on the discs i tested with. If it did, it would show there.
Anyhow, the MPC-HC splitter reads that info from the playlist/clip info files, so does LAV Splitter - but only if you open the playlist.
I don't see the use for adding hacks to make it load the clip infos if you directly open the .m2ts, you're supposed to run the playlist, only then it can ensure 100% proper playback.
madshi
3rd May 2011, 12:30
Anyhow, the MPC-HC splitter reads that info from the playlist/clip info files, so does LAV Splitter - but only if you open the playlist.
I don't see the use for adding hacks to make it load the clip infos if you directly open the .m2ts, you're supposed to run the playlist, only then it can ensure 100% proper playback.
For every m2ts file there's a matching clipinfo file and the languages are contained in the clipinfo file, too. eac3to reads the language information from the clipinfo file. It uses the playlist file only for finding out which m2ts files "belong together".
nevcairiel
3rd May 2011, 12:34
The main problem is that the default operation mode for LAV Splitter is now to not open files directly, but let the default "File Source (Async)" open the file. The exception from this rule is Blu-ray playback, because there it is required to open multiple files.
Due to not handling File IO myself, i don't even know the file name, or where it is, so i cannot try to assume its a Blu-ray file and try to find a clipinfo in a BDMV structure.
I know where the language info is, all i'm saying is that its not worth the effort to find it if you're opening the m2ts directly, rather then going through the Blu-ray handling. Especially because behavior would be inconsistent, depending if you're going through The LAV source filter, or the File Source and only using LAV for splitting.
If anyone so desperately needs this to function, it shouldn't be that much work, and can probably be done in a day or so - you're welcome to supply patches. :)
madshi
3rd May 2011, 12:56
It would be pretty easy to call the upstream filter's "IFileSourceFilter::GetCurFile()" method (madVR does that, too, no problems at all) and from there to find the clipinfo file. Personally, I don't really care if this feature gets implemented or not. Just saying that it'd be pretty easy to do.
nevcairiel
3rd May 2011, 12:59
Yeah its easy, just figure out the path, check if there is something like BDMV/STREAM in the path, and if so get the proper clipinfo file and feed it through libblurays clpi parser.
Since there is only me thats know the code, i increased my time estimation to a day - which then includes some learning phase. :D
I can surely put it on my list of things to do, but it will not be anywhere high up.
Couldn't you just query the filename info from the (third party) source filter? I know that ffdshow does that as well for some functionality like settings profiles.
Good to know that a tray icon is now a possible future addition. It is essential for players that do not have their own stream selection functionality. For example WMP only allows selecting audio, not video/subs. And even with MPC-HC its useful for those who are used to configuring stuff though the tray icons of the various active filters.
nevcairiel
3rd May 2011, 13:05
Since i'm currently sitting at work being bored a bit, i will actually give it a shot right now.. i have some test blu-ray structure around here somewhere..
madshi
3rd May 2011, 13:13
Great!
@clsid, the madVR tray icon includes stream switching, if the splitter exposes the necessary interfaces (which LAV Splitter does). So for anyone in need of stream switching via tray icon, just use madVR... :D
@clsid <--- Kindly add support for LAV Filter and LAV CUVID in Win7DSFilterTweaker. Thanks!
nevcairiel
3rd May 2011, 14:21
I suppose considering the short break i took in between, it really did only take one hour. Oh well, new feature!
Also nearly time to go home now, off doign some real work for a change. :p
SamuriHL
3rd May 2011, 14:23
ROFLMAO! Thanks, Nev. :)
CruNcher
3rd May 2011, 14:25
If the implementation of ffmpegs parser core continues @ this pace in no time MPC-HCs own core could be replaced :) and hopefully all MPC-HC splitter devs move on to improve lav splitter then abandoning the old native ones ;) if someone like the potplayer guy would join in and provide his skining expertise (instead of doing his own thing) and a designer like jinsk8r his interface ideas jesus and ofcourse madshis renderer with DXVA support on top and Jans Shader work somehow combining those would also be awesome currently they contradict EVR vs Madshi (efficient Realtime enhancement) ;)
madshi
3rd May 2011, 14:26
I suppose considering the short break i took in between, it really did only take one hour. Oh well, new feature!
:D :thanks:
Sven75
3rd May 2011, 14:30
This is my first post here, but I have been following this thread for some time now and I must say that I am very impressed by the progress that has been made and very thankful for this great piece of software!
Anyway, I have quite a few issues and questions but I will start with this clip here:
http://www.mediafire.com/?9p628p3yx7b3a6o
It is a very short Canopus DVC-Pro HD (CDVH) file (just as an example).
So far I have only found this specific DSFilter which can playback the clip:
http://www.mediafire.com/?bv82gz7n9754dz9
Right now, when using LAVSplitter it crashes Graphstudio, PowerPoint, etc. Current ffPlay is semi working and at least does not crash. Using the simple AVISplitter from quartz.dll it works as expected.
Nev, maybe you can have a look and maybe there is something you can do about it. Would be very much appreciated!
I know it is a fairly old format and not very common but as I am working in the medical congress field I get such old formats all the time and have to deal with it (in PowerPoint btw and without time to simply convert them to a different format).
FYI, I am on Win7 64 Bit and unfortunately I have to use the standard audio/video renderers as otherwise PowerPoint will have even more problems with playing videos.
nevcairiel
3rd May 2011, 15:52
I fixed the crash with that DV video sample, thanks for reporting!
If you encountered any other bugs, just let me know.
Sven75
3rd May 2011, 16:04
Great - thanks a lot! I will glady report the other issues I find. One problem is though that a lot of the issues only occur in PowerPoint (especially 2010 is very picky) while Graphstudio and other players work flawlessly. This may or may not be PowerPoint's fault - but if it is, I can at least try to officially report a bug to MS.
Do you happen to have PowerPoint or the free viewer on one of your computers?
nevcairiel
3rd May 2011, 16:05
I have PowerPoint, but only 2007.
jidelite
3rd May 2011, 16:44
nevcairiel, like so many other I've been following your LAV filter work and wanted to say thank you! I was testing the LAV Audio bitstream capabilities with my GTS450 and my AVR says everything works as reported by others. I did have a question regarding the audio information supplied by LAV Splitter and Audio - when I play a 7.1 DTS-HD movie with MPC-HC (i.e. Tron Legacy) the Splitter says its a 5.1 movie (and the Kb/s are off) and the LAV AUDIO status tab says the number of channels is 6.
Is this the same kind of anomaly we get with ffdshow (I think I read your bitstreaming code is basically the same)?
jidelite
nevcairiel
3rd May 2011, 16:45
My bitstream code has nothing in common with ffdshow.
Anyhow, its currently not possible to figure out what exactly is in the DTS-HD frames, so it'll be limited to showing 6 channels. Not to worry, however, that does not influence bitstreaming at all!
SamuriHL
3rd May 2011, 16:48
Right, no one can parse the DTS-HD MA information, so, the information displayed isn't accurate.
jidelite
3rd May 2011, 16:52
My bitstream code has nothing in common with ffdshow.
Anyhow, its currently not possible to figure out what exactly is in the DTS-HD frames, so it'll be limited to showing 6 channels. Not to worry, however, that does not influence bitstreaming at all!
Right, no one can parse the DTS-HD MA information, so, the information displayed isn't accurate.
Cool, Thanks guys :)!
jidleite
CruNcher
3rd May 2011, 17:21
nev do you know if the libav/ffmpeg latm decoder supports error resilience ?
madshi
3rd May 2011, 17:23
its currently not possible to figure out what exactly is in the DTS-HD frames
Right, no one can parse the DTS-HD MA information
Not true. eac3to can parse DTS-HD frames just fine. You can check out the BDInfo source code which was written based on information I provided. It's not as complete as what eac3to is doing, but it's good enough to extract the key information from DTS-HD streams.
nevcairiel
3rd May 2011, 17:28
I didn't mean it was "impossible" in general, just not with the tools i use, that is ffmpeg. :p
Its not like i really care, i just let ffmpeg figure out whats in there, and show what it tells me. The information is not crucial - a decoder capable of DTS-HD will figure it out from the bitstream, and bitstreaming does not pass that information anyway.
I don't feel like writing a parser for DTS-HD just for a display issue... :)
n3w813
3rd May 2011, 17:29
I'm having a weird issue with bitstreaming....
When I first play a video with DTS-MA, it bitstreams fine to my AVR. Right after when I try to play a video with just regular DTS, it tries to bitstream it as a DTS-MA track to my AVR (shows DTS Master Audio on the unit instead of DTS) and no sound comes out.
Can anyone else confirm this issue?
Thanks :)
nevcairiel
3rd May 2011, 17:33
When I first play a video with DTS-MA, it bitstreams fine to my AVR. Right after when I try to play a video with just regular DTS, it tries to bitstream it as a DTS-MA track to my AVR (shows DTS Master Audio on the unit instead of DTS) and no sound comes out.
You have a stupid AVR then.
What i do when DTS-HD is activated, i pack every DTS into the DTS-HD wrapper (which is perfectly valid). This is even required for some sorts of DTS-ES, which would otherwise be lost, and just parsed as normal DTS - like it happens with ffdshow.
There are many types of DTS, and all are allowed to be wrapped into a DTS Type 4 (DTS-HD) package for HDMI transmission.
What happens if you play something else in between?
CruNcher
3rd May 2011, 17:38
No audio http://www.mediafire.com/?1a9t7bnijxya48q
With cyb*** audio demuxer their is 8 seconds audio @ the end
PS: Lav Splitter + DivX AAC (Rovi/Mainconcept) works
n3w813
3rd May 2011, 17:41
You have a stupid AVR then.
What i do when DTS-HD is activated, i pack every DTS into the DTS-HD wrapper (which is perfectly valid). This is even required for some sorts of DTS-ES, which would otherwise be lost, and just parsed as normal DTS - like it happens with ffdshow.
There are many types of DTS, and all are allowed to be wrapped into a DTS Type 4 (DTS-HD) package for HDMI transmission.
What happens if you play something else in between?
Not sure, when I get home tonight, I'll try playing a DD track in between and see what happens.
My AVR is a Harman Kardon AVR254, shouldn't be that dumb right? :rolleyes: I'll check to see if they have any firmware updates for the unit.
nevcairiel
3rd May 2011, 17:45
Just to make sure, with DTS-HD unchecked, it worked, right?
Which audio renderer are you using? If you're not using it already, try with ReClock - if you are, try without. :p
Also, NVIDIA or AMD? Which driver?
If all else fails, i can add some simple detection if there are HD frames in the stream, and if not fallback to "normal" DTS - and make that optional for people where its required.
nevcairiel
3rd May 2011, 18:11
@CruNcher:
You test all the weird MPEG-TS files - do you still have some H264 files that do NOT work when "Video Stream Parsing" is OFF?
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.