Include file for native Directshow support in PB4

Developed or developing a new product in PureBasic? Tell the world about it.
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

OK!

I found the darn problem :)

First I googled and it was suggested to install Xvid - which I usually did in the past but I stopped using it so long ago that I didn't install it this time.. Although that started giving me xvidvfw.dll crashes upon exiting your example program.. So then I got rid of it and started looking hard at the FFDshow filter list and alll the way at the bottom it listed

"raw video" as disabled... which I found odd (I've never tinkered with it before) and once I saw it had a boatload of colorspace options, I first tested with only YV12 - and the AVS script loaded. So then I went back and changed it to "All supported".. Still working.


So...That problem is out of the way, lol.... now if I could only find a starting point for understand all the useful code you've written :|
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

FYI ... a time ago I did post in the german Forum an update (v1.3) of the directshow-include. Beside some improvements and added functions (like toggle-fullscreen etc.) I also fixed that stupid bug "ProcedureReturn = #True" ... Don't ask me how this happened in the past ;-)

http://www.purebasic.fr/german/viewtopi ... 73#p269873
Check out OOP support for PB here!
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

Cool, I will grab that copy and update it.. Looks like you did an extensive rewrite

Does it require a new "demonstration" file?

I don't know if you've considered it. But some general documentation on how it works / how to use it, would probably help a lot of people out.
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

Yes it has been rewritten including the use of the PB internal Objectmanager.
A demonstration code can be found at the end of the include :-)

This Version also contains a right-mouse-click menu drop down, where viewing the used filters and modifying their settings is supported!
Check out OOP support for PB here!
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

Oh cool, I missed the example at the bottom. I will do my best to pick it apart, but being a novice I don't know :p
I got a deprecated function warning from PB about the CreateGadgetList thing though, that's just your choice of GUI code in the example, and not core of the DShow include, right?

I kind of liked the old window though, although the slider bar is nice :) is the slider update what causes that constant scrolling of "move" in the debug window? lol

The full screen option is nice too!
On an unrelated note, I think my Gundam 0079 DVD's have some serious dot crawl issues, heh....

If you ever do write some documentation, or simple usage guides, please let me know!

p.s
I saw you are registered on Doom9, my handle there is osgZach if we ever run across each other :p
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

This code needs some updates as I wrote it using a prior version of PB.

Currently I'm testing it on XP 32bit using PB 4.3x and Windows 7 64bit using the actual PB Version.
Both compiles do behave very different ;-) The slider issue is only one. Also when using the Windows 7 compile
it seems the Mouse Events are just ignored.
Check out OOP support for PB here!
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

Ok, i went into it and installed on my OSx Parallels Desktop two virtual machines, a 32bit WinXP and a 64bit Win7.

This include HAS TO be compiled using the "x86" compiler option (do add it in the compiler prefs of your x64 PureBasic install).
Because the API Call "OleCreatePropertyFrame_()" in the GetFilterProperties function does call the OLE32.dll which isnt compatible.
A search in the www showed that in some forums they say that managed Directx is obsolete within a x64 System :-O ?!
Check out OOP support for PB here!
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

I've seen similar comments before, but I thought they were related to unmanaged DirectX.. It could be the other way around though.. I know little about DirectX anyway, and don't even really understand why "Managed" versions of stuff was created under the .NET framework.

Just to clarify, I am using PB x32 4.51 (I had x64 for demo but went with x32 when I registered because I don't know anything about 64 bit stuff anyway).

The mouse events work for me on Win7 x64, if you are talking about the right-click functionality. I'm not sure why that deprecated GadgetList warning comes up though.

The only issue I have with the slider, is I think it should really be docked with the Video window in a container. Otherwise it easily gets hidden behind it, I think even at startup. It also creates its own window entry in the Windows taskbar. A container would probably be better management (I've never liked multi-window applications outside of a parent container window, but that is just me)

But if you are updating stuff, its the perfect time to document it ;) (or at least some verbose commenting).
I'm still not sure if I am gonna need to use the Avisynth_C API yet though (I have to comb through Yatta's source tree to see what its calling, but I'm pretty sure I saw API calls).
Is the wrapper your wrote in pretty good shape though? Or possibly in need of updating too?
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

Seems there has changed something in PB whenusing EventWParam(). So I changed the slider event procedure using GetAsyncKeyState().

The fixed version is up (in the germen thread). Tested using WinXP 32bit and Win7 64bit, both running PB 4.51.
Check out OOP support for PB here!
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

Looking good. No errors or anything :)

I noticed something peculiar though. If I open a VOB it displays correctly, but if I load that same VOB from an AVS script, it does not assume the proper aspect ratio (4:3), it seems to be assuming a wider one by default.

I'm not sure that is really anything to do with your code though.. Might be something related to Avisynth and needing to explicitly find and assume the proper AR manually.

In the meantime, I think I have realized that I don't have sufficient skill to understand working with Avisynth in general, as its API docs and your wrapper just make my head spin :p

I think I will try a smaller scale project or two, and come back to this idea down the road. As the saying goes - know your limitations. I guess my enthusiasm got in the way :mrgreen:

In the mean time, keep up the great work! I'm sure many others appreciate this.
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

Avisynth just streams video- & audiodata, NO headerinformation or anything else from the source.
Thats why its not capable assuming the correct fieldorder or even an aspectratios.

If your sorce is from a DVD (like your Vobs in this case) than look out for my Resizing tool on forum.doom9 called PARanoia,
which does this kind of job for you.
Check out OOP support for PB here!
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

Yeah that's kind of what I figured was going on, and it makes sense.

I'm just so used to working with Vdub / MPC which have options that set a default A/R, etc I suppose.
Image
AndyMK
Enthusiast
Enthusiast
Posts: 540
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: Include file for native Directshow support in PB4

Post by AndyMK »

How difficult would it be to use directshow input? Is it feasible in PB?
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

Well. I suppose that depends on what you want to do?

The samples Inc has provided pretty much load and display a video file of your choosing. If you can read the code to his wrapper, and reference the MSDN docs to understand what's going on and where, then you can presumably use it as a base for your own wrapper, to tweak functionality to what you require.


The DirectShow API itself lets you do all kinds of things, mainly its used for playback of various media formats. But it can also be used for video editing applications as well.
Image
AndyMK
Enthusiast
Enthusiast
Posts: 540
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: Include file for native Directshow support in PB4

Post by AndyMK »

I just want a basic video input with the ability to change the input devices settings like resolution and colorspace
Post Reply