Log in

View Full Version : Force DirectShowSource to use ffdshow


bur
13th May 2013, 19:13
I want to use this mkv in an AVS:

Format : AVC
Format/Info : Advanced Video Codec
Format-Profil : High 10@L5.0
Format-Einstellungen für CABAC : Ja
Format-Einstellungen für ReFrame : 16 frames
Codec-ID : V_MPEG4/ISO/AVC
Dauer : 23min
Breite : 1 280 Pixel
Höhe : 720 Pixel
Bildseitenverhältnis : 16:9
Modus der Bildwiederholungsrate : konstant
Bildwiederholungsrate : 23,976 FPS
ColorSpace : YUV
ChromaSubsampling : 4:2:0
BitDepth/String : 10 bits
Scantyp : progressiv
verwendete Encoder-Bibliothek : x264 core 116 r2037+602 fbce75d

This is the AVS:

raw=DirectShowSource("video.mkv", audio=false)
conv=ConvertToYV12(raw)
return conv

The encoding finished without errors or warnings. But the video only consists of a grey color. I opened the AVS in MPC (both including and omitting the conversion part) and got the same grey picture.

When I open the source file with MPC all works well.

I checked and the problem seems to be that DirectShowSource opens the video using the internal Win 7 decoder while opening the mkv file in MPC correctly uses ffdshow. Graphedit also didn't use ffdshow to render the video.

I reinstalled ffdshow, but this didn't help.

I guess if I can tell Windows to use ffdshow for this kind of video DirectShowSource will work and hence the encoding. So how would I do that?

Also is there a way to tell Avisynth to use specific filters?

And last, I read somewhere that DirectShowSource is not the recommended way to open files in AVS but rather for example ffmpeg. What are the advantages (I guess it might solve this specific problem, but are there others)?

poisondeathray
13th May 2013, 19:33
For Directshow, Win7 , use preferred filter tweaker (win7dsfiltertweaker)

http://codecguide.com/windows7_preferred_filter_tweaker.htm


Or you can use other source filter instead of DirectShow e.g. FFVideoSource()
http://code.google.com/p/ffmpegsource/

filler56789
13th May 2013, 19:54
Also, you can build a custom GRF file in Graphstudio and force DirectShowSource() to use it:

http://avisynth.org/mediawiki/DirectShowSource#Opening_GRF_files

bur
13th May 2013, 20:42
Ok, thanks, but I don't recall ever having this problem before. I thought the merit system would allow me to set ffdshow as default for specific video types? And how does MPC know it is supposed to use ffdshow when I directly open the mkv instead of the avs?

Anyway, I'm now using FFMpegSource instead and so far it seems to work fine. I'll try the encode now...

edit: Everything went fine, I just had to add fpsnum=24000, fpsden=1001 to set the proper frame rate. Otherwise the video would be 24.169 fps for whatever reason causing subs and audio to be out-of-sync.

Thanks for the help.

Keiyakusha
14th May 2013, 04:08
Ok, thanks, but I don't recall ever having this problem before. I thought the merit system would allow me to set ffdshow as default for specific video types? And how does MPC know it is supposed to use ffdshow when I directly open the mkv instead of the avs?

No. Starting from win7 microsoft filters override everything and they don't really want you to change that.
MPC does not rely on windows when choosing filters. How exactly it decides what to chose - no idea.

JEEB
14th May 2013, 09:47
No. Starting from win7 microsoft filters override everything and they don't really want you to change that.
Starting with Windows 7, in order to stop really bad cases of filter hijack, MS added a system called 'preferred filters', which pretty much lists the MS's preferred filters for certain GUIDs, which now by default get used if an application asks Windows to create a filter chain.

This is not a call for extreme obedience or anything, or for not having alternatives, though. As we can see on the Intelligent Connect (http://msdn.microsoft.com/en-us/library/windows/desktop/dd390342%28v=vs.85%29.aspx) MSDN page, third party applications can use the preferred filters system in any way they wish to either push any preferred filters out of their way (= work just like they used to without the preferred filters), or to have their own preferred filters for various media subtypes and so forth with the IAMPluginControl (http://msdn.microsoft.com/en-us/library/windows/desktop/dd319756%28v=vs.85%29.aspx) interface.

While this change does indeed leave us with unexpected results regarding what kind of filter chains get created by old applications that left their graph creation completely to the MS code, it doesn't mean that MS doesn't want us to poke this system and get results we would like from our software. Just that they don't want us poking the preferred filters system's hardwired defaults, for example (the registry entries not being accessible by admins by default as well as not being documented etc.).

As for MPC-HC, that just uses completely custom archaic Gabest magic for the manual graph building based on merits (with some updates done during the years).

bur
14th May 2013, 21:56
Interesting, thanks. I'd thought this was MS trying to force people to do it the Redmond way. Well, they probably leave that to Apple nowadays... ;)


So in order for a video player to use a specific filter, for example ffdshow, this would need to be coded into the application? But doesn't that mean that if a developer doesn't check for a specific filter than the application will always default to the Windows filters?