I understand you know how to exploit mobile device cameras using directly very well judging by your amazing online article about exactly that. I want to have the same functionality but the ability to extract the raw image data from each frame of the streaming video, for realtime image processing.
This code wont work for grabbing the raw image data.There is another way to do so,however it would involve some amount of work.
What you can do is write your own transform filter and a null renderer and then make a graph.
You can use the Sample Grabber filter(as a transform filter) that comes with the DirectX sdk for the PC,and modify it for the windows mobile environment.And write your own null renderer which would just drop the frames.The Graph in this case would be
Camera Capture->SampleGrabber->Null Renderer.
You would then be able to capture raw frames.You can find more details on Sample Grabber and Null Renderer by googaling..:-)
Hope this helps.
Thanks and Regards
Amit
I am facing so many probems while developing ds filter for windows mobile. I am not able to come out of it. Do you have any example which directly works on windows mobile 5.0? If possible can you please send it to my email. Simple “Hello World” ds filter is also fine.
Awaiting for your response,
Thanks & regards, Raja
Dear Amit,
This is raj. We are discussing about “Access violation” issue with AddRef() in WM 5.0. You asked me mention my email in your blog so that you can share your project with me.
Can you able to see pin & data type information in the registry? Have you installed VS2005 SP1 on your system?
(i) “Visual Studio 2005″ Version 8.0.50727.42 (RTM.050727-4200). Did you install SP1 for VS2005?
(ii) Windows Mobile 5.0 Pocket PC SDK: Strmbase.lib strmiids.lib are available in this. I hope you are also using the samething.
(iii) The default emulator – WM 5.0 which comes with Visual Studio.
(iv) Using debug settings to build the project
If possible can you pls share your application also which register the DS filter?
I have found that directly using the the dllRegisterServer() API
available in the DLL containing custom directshow filters
always works and reliably on Windows Mobile 5.0 and 6.0. Attached is the code snippet to accomplish this:
HMODULE pHDLL= NULL;
pHDLL= LoadLibrary( filepath);
//filepath must be the full path of the DLL
// as WM does not have the concept of current directory
if( pHDLL == NULL)
return false;
/* perform COM registration by invoking DLLRegisterServer() */
myDllRegisterServer fnc= ( myDllRegisterServer )GetProcAddress( pHDLL, “DllRegisterServer”);
HRESULT hres= fnc();
/* Do not forget to free the DLL */
FreeLibrary(pHDLL);
Have you tried using CAM1: instead of GUID?
Will try to get hold of a smartphone and see what may be the problem.Which Smartphone you are using to develop the solution?
Amit,
I am trying to access the video buffer on WM5 and make it gray scale. I wrote DirctShow desktop version and it works. I used the Grabber source code of DX9 to do the tranform filter. I think CTransformInPlace is not supported on WM5. Do you of any tested ready to run sample code that uses the CTransformInPlace or any other way doing the video buffer access.
Many Thanks,
I guess you mean CTransInPlace.If yes then it is defined in the transip.h file in the sdk.Though I havent used it but i dont see any reason why you shouldnt be able to use it…:-)
All the best.
I am facing problem in writing an application that grabs a bitmap (Poster frame) from a movie file for Smartphone. The desktop version works fine but while developing for Smartphone 2005 on VS 8.0 there is no Qedit.h and no support of IMediaDet Interface. I am not finding declaration of ISampleGrabberCB anywhere in Smartphone.
So, can you give me any reference to solve this issue.
Another query is that can I use DirectShow Editing Services for Smartphone….???
hi amit:
i am adnan and working on windows mobile 6 based applications from last 3 years. We are making a multimedia application for wm6. i want to merge two videos, trim them, and also add text or sound to that video. let me know if u can help us out or contact me (m_adnan_tariq@hotmail.com) for any sort of consultancy fee.
The posts on this weblog are provided "AS IS" with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
I understand you know how to exploit mobile device cameras using directly very well judging by your amazing online article about exactly that. I want to have the same functionality but the ability to extract the raw image data from each frame of the streaming video, for realtime image processing.
Hi Ahmed,
This code wont work for grabbing the raw image data.There is another way to do so,however it would involve some amount of work.
What you can do is write your own transform filter and a null renderer and then make a graph.
You can use the Sample Grabber filter(as a transform filter) that comes with the DirectX sdk for the PC,and modify it for the windows mobile environment.And write your own null renderer which would just drop the frames.The Graph in this case would be
Camera Capture->SampleGrabber->Null Renderer.
You would then be able to capture raw frames.You can find more details on Sample Grabber and Null Renderer by googaling..:-)
Hope this helps.
Thanks and Regards
Amit
Hi Amitranjan,
I am facing so many probems while developing ds filter for windows mobile. I am not able to come out of it. Do you have any example which directly works on windows mobile 5.0? If possible can you please send it to my email. Simple “Hello World” ds filter is also fine.
Awaiting for your response,
Thanks & regards, Raja
Dear Amit,
This is raj. We are discussing about “Access violation” issue with AddRef() in WM 5.0. You asked me mention my email in your blog so that you can share your project with me.
Can you able to see pin & data type information in the registry? Have you installed VS2005 SP1 on your system?
My email id is: raja_t_123@techemail.com
(i) “Visual Studio 2005″ Version 8.0.50727.42 (RTM.050727-4200). Did you install SP1 for VS2005?
(ii) Windows Mobile 5.0 Pocket PC SDK: Strmbase.lib strmiids.lib are available in this. I hope you are also using the samething.
(iii) The default emulator – WM 5.0 which comes with Visual Studio.
(iv) Using debug settings to build the project
If possible can you pls share your application also which register the DS filter?
Thanks in advance,
regards, Raj
Hi,
Very useful blog. I have a problem with writing service for WM 5.0. Can you help me regarding this?
Thanks .
I have found that directly using the the dllRegisterServer() API
available in the DLL containing custom directshow filters
always works and reliably on Windows Mobile 5.0 and 6.0. Attached is the code snippet to accomplish this:
HMODULE pHDLL= NULL;
pHDLL= LoadLibrary( filepath);
//filepath must be the full path of the DLL
// as WM does not have the concept of current directory
if( pHDLL == NULL)
return false;
/* perform COM registration by invoking DLLRegisterServer() */
myDllRegisterServer fnc= ( myDllRegisterServer )GetProcAddress( pHDLL, “DllRegisterServer”);
HRESULT hres= fnc();
/* Do not forget to free the DLL */
FreeLibrary(pHDLL);
Hi Amitranjan,
I want to Execute the CameraCapture application sample code of PPC 2005 in smartphone 2005 platform.
But, The problem is its not executing and when i debug it it is failing at:
handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
and
CHK( pPropertyBag->Load( &PropBag, NULL ));
of CGraphManager::GetFirstCameraDriver( WCHAR *pwzName ) method.
I think there is problen in creating the instsnce of camera. But dont know how to solve it.
I ve searched a lot of web sites but ve not got any solution for this issue.
Can you suggest me about the issue ASAP. Its eating up my valuable time.
Regards
Msat
Hi All,
Send me your suggestion here : mrutyunjaya.s@gmail.com
Thanks again
msat
Hi,
Have you tried using CAM1: instead of GUID?
Will try to get hold of a smartphone and see what may be the problem.Which Smartphone you are using to develop the solution?
-Amit
Amit,
I am trying to access the video buffer on WM5 and make it gray scale. I wrote DirctShow desktop version and it works. I used the Grabber source code of DX9 to do the tranform filter. I think CTransformInPlace is not supported on WM5. Do you of any tested ready to run sample code that uses the CTransformInPlace or any other way doing the video buffer access.
Many Thanks,
Hoss
Hi Hoss,
I guess you mean CTransInPlace.If yes then it is defined in the transip.h file in the sdk.Though I havent used it but i dont see any reason why you shouldnt be able to use it…:-)
All the best.
-Amit
Hi Everybody,
I am facing problem in writing an application that grabs a bitmap (Poster frame) from a movie file for Smartphone. The desktop version works fine but while developing for Smartphone 2005 on VS 8.0 there is no Qedit.h and no support of IMediaDet Interface. I am not finding declaration of ISampleGrabberCB anywhere in Smartphone.
So, can you give me any reference to solve this issue.
Another query is that can I use DirectShow Editing Services for Smartphone….???
Thanks and regards
Mrutyunjaya satapathy
hi amit:
i am adnan and working on windows mobile 6 based applications from last 3 years. We are making a multimedia application for wm6. i want to merge two videos, trim them, and also add text or sound to that video. let me know if u can help us out or contact me (m_adnan_tariq@hotmail.com) for any sort of consultancy fee.