As title, I got a pointer to a frame buffer containing YV12 data. Knowing
the width and the height of the image, how do I convert to a RGB565 buffer?
Where did you get the pointer, and where do you have to send it? DirectShow
can do this conversion for you, if you're doing it in a graph.
YV12 is a planar format. If you have a YV12 bitmap of WxH pixels, you have
a WxH array of Y values (H rows of W pixels each), followed by H/2 rows of
W/2 V values, followed by H/2 rows of W/2 U values. 12 bits per pixel.
So, each U and V cover 4 Y values. You can find simple conversion matrices
on the web to convert a YUV pixel to RGB. You don't need a lot of accuracy
if you're only keeping 5 or 6 bits of each component.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
>> As title, I got a pointer to a frame buffer containing
>> YV12 data. Knowing the width and the height of the
>> image, how do I convert to a RGB565 buffer?
>
> Where did you get the pointer, and where do you have to
> send it? DirectShow can do this conversion for you, if
> you're doing it in a graph.
[...]
Actually, I don't think it can. The CSC only supports RGC
and the MSYUV does not support YV12 so, unless you have a
third-party filter, DMO or VCM codec (and some MPEG-4
decoders also convert YV12), it will not work on
Win32/Win64. The CSC on WinCE instead supports YV12 to
RGB565.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
> As title, I got a pointer to a frame buffer containing YV12 data. Knowing
> the width and the height of the image, how do I convert to a RGB565 buffer?
If you decide to convert yourseves, these are going to be helpful:
http://fourcc.org/yuv.php#YV12
http://fourcc.org/rgb.php#BI_RGB
Roman
> As title, I got a pointer to a frame buffer containing YV12 data. Knowing
> the width and the height of the image, how do I convert to a RGB565 buffer?
As YV12 is almost identical to I420/IYUV you could just flip the U and V
planes and then use the AVI Codec for I420.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
I have successfully converted YV12 to RGB565 using the formula and the
sample code found in
http://homepages.borland.com/efg2lab/Graphics/Colors/YUV.htm. I am grabbing
the camera raw data buffer by writing my custom null transform filter and
attempt to render the preview full-screen. However, since YV12 to RGB565
converter is expensive (a lot of floating point operations), the preview
isn't very smooth.
I am creating graph using following code:
// Create the capture graph builder and register the filtergraph manager.
hr = m_pCaptureGraphBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder);
hr = pFilterGraph.CoCreateInstance( CLSID_FilterGraph );
hr = m_pCaptureGraphBuilder->SetFiltergraph(pFilterGraph );
// Create and initialize the video capture filter
hr = m_pVideoCaptureFilter.CoCreateInstance( CLSID_VideoCapture );
hr = m_pVideoCaptureFilter.QueryInterface( &pPropertyBag );
// initialize the camera and use it for video capture
hr = GetFirstCameraDriver( wzDeviceName );
varCamName = wzDeviceName;
hr = PropBag.Write( L"VCapName", &varCamName );
hr = pPropertyBag->Load( &PropBag, NULL );
pPropertyBag.Release();
hr = pFilterGraph->AddFilter( m_pVideoCaptureFilter, L"Video Capture Filter
Source" );
//create our null transform
hr = pNullTransform.CoCreateInstance(CLSID_NullNull);
hr = pFilterGraph->AddFilter(pNullTransform, L"NullNull");
//prepare the preview graph.
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL);
The graph is as followed after the call to RenderStream:
Camera Source --> Smart Tee --> Null Transform Filter --> Color Space
Converter --> Renderer
The null transform filter is automatically inserted to the graph by
RenderStream. Since the camera supports only YV12 and the nulltransform
filter comes before the color space converter, I am receiving YV12 buffer.
I have try to disconnect and reconnect the null transform filter after the
Color Space Converter to see if I can get RGB565. However, the result is
that no samples are passed to the null transform filter at all, although the
graph is running and all API calls return S_OK.
Any ideas how I can improve the performance?
>Hi
>
>As title, I got a pointer to a frame buffer containing YV12 data. Knowing
>the width and the height of the image, how do I convert to a RGB565 buffer?
>
Get the free YUV converter filter from www.gdcl.co.uk. This will
convert between various YUV formats including YV12 and a number of RGB
filters.
G
> I have try to disconnect and reconnect the null transform filter after the
> Color Space Converter to see if I can get RGB565. However, the result is
> that no samples are passed to the null transform filter at all, although the
> graph is running and all API calls return S_OK.
You need to set a media type for the NULL Transform Filter. It should
reject all formats except for RGB565 and then it will get automatically
inserted in the correct place. You should use a different name for your
Color Space Converter so as to not confuse us :)
> Any ideas how I can improve the performance?
Use an already optimized converter (like Geraint's) or optimize what you
have to use integer approximations instead of floating point.
>> Any ideas how I can improve the performance?
>
> Use an already optimized converter (like Geraint's) or
> optimize what you have to use integer approximations
> instead of floating point.
Or, since you are running on WindowsMobile/CE, use the stock
ColorSpaceConverter which performs YV12 to RGB565 just fine.
Yes, forget about the floating point code. You're only keeping 5 or 6 bits
of each component, so just use integer arithmeting for the matrix math.
By "Color Space Converter" I mean the built-in color space converter
provided by DirectShow. :)
I have tried setting a media type for my NULL transform filter in the
function CheckInputType. Is this the correct way?
// We accept any input type. We'd return S_FALSE for any we didn't like.
HRESULT CheckInputType(const CMediaType* mtIn)
{
printf("@CheckInputType\n");
if (mtIn->majortype == MEDIATYPE_Video && mtIn->subtype ==
MEDIASUBTYPE_RGB565)
{
printf("MEDIASUBTYPE_RGB565\n");
return S_OK;
}
else
{
printf("S_FALSE\n");
return S_FALSE;
}
}
The debugger shows that MEDIASUBTYPE_RGB565 was never sent as parameter to
CheckInputType. S_FALSE will be returned all the times and as such, the
filter will not be inserted into the graph as it is deemed "not good" by the
Intelligent Connect process. :(
Or do I have to do something with this?
const AMOVIESETUP_MEDIATYPE sudPinTypes =
{
&MEDIATYPE_NULL // clsMajorType
, &MEDIASUBTYPE_NULL // clsMinorType
};
const AMOVIESETUP_PIN psudPins[] =
{ { L"Input" // strName
, FALSE // bRendered
, FALSE // bOutput
, FALSE // bZero
, FALSE // bMany
, &CLSID_NULL // clsConnectsToFilter
, L"" // strConnectsToPin
, 1 // nTypes
, &sudPinTypes // lpTypes
}
, { L"Output" // strName
, FALSE // bRendered
, TRUE // bOutput
, FALSE // bZero
, FALSE // bMany
, &CLSID_NULL // clsConnectsToFilter
, L"" // strConnectsToPin
, 1 // nTypes
, &sudPinTypes // lpTypes
}
};
const AMOVIESETUP_FILTER sudNullNull =
{
&CLSID_NullNull // clsID
, L"Minimal Null" // strName
, MERIT_DO_NOT_USE // dwMerit
, 2 // nPins
, psudPins // lpPin
};
> if (mtIn->majortype == MEDIATYPE_Video && mtIn->subtype
Try to also accept MEDIATYPE_VideoBuffered.
Thanks for the suggestion, MEDIATYPE_VideoBuffered.was indeed passed to
CheckInputType and changing the IF statement causes the function to return
S_OK. The filter was inserted into the graph, however, again, no samples
were received by the filter!
Anyway, this is not a critical problem as I can be happy with conversion
from YV12 to RGB565. However, I cannot understand why I can't capture JPG
image using:
CHK( pVideoControl->SetMode( pStillPin, VideoControlFlag_Trigger ));
My graph is as followed:
Camera Source --> Smart Tee (Preview/Capture/Still pins) --> Null Transform
Filter --> Color Space Converter --> Renderer
I make the following call to RenderStream:
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL);
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, m_pVideoCaptureFilter, pVideoEncoder, pASFMultiplexer);
hr = m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_STILL,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, pImageSinkFilter );
Following the CameraCaptureSample in the Windows Mobile SDK, I added the
following. The comment for this says "prevent data from flowing into the
capture stream" but I don't understand what this exactly means. Any ideas?
CHK( m_pCaptureGraphBuilder->ControlStream( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, m_pVideoCaptureFilter, 0, 0 ,0,0 ));
The null transform filer is rendering a preview full screen. To capture an
image, I called:
CHK( m_pVideoCaptureFilter.QueryInterface( &pUnkCaptureFilter ));
CHK( m_pCaptureGraphBuilder->FindPin( pUnkCaptureFilter, PINDIR_OUTPUT,
&PIN_CATEGORY_STILL, &MEDIATYPE_Video, FALSE, 0, &pStillPin ));
CHK( m_pImageSinkFilter.QueryInterface( &pFileSink ));
CHK( pFileSink->SetFileName( L"\\test.jpg", NULL ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pVideoControl ));
CHK( pVideoControl->SetMode( pStillPin, VideoControlFlag_Trigger ));
All HRESULTs are S_OK, but the file is not created! If I stepped through the
code in the debugger, sometimes a JPEG file is partially created, which
contains 1/4 or 1/3 of the actual image surrouned by green color. I have
tried to stop the preview, start/stop the graph before capturing picture,
but to no avail.
Any ideas what I am missing here?
>From: "minhdanh"
>
>> if (mtIn->majortype == MEDIATYPE_Video && mtIn->subtype
>
>Try to also accept MEDIATYPE_VideoBuffered.
I'm not familiar with that. What does it mean?
>>Try to also accept MEDIATYPE_VideoBuffered.
>
> I'm not familiar with that. What does it mean?
http://msdn.microsoft.com/en-us/library/aa924843.aspx
<quote>
For Windows Mobile
Buffering Media Types
The media types MEDIATYPE_AudioBuffered and MEDIATYPE_VideoBuffered
identify that an encoding filter cannot encode data in real time. The
Capture Graph Builder inserts a buffering filter immediately upstream from
the encoding filter whenever it encounters either of these media types. The
MEDIATYPE_AudioBuffered and MEDIATYPE_VideoBuffered media types support the
same subtypes as MEDIATYPE_Audio and MEDIATYPE_Video respectively.
</quote>
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
> was inserted into the graph, however, again, no samples
> were received by the filter!
[...]
> Following the CameraCaptureSample in the Windows Mobile
> SDK, I added the following. The comment for this says
> "prevent data from flowing into the capture stream" but I
> don't understand what this exactly means. Any ideas?
> CHK( m_pCaptureGraphBuilder->ControlStream(
> &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
> m_pVideoCaptureFilter, 0, 0 ,0,0 ));
Have you read the docs for
ICaptureGraphBuilder2::ControlStream()?
http://msdn.microsoft.com/en-us/library/aa928664.aspx
http://msdn.microsoft.com/en-us/library/ms784853(VS.85).aspx
That call to ControlStream() asks the capture pin to not
deliver any sample.
> All HRESULTs are S_OK, but the file is not created! If I
> stepped through the code in the debugger, sometimes a
> JPEG file is partially created, which contains 1/4 or 1/3
> of the actual image surrouned by green color.
That sounds like you are not waiting long enough for the
image to be captured or you are not dispatching window
messages on the thread(s) that created the graph and
filters.
You need to post your exact graph topology
(IGraphBuilder::EnumFilter(), IBaseFilter()::EnumPins(),
IPin::QueryDirection(), IPin::ConnectedTo(),
IPin::ConnectionMediaType()), how you configured each
filter, the sequence of calls to ControlStream() and what
each thread in your app does.
//stop the preview stream. This returns S_FALSE but is critical for file to
be captured.
hr = m_pCaptureGraphBuilder->ControlStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL, 0, 0);
//restart the graph - take 2 seconds
hr = pMediaControl->Stop();
hr = pMediaControl->Run();
//prepare to capture file
CHK( m_pImageSinkFilter.QueryInterface( &pFileSink ));
CHK( pFileSink->SetFileName(filename, NULL ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pUnkCaptureFilter ));
CHK( m_pCaptureGraphBuilder->FindPin( pUnkCaptureFilter, PINDIR_OUTPUT,
&PIN_CATEGORY_STILL, &MEDIATYPE_Video, FALSE, 0, &pStillPin ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pVideoControl ));
//actual capturing of image - take 4 seconds
CHK( pVideoControl->SetMode( pStillPin, VideoControlFlag_Trigger ));
//wait for encoding. Alternatively use GetEvent to look for
EC_CAP_FILE_COMPLETED
Sleep(1000);
//start the preview. Again this returns S_FALSE but is critical for filed to
be captured.
dwStart=0;
dwEnd=MAXLONGLONG;
hr = m_pCaptureGraphBuilder->ControlStream( &PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, &dwStart, &dwEnd, wStartCookie,
wEndCookie );
//restart the graph - take 7 seconds
hr = pMediaControl->Stop();
hr = pMediaControl->Run();
It seems that PIN_CATEGORY_STILL cannot cooperate with PIN_CATEGORY_PREVIEW
and the latter needs to be disabled in order for PIN_CATEGORY_STILL to be
able to capture an image! I need to call ControlStream to stop the preview
pin and also restart the graph for it work! After capturing, in order to
continue the preview, I'll need to call ControlStream one more time and
restart the graph again! This is painfully slows (totally take 15 seconds).
Any ideas how I can make it better, probably by avoiding the restarting of
the graph?
Thanks
Can you please help me out with how to save Still image as BMP or JPeg.
minhdanh wrote:
I figured out that I will be able capture an image into JPEG by using the
15-Jul-08
Thanks
Previous Posts In This Thread:
On Wednesday, July 09, 2008 10:31 PM
minhdanh wrote:
convert YV12 to RGB565
Hi
As title, I got a pointer to a frame buffer containing YV12 data. Knowing
the width and the height of the image, how do I convert to a RGB565 buffer?
On Thursday, July 10, 2008 3:24 AM
Tim Roberts wrote:
Re: convert YV12 to RGB565
"minhdanh" <mdan...@hotmail.com> wrote:
Where did you get the pointer, and where do you have to send it? DirectShow
can do this conversion for you, if you're doing it in a graph.
YV12 is a planar format. If you have a YV12 bitmap of WxH pixels, you have
a WxH array of Y values (H rows of W pixels each), followed by H/2 rows of
W/2 V values, followed by H/2 rows of W/2 U values. 12 bits per pixel.
So, each U and V cover 4 Y values. You can find simple conversion matrices
on the web to convert a YUV pixel to RGB. You don't need a lot of accuracy
if you're only keeping 5 or 6 bits of each component.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
On Thursday, July 10, 2008 10:12 AM
Alessandro Angeli wrote:
Re: convert YV12 to RGB565
From: "Tim Roberts"
[...]
Actually, I don't think it can. The CSC only supports RGC
and the MSYUV does not support YV12 so, unless you have a
third-party filter, DMO or VCM codec (and some MPEG-4
decoders also convert YV12), it will not work on
Win32/Win64. The CSC on WinCE instead supports YV12 to
RGB565.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
On Thursday, July 10, 2008 6:36 PM
Chris P. wrote:
Re: convert YV12 to RGB565
As YV12 is almost identical to I420/IYUV you could just flip the U and V
planes and then use the AVI Codec for I420.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
On Friday, July 11, 2008 2:00 AM
minhdanh wrote:
Thanks for the explanation on YV12 format.
Thanks for the explanation on YV12 format.
I have successfully converted YV12 to RGB565 using the formula and the
sample code found in
http://homepages.borland.com/efg2lab/Graphics/Colors/YUV.htm. I am grabbing
the camera raw data buffer by writing my custom null transform filter and
attempt to render the preview full-screen. However, since YV12 to RGB565
converter is expensive (a lot of floating point operations), the preview
isn't very smooth.
I am creating graph using following code:
// Create the capture graph builder and register the filtergraph manager.
hr = m_pCaptureGraphBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder);
hr = pFilterGraph.CoCreateInstance( CLSID_FilterGraph );
hr = m_pCaptureGraphBuilder->SetFiltergraph(pFilterGraph );
// Create and initialize the video capture filter
hr = m_pVideoCaptureFilter.CoCreateInstance( CLSID_VideoCapture );
hr = m_pVideoCaptureFilter.QueryInterface( &pPropertyBag );
// initialize the camera and use it for video capture
hr = GetFirstCameraDriver( wzDeviceName );
varCamName = wzDeviceName;
hr = PropBag.Write( L"VCapName", &varCamName );
hr = pPropertyBag->Load( &PropBag, NULL );
pPropertyBag.Release();
hr = pFilterGraph->AddFilter( m_pVideoCaptureFilter, L"Video Capture Filter
Source" );
//create our null transform
hr = pNullTransform.CoCreateInstance(CLSID_NullNull);
hr = pFilterGraph->AddFilter(pNullTransform, L"NullNull");
//prepare the preview graph.
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL);
The graph is as followed after the call to RenderStream:
Camera Source --> Smart Tee --> Null Transform Filter --> Color Space
Converter --> Renderer
The null transform filter is automatically inserted to the graph by
RenderStream. Since the camera supports only YV12 and the nulltransform
filter comes before the color space converter, I am receiving YV12 buffer.
I have try to disconnect and reconnect the null transform filter after the
Color Space Converter to see if I can get RGB565. However, the result is
that no samples are passed to the null transform filter at all, although the
graph is running and all API calls return S_OK.
Any ideas how I can improve the performance?
On Friday, July 11, 2008 6:00 AM
Geraint Davies wrote:
Re: convert YV12 to RGB565
wrote:
Get the free YUV converter filter from www.gdcl.co.uk. This will
convert between various YUV formats including YV12 and a number of RGB
filters.
G
On Friday, July 11, 2008 9:54 AM
Chris P. wrote:
Re: convert YV12 to RGB565
On Fri, 11 Jul 2008 14:00:03 +0800, minhdanh wrote:
You need to set a media type for the NULL Transform Filter. It should
reject all formats except for RGB565 and then it will get automatically
inserted in the correct place. You should use a different name for your
Color Space Converter so as to not confuse us :)
Use an already optimized converter (like Geraint's) or optimize what you
have to use integer approximations instead of floating point.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
On Friday, July 11, 2008 11:03 PM
Roman Ryl... wrote:
Hi,If you decide to convert yourseves, these are going to be
Hi,
If you decide to convert yourseves, these are going to be helpful:
http://fourcc.org/yuv.php#YV12
http://fourcc.org/rgb.php#BI_RGB
Roman
On Friday, July 11, 2008 11:35 PM
Tim Roberts wrote:
Re: convert YV12 to RGB565
"minhdanh" <mdan...@hotmail.com> wrote:
Yes, forget about the floating point code. You're only keeping 5 or 6 bits
of each component, so just use integer arithmeting for the matrix math.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
On Saturday, July 12, 2008 11:07 PM
minhdanh wrote:
On Saturday, July 12, 2008 11:18 PM
Alessandro Angeli wrote:
Re: convert YV12 to RGB565
From: "minhdanh"
Try to also accept MEDIATYPE_VideoBuffered.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
On Sunday, July 13, 2008 12:06 AM
minhdanh wrote:
Thanks for the suggestion, MEDIATYPE_VideoBuffered.
Thanks for the suggestion, MEDIATYPE_VideoBuffered.was indeed passed to
CheckInputType and changing the IF statement causes the function to return
S_OK. The filter was inserted into the graph, however, again, no samples
were received by the filter!
Anyway, this is not a critical problem as I can be happy with conversion
from YV12 to RGB565. However, I cannot understand why I can't capture JPG
image using:
CHK( pVideoControl->SetMode( pStillPin, VideoControlFlag_Trigger ));
My graph is as followed:
Camera Source --> Smart Tee (Preview/Capture/Still pins) --> Null Transform
Filter --> Color Space Converter --> Renderer
I make the following call to RenderStream:
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL);
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, m_pVideoCaptureFilter, pVideoEncoder, pASFMultiplexer);
hr = m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_STILL,
&MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, pImageSinkFilter );
Following the CameraCaptureSample in the Windows Mobile SDK, I added the
following. The comment for this says "prevent data from flowing into the
capture stream" but I don't understand what this exactly means. Any ideas?
CHK( m_pCaptureGraphBuilder->ControlStream( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, m_pVideoCaptureFilter, 0, 0 ,0,0 ));
The null transform filer is rendering a preview full screen. To capture an
image, I called:
CHK( m_pVideoCaptureFilter.QueryInterface( &pUnkCaptureFilter ));
CHK( m_pCaptureGraphBuilder->FindPin( pUnkCaptureFilter, PINDIR_OUTPUT,
&PIN_CATEGORY_STILL, &MEDIATYPE_Video, FALSE, 0, &pStillPin ));
CHK( m_pImageSinkFilter.QueryInterface( &pFileSink ));
CHK( pFileSink->SetFileName( L"\\test.jpg", NULL ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pVideoControl ));
CHK( pVideoControl->SetMode( pStillPin, VideoControlFlag_Trigger ));
All HRESULTs are S_OK, but the file is not created! If I stepped through the
code in the debugger, sometimes a JPEG file is partially created, which
contains 1/4 or 1/3 of the actual image surrouned by green color. I have
tried to stop the preview, start/stop the graph before capturing picture,
but to no avail.
Any ideas what I am missing here?
On Sunday, July 13, 2008 7:56 AM
minhdanh wrote:
Also, using the above graph, my PIN_CATEGORY_CAPTURE is running an ASF
Also, using the above graph, my PIN_CATEGORY_CAPTURE is running an ASF
multiplexer which would save the recorded video as an ASF file. The preview
is smooth but the output ASF seems to drop a lot of frames. Stopping
PIN_CATEGORY_PREVIEW allows me to record at full frame rate (but I need to
preview to be visible during recording). Any ideas how I can improve this?
On Monday, July 14, 2008 12:36 AM
Tim Roberts wrote:
Re: convert YV12 to RGB565
I am not familiar with that. What does it mean?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
On Monday, July 14, 2008 4:08 AM
The March Hare [MVP] wrote:
Re: convert YV12 to RGB565
http://msdn.microsoft.com/en-us/library/aa924843.aspx
<quote>
For Windows Mobile
Buffering Media Types
On Monday, July 14, 2008 11:23 AM
Alessandro Angeli wrote:
Re: convert YV12 to RGB565
From: "minhdanh"
[...]
Have you read the docs for
ICaptureGraphBuilder2::ControlStream()?
http://msdn.microsoft.com/en-us/library/aa928664.aspx
http://msdn.microsoft.com/en-us/library/ms784853(VS.85).aspx
That call to ControlStream() asks the capture pin to not
deliver any sample.
That sounds like you are not waiting long enough for the
image to be captured or you are not dispatching window
messages on the thread(s) that created the graph and
filters.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
On Monday, July 14, 2008 11:26 AM
Alessandro Angeli wrote:
Re: convert YV12 to RGB565
From: "minhdanh"
You need to post your exact graph topology
(IGraphBuilder::EnumFilter(), IBaseFilter()::EnumPins(),
IPin::QueryDirection(), IPin::ConnectedTo(),
IPin::ConnectionMediaType()), how you configured each
filter, the sequence of calls to ControlStream() and what
each thread in your app does.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
On Tuesday, July 15, 2008 12:01 PM
minhdanh wrote:
Thanks
EggHeadCafe - Software Developer Portal of Choice
Visual Basic.NET and the .NET Platform [aPress]
http://www.eggheadcafe.com/tutorials/aspnet/939124c8-4843-4bc7-a912-35144a12f26e/visual-basicnet-and-the.aspx