View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
pankov
23rd October 2012, 09:27
Sadly,
I don't know how to make MPC-HC open images - I've added the DC Image Source as preferred external filter but it still says "Cannot render the file".
So I opened it in GraphStudioNext and this is the result
http://imageshack.us/a/img845/2882/dcimagesourcemadvr.png (http://imageshack.us/photo/my-images/845/dcimagesourcemadvr.png/)
So as usually you are right - it's MEDIASUBTYPE_RGB32
:(
Also madVR's OSD in Zoom Player says "RGB32, 8 bit, RGB"
Sorry,
I was just trying to help
madshi
23rd October 2012, 09:36
No worries, I'm hopeful nevcairiel will find a solution for LAV.
nevcairiel
23rd October 2012, 09:44
Finding a solution is not the problem. :)
I will teach LAV Video to internally handle and output RGB48 and RGB64 without conversion.
The only remaining question is how the source filter should handle such still images. As mentioned before, i could make it output the same frame multiple times to emulate a virtual movie of sorts, because some filters just have issues with a single frame (apparently, including madVR). I could easily add two options to configure fps and duration of the fake stream, or just hardcode some values (less options are better). Maybe just tell it to draw 10 frames at 1 fps, just to feed the renderer with more then one single frame.
madshi
23rd October 2012, 09:54
Are there more filters other than madVR which have problems with 1 frame only? If so, emulating a movie would probably be a good idea. If it's only madVR which makes problems, though, I could try to fix that. If you do emulate a movie, I'd prefer a couple of seconds worth of 24fps. I have a very low framerate calibration pattern here and playing it back always feels very sluggish, for some reason. FWIW, for images, AviSynth emulates a movie with a runtime of 42 seconds, with 24.000 fps.
nevcairiel
23rd October 2012, 09:56
42*24 = 1000 frames (roughly). Guess i can do that.
madshi
23rd October 2012, 09:58
Yeah, 1000 frames seems very likely.
jmone
23rd October 2012, 10:02
I look forward to this as it may fix the issue on one video file that is a music video but with only a still image that currently will not play.
nevcairiel
23rd October 2012, 10:09
I look forward to this as it may fix the issue on one video file that is a music video but with only a still image that currently will not play.
This will only work for actual images, not for your broken video files.
You could try this particular file with 0.52 however, i added support for proper handling of mpeg2 end-of-sequence markers, which are typically used for DVD still images.
kolak
23rd October 2012, 17:48
DNxHD 10bit decoding is fixed with ver 0.52 :)
Overall performance and stability also seams to be better :)
LoopinFool
23rd October 2012, 20:30
Yeah, 1000 frames seems very likely.
Especially since this wiki page (http://avisynth.org/mediawiki/ImageSource) mentions 1000 and 24fps a lot.
GraphStudioNext shows a 41.70sec duration when loading a single image with AviSynth. That doesn't quite match either 1000 or 1001 (0-1000) frames at 24fps. I suspect it is indeed 1000 frames.
UPDATE: avs2avi claims it's 1001 frames, which matches the 0-1000 frame number defaults on that wiki page.
- LoopinFool
LoopinFool
23rd October 2012, 22:11
Oh, speaking of AviSynth...
Since ffmpeg can use AVS scripts as input, it would be nice if LAVSplitter could, too.
- LoopinFool
kitame
24th October 2012, 02:31
how about clamp it to screen refresh-rate? or the video source's refresh-rate, it should solve scaling problems.
nevcairiel
24th October 2012, 06:52
Since ffmpeg can use AVS scripts as input, it would be nice if LAVSplitter could, too.
Not going to happen. AviSynth outputs uncompressed video, and LAV Splitter doesn't really like dealing with that, so just stick to the AviSynth DirectShow filter.
aufkrawall
24th October 2012, 08:32
Does madVR make use of the Avisynth DS filter?
Reino
24th October 2012, 09:44
"the AviSynth DirectShow filter"? I take it you mean AVI/WAV File Source?
nevcairiel
24th October 2012, 09:46
I just know that i can play AviSynth scripts in MPC-HC with some source filter that handles it =P
asasadad_1
24th October 2012, 16:48
FFmpeg compiled with opencore-amr also fails to decode it :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'K:\downloads\AAC-LD_inMP4.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
Duration: 00:00:16.71, start: 0.000000, bitrate: 133 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, 2 channels, s16, 127 kb/s
Metadata:
handler_name : soun
[aac @ 04a39820] Audio object type 23 is not supported.
It seems Mplayer compiled with "FAAD" can decode this.
maybe u could try ffmpeg -c:a libfdk_aac -i inputfile out.wav?
anyway, it (http://ul.to/f510ugzl) contains a AAC-LD file, a AAC-ELD file(both created via ffmpeg) and lavfilters patched by someone, they works well.
the pathced lavfilters decode that AAC-LD file from videolan stutter.
nevcairiel
24th October 2012, 18:57
AAC-LD is only really useful for true low-delay applications like realtime speech, it doesn't have any real advantages for audio coding in files/movies, which is why i won't go through any legal hoops with the Fraunhofer library to try to support it.
Anyone can build it for themself if they want, however such builds are not redistributable, and anyone that does so is in violation of the license.
Note that using this library will most likely break other parts of AAC playback.
Pat357
24th October 2012, 20:59
Are there more filters other than madVR which have problems with 1 frame only? If so, emulating a movie would probably be a good idea. If it's only madVR which makes problems, though, I could try to fix that. If you do emulate a movie, I'd prefer a couple of seconds worth of 24fps. I have a very low framerate calibration pattern here and playing it back always feels very sluggish, for some reason. FWIW, for images, AviSynth emulates a movie with a runtime of 42 seconds, with 24.000 fps.
Did you already have a look at vapoursynth (http:/www.vapoursynth.om) ?
It an output 8, 9 10 and 16 bit in all color formats : RGB, YUV410P016, YUV422P216, YUV444P416....
There's also a native High Bitdepth image reader..
LoopinFool
25th October 2012, 00:50
I have a 720x486 AVC video. When (and only when) YADIF is enabled in the Video decode filter, it outputs 720x488 instead.
This doesn't happen with the same video in either RAW or MPEG2 formats.
nev, send me a PM if you want/need the video clip.
- LoopinFool
Asmodian
25th October 2012, 03:01
Ah but interlaced 4:2:0 needs to be mod 4 vertically. I assume the AVC is YV12?
You have 243 lines per field and the color is 1/2 resolution.
Are the raw or MPEG2 versions 4:2:2 or 4:4:4?
jmone
25th October 2012, 03:38
This will only work for actual images, not for your broken video files.
You could try this particular file with 0.52 however, i added support for proper handling of mpeg2 end-of-sequence markers, which are typically used for DVD still images.
Thanks - 0.52 fixes this file, plays back perfectly!
LoopinFool
25th October 2012, 04:14
Ah but interlaced 4:2:0 needs to be mod 4 vertically. I assume the AVC is YV12?
You have 243 lines per field and the color is 1/2 resolution.
Are the raw or MPEG2 versions 4:2:2 or 4:4:4?
You are absolutely correct. I also just repeated my tests and it didn't matter whether YADIF was enabled or not. :confused:
I had been testing with ffdshow, which delivers 720x486 frames on its output pin even though the input is flagged as interlaced. Perhaps that's a bug in ffdshow.
If possible, it would be nice if the LAV Video decoder could report 720x488 on its output pin before the frames start streaming. While downstream filters should handle the image size (and buffer) getting bigger, some probably don't (like mine didn't until I fixed it).
I just noticed that even Windows Explorer reports 720x488 when this file is highlighted.
I strongly suspect the other versions of this movie are not flagged as interlaced. I made them myself a while ago using ffmpeg.
Thanks,
- LoopinFool
romulous
25th October 2012, 04:42
Hi nev,
I checked the changelog and did a quick search of the open bug tracker issues, but I couldn't find any mention of this as a known issue, so I thought I'd ask.
When using LAV Video Decoder with CUVID enabled (player is Zoom Player), the Ctrl+Alt+S shortcut is blocked while a video file is playing. So basically, you create a desktop shortcut using that hotkey to perform a function (e.g. open Notepad), and then start up the player and play a video. While that video is playing, if you hit the hotkey, nothing happens - until you close the player or stop the video, whereupon the hotkey activates (e.g. opens Notepad). Only with CUVID enabled though.
Is this by design, or a bug?
Thanks!
nevcairiel
25th October 2012, 06:52
If possible, it would be nice if the LAV Video decoder could report 720x488 on its output pin before the frames start streaming. While downstream filters should handle the image size (and buffer) getting bigger, some probably don't (like mine didn't until I fixed it).
Thats not really possible. Before streaming starts, the decoder has not seen any frame data of the video, so it can't really determine which are the right values. It has to trust the values the source filter tells it, and if the source reads a height of 486 from the container, it will report this.
sneaker_ger
25th October 2012, 13:37
Maybe LAV should crop 2 lines, then?
nevcairiel
25th October 2012, 13:38
Like it was pointed out above, interlaced 4:2:0 needs to be mod4 in height to be "valid", so no, it should not.
sneaker_ger
25th October 2012, 13:47
But after YADIF it is not interlaced anymore.
nevcairiel
25th October 2012, 13:48
If the file was invalid before by having a basically unsupported height, i don't care. :P
njfoses
25th October 2012, 14:00
I have a Sony Vaio laptop with an i7 2670QM(2.20GHz) processor along with an nvidia 540m gpu. Correct me if im wrong but my processor would seem more capable to utilize lav, madvr and mpc-hc then the gpu. Should i be using cuvid without yadif or would i be better off letting the processor do the work and not use cuvid but use yadif? 98% of my sources are hd progressive so interlacing would not come into play often but i still want the optimal setup. Should i use the cpu for interlaced material and then switch to cuvid for progressive material? I would like to pick one or the other for all material if possible. I just dont know if im better off using my gpu or cpu based on my system. Any help is appreciated!
kitame
25th October 2012, 15:00
^ simply put it software decode(aka letting the CPU do it) has more inherent quality to it, because it seems hardware decode(aka letting the GPU do it) does too much damage while decoding them.
nevcairiel
25th October 2012, 15:00
^ simply put it software decode(aka letting the CPU do it) has more inherent quality to it, because it seems hardware decode(aka letting the GPU do it) does too much damage while decoding them.
What are you talking about?
Both software and GPU decoders produce the exact same quality image.
Regarding performance, decoding is handled by a seperate decoder chip in your GPU, it does not relate to the power of the GPU, so you can safely enable it.
I suggest to simply test it for a while in any combination and see if it works. We don't know the performance of every cpu or gpu on this planet to decide =p
kitame
25th October 2012, 15:33
might've had something else in mind then =/
ah i had "encoding" in mind, lol.
LoopinFool
25th October 2012, 16:32
Thats not really possible. Before streaming starts, the decoder has not seen any frame data of the video, so it can't really determine which are the right values. It has to trust the values the source filter tells it, and if the source reads a height of 486 from the container, it will report this.
That's fine. I just figured if the stream is flagged as interlaced and is 4:2:0, the source filter might be able to report the rounded-up height instead. MediaInfo reports "Height: 486 and Original Height: 488". It gets that 488 from somewhere, but perhaps it's decoding the stream, too.
Again, not a problem for me as my internal sink filter now properly re-allocates all of its buffers when the size changes.
By the way, nev, did you get my PM with the crash stack trace? I don't see it in my Sent Items folder.
- LoopinFool
starkline
25th October 2012, 18:13
nevcairiel-- I believe that 0.52 introduced a slight regression in the stream aspect ratio detection for asf containers. The X and Y coordinates are reversed for the source aspect ratio. Reverting lav to 51.3 fixes the issue.
I do not notice any problems with mp4 containers.
Dogway
25th October 2012, 18:34
Since ffmpeg can use AVS scripts as input, it would be nice if LAVSplitter could, too.
Yes, I was about to ask the same thing when today to my surprise realised lavfilters couldn't open avs files :scared:
what to do then, fiddle with the external filters to enable ffdshow everytime we want to preview avs?
LoopinFool
25th October 2012, 18:41
Yes, I was about to ask the same thing when today to my surprise realised lavfilters couldn't open avs files :scared:
what to do then, fiddle with the external filters to enable ffdshow everytime we want to preview avs?
As mentioned here, enabling the "AVI/WAV File Source" filter may work for you.
- LoopinFool
Dogway
25th October 2012, 18:50
As mentioned here, enabling the "AVI/WAV File Source" filter may work for you.
Yes I know, but being aware of "powerful" tools like ffdshow, lavfilters, madvr, etc I never thought I would need internal filter. That's why I'm using a modded austere light MPC-HC version without internal filters.
I'm testing in graphedit but it seems I can't either connect LavSplitter to ffdshow video directly, I need a new splitter + decoder for avs? :scared:
clsid
25th October 2012, 20:21
Haali Splitter supports AviSynth input. Use this tweak:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Wow6432Node\Media Type\Extensions\.avs]
"Source Filter"="{55DA30FC-F16B-49FC-BAA5-AE59FC65F82D}"
Btw, "AVI/WAV File Source" is not an internal filter. It is a standard filter from Windows.
Dogway
25th October 2012, 20:38
I try to refrain myself from Haali Splitter because it is very intrusive, and caused many problems in the past.
Do I need to apply that registry after installing Haali?
I wasn't sure "AVI/WAV File Source" was internal or not, so I tried to load it in the external list as well, but it doesn't help. Graphedit doesn't want to open avs with "AVI/WAV File Source" either.
clsid
25th October 2012, 20:45
Can you add mediatypes and format config options for the following audio formats? Then they can also work with other splitters.
AMR-NB
{726D6173-0000-0010-8000-00AA00389B71}
Nellymoser
{4C4C454E-0000-0010-8000-00AA00389B71}
A-law
{77616C61-0000-0010-8000-00AA00389B71}
WAVE_FORMAT_ALAW = 0x0006
Mu-law
{77616C75-0000-0010-8000-00AA00389B71}
{57414C55-0000-0010-8000-00AA00389B71}
WAVE_FORMAT_ULAW = 0x0007
MS GSM
WAVE_FORMAT_GSM610 = 0x0031
MS ADPCM
WAVE_FORMAT_ADPCM = 0x0002
Truespeech
WAVE_FORMAT_TRUESPEECH = 0x0022
Dogway
25th October 2012, 20:51
Haali Splitter supports AviSynth input,
No, just tested, even with the reg applied. I can't even open Haali Splitter with the .avs in graphedit. This is a nightmare! I can't play AVS! :confused:
LoopinFool
25th October 2012, 22:05
No, just tested, even with the reg applied. I can't even open Haali Splitter with the .avs in graphedit. This is a nightmare! I can't play AVS! :confused:
clsid's registry setting was to use Haali for AVS files in 32-bit applications only, assuming the Haali splitter has been registered.
Here's what I put in my registry in order to have DirectShow use the Windows built-in AVI/WAV file source for AVS files:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Media Type\Extensions\.avs]
"Media Type"="{E436EB83-524F-11CE-9F53-0020AF0BA770}"
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"
That's for 64-bit programs. Add this entry to do the same for 32-bit programs:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Wow6432Node\Media Type\Extensions\.avs]
"Media Type"="{E436EB83-524F-11CE-9F53-0020AF0BA770}"
"Source Filter"="{D3588AB0-0781-11CE-B03A-0020AF0BA770}"
You probably don't even need the "Media Type" key but it works for me with it there.
- LoopinFool
Reino
25th October 2012, 23:44
The Source Filter is one thing, but you'd also need a suitable video decoder. Dogway hasn't mentioned what colorspace his Avisynth-script puts out. Windows can handle RGB by default, but for YV12, which your script probably is, you'd need something extra. You could install the Helix YUV Codecs, the XviD codec, or you could use FFDShow of course.
With FFDShow you can either change "Raw Video" to "YV12" in the Codecs-section of FFDShow's Video Decoder config, or you could change the merit of FFDShow's Raw Video Decoder to 00400000 with software like DirectShow Filter Manager (http://www.softella.com/dsfm/index.en.htm).
(In case you don't know how to access FFDShow's Raw Video Decoder config: make a copy of the shortcut to FFDShow's Video Decoder config, go to its Properties and in "Target" change configure into configureRaw.)
If people tell me that RGB Fraps is far more common then YUV420 Fraps, then i might add a special rule for Fraps to default to RGB instead of NV12, but this has to be done on a per-codec basis.It's not IMO, but defaulting to RGB is a good idea with this codec regardless. Levels issues and other stuff.Afaik is Fraps always RGB. At least I've never heard of YV12 Fraps files.I'd like to get back at this. About a week ago I made a post, which is actually a summary of all I have learned about Fraps recently.
The current situation with the FFDShow- and LAV Video Decoder is; they both convert the output, whether it's FPS1(yuvj420p) or FPS1(bgr24), to RGB24. And of course, unlike FFDShow, LAV lags the PC.709-->Rec601 capabilities atm.
IMHO now :rolleyes: FPS1(yuvj420p) to the renderer should go out as YV12 and FPS1(bgr24) as RGB, or in other words, no colorspace conversions. Only FPS1(yuvj420p) needs a PC.709-->Rec601 conversion, that's all.
Dogway
25th October 2012, 23:46
Sorry, I can't make it work:
http://i212.photobucket.com/albums/cc35/Dogway/Misc/th_clip-2.png (http://i212.photobucket.com/albums/cc35/Dogway/Misc/clip-2.png)
And yes, I registered the source and mediatype, 32bit what I use.
The Source Filter is one thing, but you'd also need a suitable video decoder.
I'm very confused because I always knew that in MPC-HC terms "Source Filter"=Splitter, now, I am being recommended to use Haali Splitter with "AVI/WAV File Source", Splitter+Splitter? Or is "AVI/WAV File Source" a Transform Filter (aka Decoder)? In such case I wouldn't need ffdshow.
Anyways, I have also tried to decode with ffdshow, RAW Video is set to all supported, and of course avisynth enabled.
I never thought something that used to be so easy has become such a nightmare. I remember using LavSplitter with ffdshow no problem before, what has happened?
clsid
26th October 2012, 00:11
First of all, you should stop messing with external filter settings. You will do more damage than good. My list is totally empty and everything works exactly the way I want.
Dogway
26th October 2012, 00:16
First of all, you should stop messing with external filter settings. You will do more damage than good. My list is totally empty and everything works exactly the way I want.
I guess you do it through merit settings...?
That should be ideal but I once had a look and felt it was way over my head.
edit: I'm having a look at filter manager and it looks more feasible, but without having deep knowledge I feel I have more to fail at than by using external filter settings, do you have any reason why it should be avoided?
Reino
26th October 2012, 01:03
Anyways, I have also tried to decode with ffdshow, RAW Video is set to all supported, and of course avisynth enabled.And...?
I never thought something that used to be so easy has become such a nightmare. I remember using LavSplitter with ffdshow no problem before, what has happened?LAV Splitter can't read Avisynth scripts, so that's impossible. It probably was the "AVI/WAV File Source" then.
Except for FFDShow's Raw Video Decoder, there's absolutely no reason to mess with the merit settings or external filters in MPC-HC. "AVI/WAV File Source" is a standard Windows filter and afaik has been the only one capable of handling Avisynth scripts so far.
How does your Avisynth script look like?
agustin9
26th October 2012, 05:56
Some feedback on DVD playback, after a while subtitles are not cleared from the screen they just keep displaying over the top of each other.
I'm having this problem too. Using latest mpc-hc and madvr.
nevcairiel
26th October 2012, 07:00
IMHO now :rolleyes: FPS1(yuvj420p) to the renderer should go out as YV12 and FPS1(bgr24) as RGB, or in other words, no colorspace conversions. Only FPS1(yuvj420p) needs a PC.709-->Rec601 conversion, that's all.
If you use a renderer thats not as braindead as EVR, it will already do that.
The problem with EVR is that it doesn't let you switch its input format after the initial connection, so you get one chance to decide which pixel format to use, and have to stick with that. At the point of the initial connection, its impossible to know what version of Fraps you're dealing with, you only figure that out once you start getting frame data. And since people claimed that RGB Fraps is way more common, thats the one i assume to be the default - hence EVR gets RGB as its initial type for Fraps.
Now if you use madVR or even VMR-9 on a Fraps YUV420 file, it would switch to NV12/YV12 output, but only EVR doesn't support doing that.
So in short: can't be changed.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.