Re: Camera preview performance
- From: "Gary Daniels [MS]" <garydan@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Jun 2007 13:44:41 -0700
"@sid" <asidden@xxxxxxxxx> wrote in message
news:1181144572.922790.135810@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 6, 4:34 am, "Gary Daniels [MS]" <gary...@xxxxxxxxxxxxxxxxxxxx>
wrote:
Poor preview performance can be caused by a number of things.
Is the camera driver is outputting a very low frame rate? This one is
easy
to fix, just set a higher frame rate when setting the format (as long as
a
frame rate is supported by the hardware).
Is there a color conversion between the camera driver format and display
driver format? If there is, see if you can set the camera format to match
the display driver format.
Does the dimensions of the preview window match the dimensions of the
image
from the camera? If not it will result in a costly shrinking or
stretching
operation to make the camera preview match the window dimension. Select
your
resolution to be the closest match to what you need on the screen.
If none of this helps try using the monte carlo profiler to figure out
what
functions are using the most cpu. Historically this has been
EmulatedBlt_Internal (if there's stretching or shrinking), or a color
conversion routine.
Gary Daniels
Windows CE Multimedia and Graphics
This posting is provided "AS IS" with no warranties, and confers no
rights.
You assume all risk for your use.
"@sid" <asid...@xxxxxxxxx> wrote in message
news:1181041396.116340.243410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 5, 10:18 am, Amit <amitranjan@nospam-saskendotcom> wrote:
If you are using DShow and if your source filter supports Preview pin
,
then
use preview pin to render preview.It may help in improving the
performance
--
Thanks and Regards
Amit Ranjan
blog:http://amitranjan.wordpress.com
"@sid" wrote:
Hi, everybody!
I'm developing an application that allows user to capture still
images
from device's camera (I don't need video capturing at the moment).
So,
the application has preview window, but it's really slow and not
quite
usable.
Can anybody provide any information or tips how the preview
performance can be maintained?
Thanks in advance.
Hi, Amit!
Thanks for quick reply!
Did you mean calling RenderStream with CATEGORY_PREVIEW_PIN parameter?
I do it with the following line:
CHK( m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL) );
If not, can you please point me to some articles about your idea or
provide any code snippet?
Thanks
Hi, Gary!
Thanks for your reply.
I'm a newbie to DirectShow so i need more details about your answers.
How can I know that color conversion is taking place?
How can I know current frame rate and list of supported ones?
Any links to useful information or code samples will be greatly
appreciated.
Thanks
To determine if the color converter is in the graph you can use the
filtergraph manager to search the graph, as you retrieve an interface to
each filter in the graph you can query the filter for it's name. The graph
is always enumerated from the end of the graph toward the beginning.
The color formats and frame rates for each pin on the video capture filter
are available through the IAMStreamConfig interface.
I don't have any code samples of doing this available, but they're fairly
simple interfaces to use and they are documented on MSDN.
Gary Daniels
Windows CE Multimedia and Graphics
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
.
- References:
- Camera preview performance
- From: @sid
- Re: Camera preview performance
- From: @sid
- Re: Camera preview performance
- From: Gary Daniels [MS]
- Re: Camera preview performance
- From: @sid
- Camera preview performance
- Prev by Date: Re: Retrieve a list of world cities
- Next by Date: Re: Video Capture Performance with directshow
- Previous by thread: Re: Camera preview performance
- Next by thread: MessageBox goes to Back
- Index(es):
Relevant Pages
|