Render video to Direct3D 9.0c texture - directx

I have been trying to play a video in my Direct3D application and have been trying to do so with the help of DirectShow. My problem is that I cannot find how to get the frame data to put into a texture (ISampleGrabber won't install).
Does anyone know of any methods or examples of this being done?

ISampleGrabber is available in all versions of Windows released last 15+ years
Look for "Microsoft® DirectX® 9.0 SDK Update (October 2004)" which contains sample app, which does exactly what you want:
Texture3D Sample Description
Draws video on a Microsoft® Direct3D texture surface.
Note This sample does not support changing the display properties of
the monitor while the sample is running.
Path
Source: (SDK root)\Samples\C++\DirectShow\Players\Texture3D
Executable: (SDK root)\Samples\C++\DirectShow\Bin\Texture3D.exe
UPDATE. Even though Sample Grabber existed though many many versions of Windows, it was finally removed along with other filters hosted by qedit.dll in most recent versions of operating systems (Windows Server 2008 in particular). Those whose application are dependent on this API, should consider building a replacement using Grabber sample from older SDKs. The same applies to those needing this filter because of so many references on Internet and tutorials on how to use it to get access to media streams.
The filter was removed silently and without any replacement. Microsoft suggests that Media Foundation is an alternate option and successor to DirectShow, which is however hardly helpful.

Related

Jmyron and Windows 8

I am running into hardware issues that perhaps someone here knows a workaround. I am using a PC and windows.
For several years I have been making interactive installations using video tracking: the Jmyron library in Processing, which has functioned marvelously for me. I use this set up: cctv type microcameras to a multiplexer, the I digitize this signal via a firewire cable to a pci card. Then Processing reads these quads (sometimes more) as a single window, and it has always worked (from windows xp all the way to 7). Then comes windows 8: Processing seems to prefer the built-in webcam to the firewire bus. On previous version of windows, the firewire bus would naturally override the webcam, provided I had first opened a video capture in Windows Maker, and then shut it down before running the Processing sketch. In Windows 7, which had no native video capture software, I used this great open source video editor called Capture Flux. The webcam never interfered. With Windows 8, no matter what I try, Processing defaults to the webcam, which for my purposes is useless. I have an exhibition coming up real soon, and there is no way I am going to have the time to rewrite all that code for Open CV or other newer libraries.
I am curious if anyone has had similar problems, found a work around? Is there a way of disabling the webcam in Windows 8 (temporarily of course, because I need it to be operational for other applications), or some other solution?
Thank you!
Try this:
type "windows icon+x" choose device manager (or use run/command line: "mmc devmgmt.msc")
look for imaganing devices, find your integrated webcamera
right click on it and choose disable - now processing should skip the device.
Repeat the steps to reenable the device.
Other solution would be using commands in processing:
println (Capture.list()); (google it on processing.org) this way you will get all avaliable devices and you can choose the particular one based on its name.
Hope this helps.

IBM Worklight - Is there an embedded rendering engine? Can we change it?

I'm working on a software that includes 3D graphics. Those are massive enough, so I decided to use OpenGL to keep a quite fluent animation. I selected THREE.js graphic library (WebGL).
Reading the html through a Web browser works very well : WebGL functions are recognized. I did it on my desktop (Win32/Firefox17, please do not judge me on my configuration !) and on a Nexus 10 (Android 4.3, FF24 and FF25Beta, tried with Chrome30Beta but no joy...). But I need to access native data, like the file system, to get informations for my program. So I wrapped my code with WL, and deployed it as an app on my Nexus 10... And so disappeared the WebGL capability... :(
So I looked for a reason to that :
I found on the IBM site two different ideas : in one way, I understand that a JS engine is embedded, in another that WL uses the engine of the default Web browser of the tablet (what I understood the first time)...
Let's be precise with the different engines : On the Nexus, FFs have obviously Gecko engines, Chrome30 is a Blink (webkit-like, version 537.36). Those are the ones detected by window.navigator.useragent as I read directly in the browser, no surprise. In the Eclipse/WL preview, I got different interpreters, depending the browser I selected, FF or IE (not Safari, I don't have it installed), but not the one from my desktop (the ones used are even older than my own FF...). But, when I detect the one used in the app (after wrapping in an apk), it returns an AppleWebkit 534.30/Worklight/6.0...
Maybe I'm wrong (tell me), but if 'Worklight' is in the version of the engine, and if webkit is used even when I suppress Chrome from my tablet (the version is different, but who knows..), I wonder that, for this app, as it's configured, the engine is embedded by Cordova or WL.
If it is so, I agree it allows to read a code with a fully-compatible interpreter, regardless the browser installed on the hardware. But when a webkit engine does not please you for the functions it supports (like WebGL, very partially supported), it looks a problem for me.
Does anybody have a confirmation of how it works ? If the engine is wrapped with the app, do you know if we can choose the one to be included, or configure it (like enabling WebGL ;) ) ? Another idea ?
Thanks,
Vincent.
Worklight applications do not bundle an interpreter. The application will use what that is bundled in the OS.
In other words, the default WebView in Worklight is the one that the OS provides, in the case of Android it uses the bundled WebKit.
This is not something Worklight controls what-so-ever.
You could, maybe, somehow, bundle in your app the Firefox engine libraries and hook it all up together, but the task to do so is incredibly large and complex in size... and not supported by IBM Worklight. Also, I do not know whether Cordova supports this as well ( it is used in Worklight to interface with native functionality).
As for the useragent, the string "Worklight" is attached to it as part of support for IBM WebSphere Portal.

Detect edge of a document in windows phone

I need to detect the corner/edge of a document in a captured image in Windows Phone 7. I cannot use openCV as WP 7 does not have support for native code lib.
Can anybody suggest me some algorithm or open source library that I can use for this purpose.
I want to do the similar thing on Windows Phone app as posted in another SO question: DETECT the Edge of a Document in iPhoneSDK
you can try using A-Forge for this task.
the A-forge .NET have great functionality and I think it will not be a problem to use it on windows phone

Target a commonly-available runtime version of Direct3D

I would like to add Direct3D as an optional graphics backend of a 2D game to get around DirectDraw's limitations (such as the horrid DirectDraw emulation in Windows 8).
Can I do this in such a way that the majority of users would not need to install anything? I noticed that Windows XP comes with some Direct3D files, can I target that version of the runtime?
According to John McCaskey, a software engineer on Steam:
Games which don't use the D3DX helpers (such as Source engine games) don't require running the annoying installer on first launch as they only depend on major d3d9/10/11 versions being installed. However, games that do use D3DX must run it as it's the only way Microsoft has allowed for distributing and checking the version info on the files.
Thus, using Direct3D 9 (d3d9.h) directly should be fine, assuming the user has some version of DirectX 9 installed.
Source: Why Steam Makes You Reinstall DirectX - Rock, Paper, Shotgun

Using DirectX Effect11 with Visual Studio 2012

I recently updated to Visual Studio 2012 Ultimate. I was programming previously with DirectX 11 June 2010 SDK and want to continue to do so using Visual Studio 2012. However, I discovered that VS2012 comes with its own DirectX SDK (in Windows Kit 8.0) and I've been trying to migrate my code using the newer versions of d3d11. Everything went fine until I try to use effect files in my project (.fx files). I had to compile the Effects11 Sample in the DirectX SDK using VS2012 and link the lib file in my project. That went fine too. However, when I compile my project the function D3DX11CreateEffectFromMemory returns a E_NOINTERFACE error (no such interface is supported). Can anyone tell me why is that? Note that I'm using the d3d11.lib from the Windows Kit and the d3dx11.lib from the DirectX SDK. Perhaps I shouldn't mix them? However, everything else works fine when I mix them, except for the effect file creation.
Any help would be appreciated.
P.S. I don't know if this is helpful but just so you know, if I add an additional library directory in the project settings of "DirectXSDKInstallPath\lib\x86\" it works. Why is that? Does it mean I'm using the older version of the libraries? This will give a ton of warnings about redefined headers in winerror.h
D3DX Library has been deprecated for the newest version of DirectX 11 (Windows 8). See http://msdn.microsoft.com/en-us/library/windows/desktop/bb172965(v=vs.85).aspx
Effects are now handled a different way. You can program your own library to load effects or use DirectX Tool Kit (DirectXTK): http://directxtk.codeplex.com/
Microsoft has recommended this tool kit on their web site, see http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx for more information.
Effect11 has moved to https://fx11.codeplex.com/, you need to compile it and link yourself.
DirectXTK does not provide the effect11 interface, but only simplified effects
This is probably caused by d3d library conflicts.
Make sure what d3d libraries you are using.Because there are 2 different d3d libraries.
One in DXSDK_DIR\Lib\x86 or \x64,and one in c:\program files(x86?)\Microsoft SDKs.
If you are using DXSDK, then pass $(DXSDK_DIR)Include $(DXSDK_DIR)Lib\x86 ahead of Microsoft SDKs' includes,libs directory in the Include directories and Library directories fields respectively.
In the previous version of Direct3D, the effects framework worked out of the box once you linked with the D3D10 library. In Direct3D 11, the effects framework has been moved to the D3DX library, and you have to include a separate header file (d3dx11Effect.h) and link with a separate library (D3DX11Effects.libfor release builds and D3DX11EffectsD.libfor debug builds).
Furthermore, in Direct3D 11, they give you the full source code for the effects library code (DirectX SDK\Samples\C++ \Effects11). Thus, you could modify the effects framework for your own needs. In this book, we will only be using the effects framework as is, without modification. In order to use the library, you need to first build the Effects11project in both release and debug mode to generate the D3DX11Effects.lib and D3DX11EffectsD.libfiles; you will only need to do this once unless the effects framework is updated (e.g., a new version of the DirectX SDK may update these files, so you may want to rebuild the .lib files to get the latest version). The d3dx11Effect.h header file can be found in DirectX SDK\Samples\C++\Effects11\Inc.
For our sample projects, we place the d3dx11Effect.h, D3DX11EffectsD.lib, and D3DX11Effects.libfiles in the Commondirectory that all of our projects share code from (see the “Introduction” for a description of the sample project organization).

Resources