Log in

View Full Version : ffdshow.ax as simple AVC VfW decoder?


DeathTheSheep
22nd January 2007, 03:15
Hi, I'm sure everyone knows ffdshow has VfW decoder support for AVC (like x264), but requires the whole package to be installed, and its VfW stuff has to be set up manually.

Well, I was wondering if I could make a mini-AVC-decoder package with just ffdshow.ax and a "setup.reg" which turns the VfW decoder on. But I have the following questions:

1. What is the bare minimum required for AVC decoding? Just the one ffdshow.ax? Maybe another dll too?
2. Would a simple rgsvr32 ffdshow.ax suffice?
3. What registry tag turns on the AVC VfW decoder? (In other words, what should be put in a .reg file to activate it?)

I want to provide a single, simple double-clickable installer that enables AVC VfW decoding, without all the bulk and hassle and decoder conflict that comes with installing the entire ffdshow package. I'd appreciate any help!

Jerry_Sm@rt
22nd January 2007, 03:45
ffdshow.ax is just a shell,to decode h264,u'll need libavcodec.dll

DeathTheSheep
22nd January 2007, 03:49
Ok.

1. ffdshow.ax
2. libavcodec.dll

So how do I register these in a working way? Do I register both with Regsvr32?

And then that still leaves:
What registry keys would I need to change to activate AVC VfW decoding?

squid_80
22nd January 2007, 04:40
You need ff_vfw.dll as well (copied to somewhere like windows\system32) and the following registry key: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32\vidc.ffds = ff_vfw.dll
Settings for the vfw component are stored in HKCU\Software\GNU\ffdshow_vfw, to turn on h264 decoding set h264 = 1.
Only ffdshow.ax needs to be registered with regsvr32.

DeathTheSheep
22nd January 2007, 05:10
Thanks. So 3 files are copied to system32:
1. ffdshow.ax
2. libavcodec.dll
3. ff_vfw.dll

setup.bat looks like:
regsvr32 ffdshow.ax
decoder.reg

decoder.reg looks like:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\GNU\ffdshow_vfw]
"fastH264"=dword:00000000
"h264"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]
"VIDC.FFDS"="ff_vfw.dll"

And that's all there is to it? Will that allow AVC files to be opened with VirtualDub? :)

squid_80
22nd January 2007, 05:24
setup.bat looks like:
regsvr32 ffdshow.ax
decoder.reg
Instead of just "decoder.reg" use "regedit -s decoder.reg".
I think it should work, best way to find out would be to test on a clean machine.

DeathTheSheep
22nd January 2007, 05:51
Wow, it works perfectly except for one thing: when played back in a directshow player, the image is flipped vertically! I'm sure it's the vfw playing it back.

Is there another registry setting that forces ff_vfw to flip it vertically (back to normal)?

Thanks so much for your help--I hope this is the last thing! :)

edit: I noted that every dshow player is playing it back flipped vertically, including graphedit.

squid_80
22nd January 2007, 06:16
Directshow players shouldn't be using the vfw component for playback.
The key for directshow flipping mode is HKCU\Software\GNU\ffdshow\default\flip. Set it to 0 to turn off vertical flipping or 1 to enable it.

DeathTheSheep
23rd January 2007, 01:42
As far as I know, the directshow decoder isn't even included in this mini package, is it? If it is, though, it's not turned on by default, and as such I am 100% sure the decoder I speak of is VfW, as the filter graph reports "AVI decompressor," which it does when using VfW for playback, and if
[HKEY_CURRENT_USER\Software\GNU\ffdshow_vfw]
"h264"=dword:00000000 (VfW turned off, that is), it doesn't decode at all (WMP and the like report codec not found).

However, the following tag:
[HKEY_CURRENT_USER\Software\GNU\ffdshow_vfw\default]
"flip"=dword:00000001
fixes the flipping problem during playback in directshow players, but then flips it upside down in editors like VirtualDub!

I think this is a problem with the ff_vfw decoder. But then again, it was apparently overlooked because most people installed and configured the directshow ffdshow for playback anyway.

Well, I'd just leave it the way it is now and tell people to get their own directshow decoders... but most people would grab ffdshow, which would cause conflicts with the stripped-down package here, right?

Or does is this mini-package capable of decoding AVC with directshow too (with another registry key)?

Inventive Software
23rd January 2007, 01:54
I'd just leave it as is DTS and use that explicitly for VfW editing. Did it have the same problem in MPC?

DeathTheSheep
23rd January 2007, 01:58
Yep. Just tried it with MPC, same (upside down) results. Like they say, a good rule of thumb is: when it doesn't work with MPC, it won't work right with other DS players either (TM). But I haven't tried Nintendo's DS implementation yet... :)

squid_80
23rd January 2007, 02:32
ffdshow.ax IS the directshow filter, that's why it has the filename extension .ax. (Activemovie eXtension.)
Is it really worth making this effort? I just looked in my ffdshow directory, ffdshow.ax is 7.5mb and libavcodec.dll is 2.4mb. The rest of the files combined are less than 3mb. It's hardly a "stripped down" package, you may as well have people install the full version and get all the benefits instead of being limited by a crippled version.
The key for directshow flipping mode is HKCU\Software\GNU\ffdshow\default\flip
However, the following tag:
[HKEY_CURRENT_USER\Software\GNU\ffdshow_vfw\default]I thought you would have worked this one out - to turn on directshow h264 playback:[HKEY_CURRENT_USER\Software\GNU\ffdshow]
"h264"=dword:00000001

DeathTheSheep
23rd January 2007, 02:56
Well, a whole one-click installation package with encoder, decoder, setup files, etc is only 2MB exe in the end. So, still pretty good :)


[HKEY_CURRENT_USER\Software\GNU\ffdshow]
"h264"=dword:00000001
Wow...I suddenly feel really stupid...:D

Well, thanks a lot! :)

[edit] ...but it doesn't seem to work. The VfW decoder is still used, even after that registry item is set. It does work when the full package is installed, so perhaps something is missing in the stripped-down version preventing the dshow filter from functioning...

foxyshadis
23rd January 2007, 11:57
You might need libmplayer, dunno.

Try setting vfw output to YUY2 or RGB. I bet picture's getting flipped because of a buggy YV12 inplementation in your video drivers. YUY2 is typically better handled and RGB always is.

gameplaya15143
31st January 2007, 03:27
Since you are after h264 vfw decoding use vidc.h264

You shouldn't need the *.ax at all.

Personally I have it output to rgb24 (maybe 32, I can't remember). Test it with virtualdub, NOT a directshow player. The picture isn't flipped for me :)